From the course: RxSwift: Design Patterns for iOS Developers

Unlock this course with a free trial

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

Network with Rx

Network with Rx

- [Narrator] The next thing that we're going to look at is another type of network example. If you remember in the basic example view controller we were using URL session data tasks to load an actual JSON object that we parsed and then presented. Another way of doing this is working with a library called Alamofire and RxAlamofire. Let's go ahead and go to the network layer plus extensions and this is an RxAlamofire implementation hitting a similar end point that will return a list of postings to us. This is all we have to do is write this and then it will return an observable that we can respond to. So the next part is to go to the model layer and consume that. Go ahead and collapse these other layers. We'll also need to add something right up here on line 11. We'll make a new messages variable array that we will be responding to. So we'll say variable of type array of message. And message is just another POSO, it has similar properties. Let's take a look at message. Again we just…

Contents