Change position of a IBOutlet in Swift

Clément Bisaillon picture Clément Bisaillon · Aug 25, 2014 · Viewed 10.9k times · Source

So i have this button:

@IBOutlet var bouton: UIBarButtonItem!

And i want to change is position

But the buton doesn't seems to have a position property like for SKSpriteNode

So is there a way to change is position ?

Answer

Atomix picture Atomix · Aug 26, 2014

If you want to programmatically change the position of any view, you can use this:

button.frame.origin = CGPoint(x: 10, y: 10)