美文网首页
swift 添加警告框

swift 添加警告框

作者: i爱吃土豆的猫 | 来源:发表于2021-06-30 10:09 被阅读0次

    退出登录警告框

    func logOutWithAlert() {
        let alertController = UIAlertController (title:  "温馨提示",message:"确定要退出吗?",preferredStyle:.alert)
        let cancelAction = UIAlertAction (title:  "取消",style:.cancel,handler:{action in
            HJPrint (message:"点击了取消")
        })
        let okAction = UIAlertAction (title:"确定" , style:.default,handler: {action in
                   HJPrint (message:"点击了确定")
                   AccountService.shared.signOut()
                   Notification.Name.didLogout.post()
                   FBTrackingService.sendData("", parameters: ["code" : FBTrackingRefs.OS_mine_exit])
         })
         alertController.addAction(cancelAction)
         alertController.addAction(okAction)
         self.present(alertController, animated: true , completion:nil )
    }

    相关文章

      网友评论

          本文标题:swift 添加警告框

          本文链接:https://www.haomeiwen.com/subject/npalultx.html