Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

how to create button action programmatically in ios

let button   = UIButton(type: UIButtonType.System) as UIButton
button.frame = CGRectMake(100, 100, 100, 50)
button.backgroundColor = UIColor.greenColor()
button.setTitle("Test Button", forState: UIControlState.Normal)
self.view.addSubview(button)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #create #button #action #programmatically #ios
ADD COMMENT
Topic
Name
2+9 =