Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swift uibutton programmatically set ontap function

myButton.addTarget(self, action: #selector(myButtonTapped), for: .touchUpInside)
@objc func myButtonTapped() {
    print("My button was tapped!")
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #swift #uibutton #programmatically #set #ontap #function
ADD COMMENT
Topic
Name
1+5 =