How to trigger UIButton action programmatically
UIButton has a method to invoke the targets/selectors that are linked to a certain control event:
[button sendActionsForControlEvents:UIControlEventTouchUpInside];
2022 Swift syntax:
someButton.sendActions(for: .primaryActionTriggered)
Swift 3.0/4.0/5.0
button.sendActions(for: .touchUpInside)