Commit d4f55862 authored by David黄金龙's avatar David黄金龙

检查是否安装 微信

未安装 则隐藏微信入口
parent 326a46d7
...@@ -156,6 +156,8 @@ class YHOtherLoginViewController: YHBaseViewController { ...@@ -156,6 +156,8 @@ class YHOtherLoginViewController: YHBaseViewController {
make.width.equalTo(260) make.width.equalTo(260)
} }
if WXApi.isWXAppInstalled() {
wechatButton = { wechatButton = {
let button = UIButton(type: .custom) let button = UIButton(type: .custom)
button.setImage(UIImage(named: "login_wechat"), for: .normal) button.setImage(UIImage(named: "login_wechat"), for: .normal)
...@@ -181,6 +183,20 @@ class YHOtherLoginViewController: YHBaseViewController { ...@@ -181,6 +183,20 @@ class YHOtherLoginViewController: YHBaseViewController {
make.bottom.equalTo(-58) make.bottom.equalTo(-58)
make.height.width.equalTo(44) make.height.width.equalTo(44)
} }
} else {
appleButton = {
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "login_apple"), for: .normal)
button.addTarget(self, action: #selector(appleLogin), for: .touchUpInside)
return button
}()
view.addSubview(appleButton)
appleButton.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.bottom.equalTo(-58)
make.height.width.equalTo(44)
}
}
} }
@objc func close() { @objc func close() {
......
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