Change position of IBOutlet in Swift
2 answers
You cannot set a button using myButton.frame.origin if you are using autoplay. Therefore, you must add constraints. For example:
let buttonConstraintY = NSLayoutConstraint(item: youButton, attribute: NSLayoutAttribute.centerY, relatedBy: NSLayoutRelation.equal, toItem: view, attribute: NSLayoutAttribute.bottom, multiplier: 1, constant: 10)
self.view.addConstraint(buttonConstraintY)
+1
source to share