I am using RxSwift for my iOS app.
I have a function which returns an Observable of items called Repository.
func search(query: String) -> Observable<Repository>
Basically it makes a network request to github to download the repositories given a search query.
Now, when I call this function, I follow the example in RxSwift documentation:
search(queryText).subscribeNext({ repo in
print(repo)
})
But Xcode says
Cannot invoke 'subscribeNext' with an argument list of type '((Repository) -> ())'
That's weird because that's what Xcode suggests to sue when I use autocompletion. I already tried clean and re-build. I get the same kind of error even if I use another subscribe method.
So, what's wrong with this?