How to Control the World https://vimeo.com/291588126 Reactive view models, simplified https://www.youtube.com/watch?v=uTLG_LgjWGA Kickstarter ios-ossߏͷղઆ https://note.mu/yimajo/n/ne44c7945279a RxSwiftݚڀಡຊ3 ViewModelઃܭύλʔϯೖ https://booth.pm/ja/items/1223536 Kickstarter-iOSͷViewModelͷ࡞Γํ͕Ϛ͔ͬͨ https://qiita.com/muukii0803/items/045b12405f7acff1a9fd
conform to protocols. Avoid classes. https://twitter.com/cocoaphony/status/1104114233288151043 ϙϦϞʔϑΟζϜ ಉ໊͡લͷϝιουΛෳͷΫϥεͰ༻Ͱ͖ΔΑ͏ʹ͠ɺͦͷϝ ιουΛ௨ͯ͠ɺ҉తʹෳͷΠϯελϯεͷಈ࡞ΛΓସ͑Δ ͜ͱ͕Ͱ͖ΔΑ͏ʹ͢Δ͜ͱ
thinking about a kind of protocol that could join them all together. …it’s important to think of things as this way around. To start with some concrete types, and then try and unify them with a protocol. Swift Generics (Expanded) WWDC2018
use cases Discover a need for generic code Try to compose solutions from existing protocols first Consider a generic type instead of a protocol Modern Swift API Design WWDC2019
Error>) -> Void) { dataTask(with: request) { (data, _, error) in if let error = error { return completion(.failure(error)) } if let data = data { completion(.success(data)) } }.resume() } }
ID = Identifier<Self, IDType> var id: ID { get } } protocol Fetchable: Identifiable { static var apiBase: String { get } } ࣝผࢠ(Identifier)Λ࣋ͭ IDΛͬͯAPI͔Βσʔλऔಘ
WWDC2019 Start with a concrete use cases Discover a need for generic code Try to compose solutions from existing protocols first Consider a generic type instead of a protocol