PFSignUpViewController

PFSignUpViewController

如果您在启用PFLogInFieldsSignUpButton选项的情况下使用PFLogInViewController,如何自定义PFSignUpViewController的外观?

最佳答案

您需要继承PFSignUpViewController的子类,并在viewDidLoadviewDidLayoutSubviews中执行布局自定义。

class SpuggySignUpViewController: PFSignUpViewController {
  override func viewDidLoad() {
    super.viewDidLoad()
    // Customisation here
  }

  override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()
    // More customisation here
  }

}


要获得PFSignUpViewController呈现的PFLoginViewController的自定义版本,只需实例化它,然后在PFLoginViewController中进行设置。

let loginController = PFLoginViewController()
let customSignupController = SpuggySignUpViewController()
loginController.signUpController = customSignupController
// Now show your login Controller

07-27 20:45