diff --git a/Yep/Base.lproj/Intro.storyboard b/Yep/Base.lproj/Intro.storyboard index c4278bc2..baa93024 100644 --- a/Yep/Base.lproj/Intro.storyboard +++ b/Yep/Base.lproj/Intro.storyboard @@ -632,24 +632,6 @@ - - - - - - - - - - - - - - - - - - @@ -680,9 +662,7 @@ - - @@ -694,8 +674,9 @@ - + + @@ -753,6 +734,7 @@ + diff --git a/Yep/ViewControllers/Login/LoginByMobileViewController.swift b/Yep/ViewControllers/Login/LoginByMobileViewController.swift index 9053bc2c..916d5dc5 100644 --- a/Yep/ViewControllers/Login/LoginByMobileViewController.swift +++ b/Yep/ViewControllers/Login/LoginByMobileViewController.swift @@ -11,28 +11,34 @@ import UIKit class LoginByMobileViewController: UIViewController { @IBOutlet weak var pickMobileNumberPromptLabel: UILabel! - + @IBOutlet weak var pickMobileNumberPromptLabelTopConstraint: NSLayoutConstraint! + @IBOutlet weak var areaCodeTextField: BorderTextField! @IBOutlet weak var mobileNumberTextField: BorderTextField! - - @IBOutlet weak var nextButton: BorderButton! - + @IBOutlet weak var mobileNumberTextFieldTopConstraint: NSLayoutConstraint! + + lazy var nextButton: UIBarButtonItem = { + let button = UIBarButtonItem(title: NSLocalizedString("Next", comment: ""), style: .Plain, target: self, action: "next:") + return button + }() override func viewDidLoad() { super.viewDidLoad() navigationItem.titleView = NavigationTitleLabel(title: NSLocalizedString("Login", comment: "")) + + navigationItem.rightBarButtonItem = nextButton pickMobileNumberPromptLabel.text = NSLocalizedString("What's your number?", comment: "") - nextButton.setTitle(NSLocalizedString("Next", comment: ""), forState: .Normal) - nextButton.backgroundColor = UIColor.yepTintColor() - areaCodeTextField.delegate = self areaCodeTextField.addTarget(self, action: "textFieldDidChange:", forControlEvents: .EditingChanged) mobileNumberTextField.delegate = self mobileNumberTextField.addTarget(self, action: "textFieldDidChange:", forControlEvents: .EditingChanged) + + pickMobileNumberPromptLabelTopConstraint.constant = UIDevice.matchMarginFrom(40, 50, 60, 60) + mobileNumberTextFieldTopConstraint.constant = UIDevice.matchMarginFrom(30, 40, 50, 50) } override func viewWillAppear(animated: Bool) { @@ -54,12 +60,7 @@ class LoginByMobileViewController: UIViewController { nextButton.enabled = !areaCodeTextField.text.isEmpty && !mobileNumberTextField.text.isEmpty } - @IBAction func back(sender: UIButton) { - navigationController?.popViewControllerAnimated(true) - } - - - @IBAction func next(sender: UIButton) { + func next(sender: UIBarButtonItem) { tryShowLoginVerifyMobile() }