viewDidLoad() - after interface file loaded, outlets reference objects. Override if only need to configure onceviewWillAppear(_:) - just before VC’s view added to window. Override if needs to happen each time VC’s view appears on screenloadView() - override to create a VC’s view programmaticallycontrol.addTarget(self,
action: #selector(myCustomFuncName(_:)),
for: .valueChanged)
//...
@objc func myCustomFuncName(_ segControl: UISegmentedControl) {…}
@IBActions (example: UIButton)addTarget() #selectors (example: UISegmentedControl .valueChanged)UIActions (example: UIDatePicker)let options = [UIAction(title: "Some Title", state: .on) {…}]
popUpButton.menu = UIMenu(children: options)
tableView.beginUpdates() then tableView.endUpdates() to trigger relayout (see https://stackoverflow.com/a/5659468/477480)