Join Jon Bott for an in-depth discussion in this video Traits, part of RxSwift: Design Patterns for iOS Developers.
- [Instructor] The next type to talk about are traits,…which are just specialized observables.…I don't think it's worth your time…to watch me type all of this out…because you will be using these in a template form…over and over again,…and so I've provided a file inside of your exercise files.…Under the starter project,…there's a file called TraitsRx.swift.…Let's go ahead and bring this over to our project…and put it in the simple examples folder…and let's go ahead…and take a look at what this TraitsRx file looks like.…
It's just a singleton,…and we have a DisposeBag,…but the pieces I want you to focus on are lines 11,…lines 35, and line 60.…Each of these has an example for the different type…of traits you would be using.…Traits are really similar to observables…in how we create them,…the set of observables…and type out create.…We'll say single type dot create.…The only other difference in here…is that instead of posting an event like on next…or on error,…we're actually just using the single…as if it's a closure…and we're handing it either success or error…
- RxSwift syntax
- Creating simple observables
- Architecting the model layer
- Using Core Data
- Grouping tasks
- Changing UI
- Threading in the model and UI
Skill Level Advanced
Swift 4: Protocol-Oriented Programmingwith Károly Nyisztor1h 44m Intermediate
Swift: Writing Reusable Frameworkswith David Okun1h 49m Intermediate
Learning Server-Side Swift Using IBM Kiturawith Mohammad Azam1h 51m Intermediate
1. The Basics
2. Model Layer
3. Presenter and View
Next steps1m 17s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.