Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't Modify the PFLogInViewController logInButton title

i'd been using Parse.com services in my new iOS app development, so far it works like a charm, however i'd been trying to modify the login button text from the PFLogInViewController using code in both swift and objective-C but the results are the same (NONE!)

ObjC

 [logInViewController.logInView.logInButton setTitle:@"Test!" forState:UIControlStateNormal];
 logInViewController.logInView.logInButton.titleLabel.text = @"Another Test";

Swift

 self.logInView.logInButton.setBackgroundImage(UIImage(named: "loginBtn"), forState: UIControlState.Normal )
like image 920
Jorge Vicente Mendoza Avatar asked Feb 13 '26 04:02

Jorge Vicente Mendoza


1 Answers

I finally figure out how to solve this, you must apply the changes in the event

Swift

override func viewDidLayoutSubviews()
{
    println("didLaoutSubView")
    self.logInView.logInButton.setTitle("Test", forState: UIControlState.Normal)
    self.logInView.logInButton.setTitle("Test", forState: UIControlState.Highlighted)
}

ObjC

-(void)viewDidLayoutSubviews
{
    [self.logInView.logInButton setTitle:@"Test!" forState:UIControlStateNormal];
    self.logInView.logInButton.titleLabel.text = @"Another Test";
}
like image 141
Jorge Vicente Mendoza Avatar answered Feb 14 '26 16:02

Jorge Vicente Mendoza