gpt4 book ai didi

ios - PF LoginViewController 如何在登录界面和主页之间切换? swift

转载 作者:行者123 更新时间:2023-11-29 01:37:51 25 4
gpt4 key购买 nike

我正在尝试使用 PFLoginViewController 为我的应用程序创建一个简单的登录屏幕。我遇到的问题是能够根据 .currentUser() 输出在登录屏幕和应用程序主页之间切换。

我能够使用以下方法在 Objective C 中完成此任务:

AppDelegate.m

enter image description here enter image description here

LogInViewController.m

enter image description here

enter image description here

我在我的新应用程序中使用 Swift,并尝试复制我在 Objective C 中使用的方法,但我收到此错误,并且模拟器全黑。]

enter image description here

这是我的代码在 swift 中的样子。

AppDelegate

enter image description here

LoginVC

enter image description here

我对此进行了一些调查,发现这是 viewDidLoad 而不是使用 viewWillAppear 的问题,但我没有看到我的问题的应用程序因为它在 Objective C 中的 didFinishLaunchingWithOptions 中工作,并且 PFLoginViewController 的委托(delegate)方法在 viewDidLoad 中未调用。

有什么线索可以说明我的重大错误是什么吗?

最佳答案

我解决了我遇到的问题。

AppDelegate

enter image description here

我使用了 pushViewController 而不是 presentViewController

enter image description here

关于ios - PF LoginViewController 如何在登录界面和主页之间切换? swift ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32769857/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com