How to implement two inits with same content without code duplication in Swift?
What we need is a common place to put our initialization code before calling any superclass’s initializers, so what I currently using, shown in a code below. (It also cover the case of interdependence among defaults and keep them constant.) import UIKit class MyView: UIView { let value1: Int let value2: Int enum InitMethod { … Read more