I am trying to use a custom image as a button in my app. How do I add an action for an image?
This is for an iOS app and I don't want to use the default text button as a button. I've already tried control+dragging the image to the ViewController but there is no "Action" option.
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let designChoice = designPrac.randomElement()
let forChoice = forWhatPrac.randomElement()
let helpChoice = toHelpPrac.randomElement()
designLabel.text = designChoice
forLabel.text = forChoice
helpLabel.text = helpChoice
}
This is the code I have to run when the app launches but I can't find a way to get this to work for when my image button is clicked.