在我的 iOS 应用程序中,我试图使用 UIAlertController 实现一个简单的隐私策略。根据法律,该政策在被接受之前必须是可滚动的——就像现在的大多数隐私政策一样。
根据我自己的研究,我发现您可以禁用和启用 UIAlertAction 按钮,但我不知道如何识别 UIAlertController 消息正文何时滚动。一直滚动到底部可能是一项要求,我有兴趣找出一种可行的方法。
这是我上面默认的 UIAlertController 的当前代码。
let alertController = UIAlertController(title: "Privacy Policy", message: privacyPolicyString, preferredStyle: UIAlertControllerStyle.Alert)
let AcceptAction = UIAlertAction(title: "Accept", style: UIAlertActionStyle.Default, handler: {(action: UIAlertAction) -> Void in
//perform next step in login verification
})
let DeclineAction = UIAlertAction(title: "Decline", style: UIAlertActionStyle.Default, handler: {(action: UIAlertAction) -> Void in
//User has declined privacy policy. The view resets to standard login state
})
alertController.addAction(AcceptAction)
alertController.addAction(DeclineAction)
self.presentViewController(alertController, animated: true, completion: nil)