3 works

Add Button Response in Swift


dashboard+ Project

Posted by @mishka #ios #swift

Code snippet:

@IBAction func doSomething()
@IBAction func doSomething(sender: UIButton)
@IBAction func doSomething(sender: UIButton, forEvent event: UIEvent)
content_copyCopy to Clipboard

More details:

You connect a button to your action method using the addTarget(_:action:for:) method or by creating a connection in Interface Builder. The signature of an action method takes one of three forms, which are listed in Listing 1. Choose the form that provides the information that you need to respond to the button tap.

Code snippet source:

https://developer.apple.com/documentation/uikit/uibutton

>> Browse more code snippets

more_vert