1

I am trying to change the position of a label in my viewDidAppear() method using the following code:

self.StartTextLabel.text = self.starttext
self.StartTextLabel.center.x = ChangeStart.center.x

The text in the label changes just find but the labels position does not change.

I have tried doing this with and without the code being within

dispatch_async(dispatch_get_mail_queue()){
}

The label was originally build in the IntefaceBuilder and is linked to my controller via

@IBOutlet weak var StartTextLabel: UILabel!

Does anyone have any idea why the label is not moving?

Thanks

  • U might have set auto layout and size classes in your app. If auto layout is on, then frames will be automatically handled by constraints. Check this link for more info. http://stackoverflow.com/questions/17504645/why-cant-i-change-the-frame-of-my-uilabel http://stackoverflow.com/questions/14025368/cant-move-uilabels-y-position-with-autolayout-on-in-view – DHEERAJ Jul 03 '15 at 09:52
  • 1
    Hey, auto layout is enabled, and i am able to programatically change the position of other objects (UIImageView) in my code. Size classes are disabled in my application - The label has no constraints on it – Alexander Yogi Macdonald Jul 03 '15 at 09:56

0 Answers0