Skip to content

Instantly share code, notes, and snippets.

@BalestraPatrick
Last active February 7, 2016 15:13
Show Gist options
  • Save BalestraPatrick/787099b7028a3c27c484 to your computer and use it in GitHub Desktop.
Save BalestraPatrick/787099b7028a3c27c484 to your computer and use it in GitHub Desktop.
func getUsers() -> Observable<[SectionModel<String, User>]> {
return Observable.create { (observer) -> Disposable in
let users = [User(followersCount: 1005, followingCount: 495, screenName: "BalestraPatrick"),
User(followersCount: 380, followingCount: 5, screenName: "RxSwiftLang"),
User(followersCount: 36069, followingCount: 0, screenName: "SwiftLang")]
let section = [SectionModel(model: "", items: users)]
observer.onNext(section)
observer.onCompleted()
return AnonymousDisposable{}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment