From the course: RxSwift: Design Patterns for iOS Developers

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Threading in UI

Threading in UI

- [Instructor] So the last thing to do is to clarify threading a little bit. Let's come up into here, just copy this region, and we'll make a new region for us to work in. We'll also come into this old tableView area. Make it a block quote, and just minimize that. Collapse it, and in here we're going to say this is a Threading, in fact a UI Threading area. And I'll call something called threading. And let's go ahead and consume this up in our rxExamples. Come back down to here, and all I'm going to do in here is say presenter.friends.asObservable .subscribe, just do the onNext. In fact we won't even worry about the specific types of this we'll say subscribe on event, and I don't care about the event here, I'll say weak self, 'cause we'll be using that within here, hold this block over and disposed(by: bag). And in here, I just want to print out a couple of statements about what thread we are on. So I'll say print, and in here I'll say stoplight for notification, current thread is…

Contents