Reputation: 9
How do I return two different types of data with IGListkit?
func objects(for listAdapter: ListAdapter) -> [ListDiffable] {
var data = searchCompleter.results
data += propertyController.properties
return searchCompleter.results
}
I'm getting this error:
Binary operator '+=(::)' cannot be applied to operands of type '[MKLocalSearchCompletion]' and '[Property]'
Upvotes: 0
Views: 52
Reputation: 135
Try this !
func objects(for listAdapter: ListAdapter) -> [ListDiffable] {
var data = searchCompleter.results as [ListDiffable]
let properties = propertyController.properties
data += properties
return data
}
Upvotes: 0