I've subclassed PFLoginViewController and am doing my UI customizations in viewWillAppear. This seems to work fine for some buttons and fields.
Here is my login screen when the app first loads: http://cl.ly/image/2J0v3K313W3A
The following customizations all take hold:
self.logInView?.logInButton?.setTitle("LOGIN", forState: UIControlState.Normal)
self.logInView?.logInButton?.titleLabel?.font = UIFont.openSansSemiBoldFontOfSize(18)
self.logInView?.signUpButton?.titleLabel?.font = UIFont.openSansSemiBoldFontOfSize(18)
I also have the following customizations that don't take:
self.logInView?.signUpButton?.setTitle("SIGN UP", forState: UIControlState.Normal)
self.logInView?.logInButton?.backgroundColor = UIColor(red: 136/255, green: 192/255, blue: 87/255, alpha: 1)
self.logInView!.signUpButton!.backgroundColor = UIColor(red: 136/255, green: 192/255, blue: 87/255, alpha: 1)
Except...If I tap the 'Sign Up' button at the bottom, then dismiss the sign up view controller, when the login view controller re-appears, the 'sign up' is capitalized like it should be. But the button background hasn't changed.
http://cl.ly/image/0g0P1z0v1I1a
I just can't wrap my head around why some of the customizations work and some don't. The code is all in the same place. How can setTitle work for one button but not the other when the view fist appears?
Totally stumped.
** For disclosure, I have tried moving all my customization code to before presenting the login controller. It made zero difference.
The reason the background colors are not updation is that you have passed them as integer. And in the case of integer the result that they are getting will be equal to Zero.
This code will be read by the compiler as
To fix this issue you need to pass the values as doubles. So try running the code as this