Swift隐私条款弹框及查看隐私条款

更新时间:2023-06-24 03:00:05 阅读: 评论:0

Swift隐私条款弹框及查看隐私条款
为什么要写这么简单的东西呢?因为以后每个APP启动这是⼀个必须功能,总结出来后⾯就不⽤每个应⽤都去重新写
胸部保健操
效果图.png
实现代码
import UIKit
let kPrivacyState = "kPrivacyState"
猪八戒之歌
class WTPrivacyDialogViewController: UIViewController {
private var checkBtn: UIButton!
var actionBlock: ((Int) -> ())?
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.75)
tupUI()
}
func tupUI() {
let contentView = UIView()
contentView.backgroundColor = .white
Radius = 8
contentView.layer.masksToBounds = true
view.addSubview(contentView)
let titleLb = UILabel()
< = "隐私条款提⽰"
titleLb.font = UIFont.boldSystemFont(ofSize: 18)
contentView.addSubview(titleLb)
let style = NSMutableParagraphStyle()
style.lineSpacing = 5
let aStr = NSMutableAttributedString(string: "为了更好的保护您的权益,同时遵守相关督管要求,我们将通过《隐私政策》向您说明我们会如何搜集、存储、保护和使⽤您的        let subtitleLb = UILabel()
subtitleLb.numberOfLines = 0
subtitleLb.attributedText = aStr
contentView.addSubview(subtitleLb)
let button = UIButton(type:.custom)
button.tImage(UIImage(named: "checkbox-blank-circle-line"), for: .normal)
button.tImage(UIImage(named: "checkbox-circle-line"), for: .lected)
button.addTarget(lf, action:#lector(checkAction(_:)), for:.touchUpInside)
checkBtn = button
contentView.addSubview(checkBtn)
let agreeStr = NSMutableAttributedString(string: "已查看并同意《隐私政策》", attributes: [NSAttributedString.Key.font : UIFont.systemFont(ofSize: 14), NSAttributedString.        _tTextHighlight(NSRange(location: 6, length: 6), color: .blue, backgroundColor: .clear) { containerView, text, range, rect in春节的习俗英文
let vc = WTPrivacyContentViewController()
vc.title = "隐私政策"
let nav = UINavigationController(rootViewController: vc)
lf.prent(nav, animated: fal, completion: nil)
}
let agreeLb = YYLabel()
agreeLb.attributedText = agreeStr
contentView.addSubview(agreeLb)
let agreeBtn = UIButton(type: .custom)
agreeBtn.tTitle("同意", for: .normal)
agreeBtn.tTitleColor(.white, for: .normal)
agreeBtn.backgroundColor = .blue团队建设方案
叛逆期的表现Radius = 18
agreeBtn.layer.masksToBounds = true
agreeBtn.addTarget(lf, action:#lector(agreeAction(_:)), for:.touchUpInside)
握紧我的手
contentView.addSubview(agreeBtn)
let regectBtn = UIButton(type: .custom)
regectBtn.addTarget(lf, action:#lector(regectAction(_:)), for:.touchUpInside)
regectBtn.tTitle("不同意并退出app", for: .normal)
regectBtn.tTitleColor(.blue, for: .normal)
contentView.addSubview(regectBtn)
contentView.snp_makeConstraints { make in
make.right.equalTo(-20)
make.left.equalTo(20)
make.bottom.equalTo(regectBtn.snp_bottom).offt(24)
}
titleLb.snp_makeConstraints { make in
迟迟钟鼓初长夜
make.height.equalTo(26)
}
subtitleLb.snp_makeConstraints { make in
make.right.equalTo(-24)
make.left.equalTo(24)
黎明近义词
aterThanOrEqualTo(60)
}
checkBtn.snp_makeConstraints { make in
make.left.equalTo(24)
make.size.equalTo(CGSize(width: 20, height: 20))
}
agreeLb.snp_makeConstraints { make in
make.height.equalTo(20)
make.left.equalTo(checkBtn.snp_right).offt(2)
}

本文发布于:2023-06-24 03:00:05,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1052177.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:遵守   相关   条款   说明   权益
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图