ios - 无法从 ParseUI 中删除“关闭”和“注册”按钮

标签 ios swift parse-platform

我不明白为什么我的loginViewController 仍然有关闭X 和注册按钮。我也不想要。我认为只要不将它们包含在我的 logInController.fields 数组中,它们就不会出现,但事实似乎并非如此。有什么帮助吗?

let logInController = PFLogInViewController()
logInController.delegate = self
self.presentViewController(logInController, animated:true, completion: nil)

logInController.fields = [PFLogInFields.UsernameAndPassword, PFLogInFields.LogInButton, PFLogInFields.PasswordForgotten]

我收到一个可能意味着什么的错误。

2015-12-22 21:35:29.463 App Name[5737:99658] Warning: Attempt to present <PFLogInViewController: 0x7fd318c56020> on <app name.loginViewController: 0x7fd318d6c120> whose view is not in the window hierarchy!

最佳答案

我明白了。

  1. 确保导入 ParseUI
  2. 您必须在 viewDidAppear 中呈现您的 viewController,而不是在 viewDidLoad 中。

这是我正在使用的代码,它构建并运行良好。

class LoginViewController: PFLogInViewController, PFLogInViewControllerDelegate {

override func viewDidAppear(animated: Bool) {

    let logInController = PFLogInViewController()
    logInController.delegate = self
    logInController.fields = [PFLogInFields.UsernameAndPassword, PFLogInFields.LogInButton, PFLogInFields.PasswordForgotten, PFLogInFields.SignUpButton]
    self.presentViewController(logInController, animated:true, completion: nil)
}

关于ios - 无法从 ParseUI 中删除“关闭”和“注册”按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34428686/

相关文章:

ios - 如何在一个框架下导入多个swift游戏并为其创建一个主菜单?

ios - 尝试添加 UIImage 作为 Storyboard中的背景(不重叠我的其他 ViewController 元素)

iOS后退按钮行为: double back

ios - 在 uitableview 之上动画 View

ios - 在 Swift 中更改导航栏中的字体

html - 如何添加请求网页的 UITextfield

android - Sinch Android聊天应用Bug

javascript - Parse.com 无法从 Parse.User.current 获取用户名?

ios - 根据 boolean 值解析自定义单元格显示图像

ios - 在 App Purchase 中使用受信任的服务器进行收据验证。为什么我没有从服务器获得最新收据有什么想法吗?