iOS ContentHugging vs. ContentCompressionResistance in UIStackView In Swift, it is quite common to see ContentHugging and ContentCompressionResistance either when we are using the storyboard or code to render the user interfaces in UIStackView. Those 2 properties Needone 9 Dec 2022 · 1 min read
Swift A summary of use enum in Swift Enumeration type is a common type in many programming languages, which normally presents a set of limited status for a program, such as list all the directions for a compass: Needone 1 Mar 2021 · 2 min read
Swift Use Extension in Swift Extension is a great feature in Swift, which can help us to create helper/utility variables and method, and etc. Use extension to conform protocols It is quite common to Needone 27 Feb 2021 · 1 min read
iOS Property in Swift Unlike other programming languages, there are three types properties in Swift. Stored Properties They are constants or variables of a class, and part of the class instances that used to Needone 25 Feb 2021 · 1 min read
Swift Keyword Lazy in Swift lazy variables are variables will be computed until accessing. In other words, lazy variables won't have the real value until get called/used. As lazy variables can be re-assigned, so Needone 31 Dec 2020 · 1 min read
Swift Preview in SwiftUI Once you have finished the SwiftUI code, it is always a good idea to preview it before implement any function code. Luckily, such feature is natively supported by SwiftUI - Needone 19 Dec 2020 · 1 min read
iOS Complete guide on custom class/struct comparison swift compare custom class or custom struct Needone 15 Aug 2020 · 2 min read
Mobile Singleton in Objective-C/Swift What is behind the Singleton? Singleton: Instantiation of a class to ONLY one object Features of Singleton: 1. One class only can have only one instance; 2. It must can Needone 11 Nov 2017 · 1 min read
Mobile viewWillAppear, viewDidAppear, viewDidLoad, viewWillDisappear and viewDidDisappear? Introduction Before this, let me ask you what is the running order of viewWillAppear, viewDidAppear, viewDidLoad, viewWillDisappear and viewDidDisappear? If you know the answer, please close this webpage and continue Needone 8 Apr 2017 · 2 min read