Here is my problem, I want to animate my login screen which is a basic screen, 2 UITextView and 2 buttons (Log in and Signup)
I want to make my Username field appear out of the screen when the app launches and animate it , so here is my code :
override func viewWillAppear(animated: Bool) {
self.navigationController?.navigationBarHidden = true
print (usernameField.center.x)
usernameField.center.x -= view.bounds.width
print (view.bounds.width)
print (usernameField.center.x)
}
Here is the output :
300.0
375.0
-75.0
So the final x of my usernameField is -75.0, but in all cases it is centered in my app.
I think it's because I applied constraints to it in my Storyboard ? (Suggested constraints which center buttons and textview)
Thanks for your help
EDIT : Removing constraints didn't resolve my problem ..