如何在应用程序启动时显示锁定屏幕?
我正在尝试在启动应用程序时显示锁定屏幕。
我正在尝试使用这里的代码 -> https://github.com/jazzychad/CPLockController
我尝试在viewDidLoad函数中触发锁屏,但模态屏幕从未启动。我还尝试触发应用程序委托 didFinishLaunchingWithOptions 函数中的锁定,但未成功。
有人可以帮我吗?
I'm trying to display a lock screen on the launch of my app.
I'm trying to use the code here -> https://github.com/jazzychad/CPLockController
I tried to trigger the lock screen in the viewDidLoad function, but the modal screen never launched. I also unsuccessfully tried to trigger the lock in the application delegate didFinishLaunchingWithOptions function.
Can anyone help me out?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能还想在 applicationWillEnterForeground 上显示锁定屏幕,以便快速切换应用程序。
You may also want to present your lock screen on applicationWillEnterForeground for the sake of fast app switching.
这是一个愚蠢的问题。我没有完全理解代表们的想法。
我正在为偶然发现这个问题的人们提供答案。
首先确保将 #import "CPLockController.h" 添加到应用程序委托标头中,然后将 CPLockControllerDelegate 添加到应用程序委托标头中。
然后在 applicationDidFinishLaunching 函数中,使用视图控制器启动模式。
This was a silly question. I wasn't fully understanding delegates.
I'm providing the answer for people that happen to stumble upon this.
First be sure to add the #import "CPLockController.h" and then the CPLockControllerDelegate to the application delegate header.
Then in the applicationDidFinishLaunching function, launch the modal using the view controller.