Understanding Associated Value Enums Why there are associated value enums in Swift? I mean, why the Swift core team designed associated value enum? To understand it, firstly, let's take a look at the following example in C: The C struct Device represents a device. The member pointer is an…
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…
Case Study: Intervening UIScrollView Instances's Pan Gesture Recognizer As we known, UIScrollView translates pan gesture signals into scrollViewDidXXX: messages and sends to its delegate, most of the time you only have to understand the relationships between the pan gesture signals and the…
Preface What is the most critical thing swings your decision when you choose a programming language? Some people may say, the less lines of code they write, the better the language itself is. (Nope, the best programming language is PHP.) OK. It might be true. But writing less code is not an…