Commit 548fe4bf authored by David黄金龙's avatar David黄金龙

启动时的协议 同步

parent 6c26605f
...@@ -117,7 +117,7 @@ private extension YHStartPageViewController { ...@@ -117,7 +117,7 @@ private extension YHStartPageViewController {
agreeAlertView.cancelBlock = { agreeAlertView.cancelBlock = {
//点击了取消按钮 //点击了取消按钮
YHCommonAlertView.show("", "确认退出银河港生活App?", "退出", "继续使用") { YHCommonAlertView.show("", "确认退出银河港生活App?", "退出", "继续使用",fullGuestureEnable: false) {
//退出 //退出
exit(0) exit(0)
} callBack: { } callBack: {
......
...@@ -19,11 +19,14 @@ class YHCommonAlertView: UIView { ...@@ -19,11 +19,14 @@ class YHCommonAlertView: UIView {
var agreeButton: UIButton! var agreeButton: UIButton!
var disAgressButton: UIButton! var disAgressButton: UIButton!
static func show(_ title: String? = nil, _ message: String? = nil, _ leftButtonString: String? = nil, _ rightButtonString: String? = nil,cancelCallBack: (() -> Void)? = nil, callBack: @escaping (() -> Void)) { var isFullGuestureEnabel : Bool = true //view响应全局手势 默认响应
static func show(_ title: String? = nil, _ message: String? = nil, _ leftButtonString: String? = nil, _ rightButtonString: String? = nil,fullGuestureEnable : Bool = true,cancelCallBack: (() -> Void)? = nil, callBack: @escaping (() -> Void)) {
let view = YHCommonAlertView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight)) let view = YHCommonAlertView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
view.agreeBlock = callBack view.agreeBlock = callBack
view.cancelBlcok = cancelCallBack view.cancelBlcok = cancelCallBack
view.setContent(title, message, leftButtonString, rightButtonString) view.setContent(title, message, leftButtonString, rightButtonString)
view.isFullGuestureEnabel = fullGuestureEnable
let window = UIApplication.shared.yhKeyWindow() let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view) window?.addSubview(view)
} }
...@@ -179,8 +182,10 @@ class YHCommonAlertView: UIView { ...@@ -179,8 +182,10 @@ class YHCommonAlertView: UIView {
@objc private func handleTap(_ sender: AnyObject?) { @objc private func handleTap(_ sender: AnyObject?) {
print("处理点击手势") print("处理点击手势")
if isFullGuestureEnabel {
dismiss() dismiss()
} }
}
@objc func disagree() { @objc func disagree() {
if let block = self.cancelBlcok { if let block = self.cancelBlcok {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment