programmatically dynamically add button and functions to stack view code example
Example: how to add button dynamically in swift 4
let button = UIButton(x:0; y:0, width: 80, height: 30)
let button = UIButton(x:0; y:0, width: 80, height: 30)