Xcode is not allowing me to put constraints on my BarButtonItem
on a ViewController in the MainStoryBoard. It\'s appearing too far to the left where it\'s unrea
Try this:
let rightConstraint = NSLayoutConstraint(item: your_item_here, attribute: .Right, relatedBy: .Equal, toItem: your_item_here, attribute: .Left, multiplier: 0, constant: 1)
your_item_here.addConstraint(rightConstraint)
P.S if you want to add constraint to your UIBarButtonItem, it will rise an error
Value of type 'UIBarButtonItem' has no member 'addConstraint'
P.S.S
Because of it is not a view class, you can't apply constraints to it.