UIKit

UIView (or UIViewController)

Programatic View Setup

control.addTarget(self,
                  action: #selector(myCustomFuncName(_:)),
                  for: .valueChanged)
//...
@objc func myCustomFuncName(_ segControl: UISegmentedControl) {…}

Ways to Trigger Actions

Pop Up Buttons

let options = [UIAction(title: "Some Title", state: .on) {…}]
popUpButton.menu = UIMenu(children: options)

Expandable Text Views