Story This week, my colleague asked me a question: how to observe user selection behaviors on SwiftUI's Picker ? This is a question came from real bussiness. Thus I think it worth to take me time to solve it. The example code is as shown below and my colleague wanted to observe user's behaviors on…
Preface Apple introduced SwiftUI at WWDC 2019. Most people may seem SwiftUI as yet another UI framework likes Flutter , React.js or Vue.js which rides on the trend of declarative stateless UI programming. Even though there are some common points between them, SwiftUI is far different from…
Introduction Recently, one of my colleagues had been struggling with porting reference semantics model to SwiftUI with ObservableObject and @StateObject . In this post, since there are many examples talked about porting reference semantics models to SwiftUI this way on the Internet, I'm not going…