// // IHSignUpManager.swift // Inhealth // // Created by weclouds on 2020/1/19. // Copyright © 2020 weclouds. All rights reserved. // import UIKit class IHSignUpManager: NSObject { // private var vc = UIViewController() private weak var vc : UIViewController? lazy var mainView: IHSignUpView = { let mainView = Bundle.main.loadNibNamed("IHSignUpView", owner: nil, options: nil)?.last as! IHSignUpView mainView.delegate = self return mainView }() func bindController(_ vc: UIViewController) { self.vc = vc createUI() } deinit { log.debug("IHSignUpManager销毁") } func createUI() { self.vc?.view.addSubview(mainView) self.vc?.navigationBarTitle = "注册帐号" setNavigationBar() } func setNavigationBar() { let backItem = UIBarButtonItem(image: UIImage(named: "返回"), style: .done, target: self, action: #selector(backAction)) self.vc?.navigationItem.leftBarButtonItem = backItem } @objc func backAction() { self.vc?.dismiss(animated: true, completion: nil ) } } extension IHSignUpManager:IHSignUpViewDelegate{ //编辑注册信息 func signupToService(_ account: String?, passowrd: String?, passwordAgain: String?) { if account == "" || passowrd == "" || passwordAgain == "" { g_showHUD("请填写全部内容") return } if passowrd != passwordAgain { g_showHUD("二次密码不一致") return } AppShare.register_username = account! AppShare.register_password = passowrd! let guestInfo = IHGuestInfoVCtr() //进入下一页继续编辑 self.vc?.navigationController?.pushViewController(guestInfo, animated: true) } func goPrivacyPolicy() { let vc = IHPrivacyVCtr() let nav = IHNavigationController(rootViewController: vc) nav.modalPresentationStyle = .fullScreen self.vc?.present(nav, animated: true, completion: nil) } }