Skip to content

Instantly share code, notes, and snippets.

@BalestraPatrick
Last active February 10, 2016 16:56
Show Gist options
  • Save BalestraPatrick/6de904d7f4c5bdbab8bc to your computer and use it in GitHub Desktop.
Save BalestraPatrick/6de904d7f4c5bdbab8bc 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