Commit 1ac0b05d authored by David黄金龙's avatar David黄金龙

1、邮箱校验

2、导航栏 渐变白
3、
parent 1d0ecafa
......@@ -90,8 +90,9 @@ private extension YHStatusAdvantageVC {
}
func setupUI() {
gk_navBarAlpha = 1.0
gk_navBarAlpha = 0.0
gk_navLineHidden = false
gk_navBackgroundColor = .white
gk_navTitle = "身份优势"
NotificationCenter.default.addObserver(self, selector: #selector(updateNetWorkUI), name: .reachabilityChanged, object: nil)
......@@ -107,6 +108,8 @@ private extension YHStatusAdvantageVC {
webview.navigationDelegate = self
webview.scrollView.contentInsetAdjustmentBehavior = .never
webview.scrollView.bounces = false
webview.scrollView.delegate = self
// reloadWebUrl()
view.addSubview(webview)
......@@ -266,3 +269,21 @@ extension YHStatusAdvantageVC {
printLog("\(error.localizedDescription)")
}
}
//MARK: - UIScrollViewDelegate
extension YHStatusAdvantageVC : UIScrollViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if scrollView.contentOffset.y > 0 {
var alpha = scrollView.contentOffset.y / (k_Height_NavigationtBarAndStatuBar)
if alpha > 1.0 {
alpha = 1.0
}
gk_navBarAlpha = alpha
} else {
gk_navBarAlpha = 0.0
}
}
}
......@@ -192,7 +192,7 @@ extension YHEmailInputAlertView {
return
}
if let txt = textField.text,txt.isValidEmail {
if let txt = textField.text,txt.isYHValidEmail {
if let editBlock = editBlock {
editBlock(textField.text)
}
......@@ -213,7 +213,7 @@ extension YHEmailInputAlertView: UITextFieldDelegate {
return true
}
var newText = (textField.text! as NSString).replacingCharacters(in: range, with: string)
let newText = (textField.text! as NSString).replacingCharacters(in: range, with: string)
if newText.count > Self.maxWordsCount {
YHHUD.flash(message: "重命名限制最多30个字符")
return false
......
......@@ -248,4 +248,10 @@ extension String {
targetStr = targetStr.replacingOccurrences(of: "\n", with: "")
return targetStr
}
var isYHValidEmail: Bool {
//更简单 不严格
let regex = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}"
return range(of: regex, options: .regularExpression, range: nil, locale: nil) != nil
}
}
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