Commit 49664707 authored by 刘俊宏's avatar 刘俊宏

简化代码,navBar方法代理默认在baseVc 里面。可以重写

parent b73ec6e0
......@@ -370,6 +370,7 @@
E09B03AD2445B0BA00211A51 /* ViewController */ = {
isa = PBXGroup;
children = (
F95D9CA124493AB90080D6E3 /* 商家信息 */,
E0D197CC244855F5002B080C /* 蓝牙连接 */,
E0D197C3244845E3002B080C /* 个人中心 */,
E0D4166124483045008DCAB4 /* 修改密码 */,
......@@ -491,6 +492,13 @@
path = AlertView;
sourceTree = "<group>";
};
F95D9CA124493AB90080D6E3 /* 商家信息 */ = {
isa = PBXGroup;
children = (
);
path = "商家信息";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
......
......@@ -12,7 +12,7 @@ import ObjectMapper
import Alamofire
import IQKeyboardManagerSwift
class BaseViewController: UIViewController {
class BaseViewController: UIViewController ,NavBarViewDelegate{
override func viewWillAppear(_ animated: Bool) {
self.navigationController?.navigationBar.isHidden = true
......@@ -36,5 +36,8 @@ class BaseViewController: UIViewController {
// Dispose of any resources that can be recreated.
}
//MARK: -默认的代理方法delegate方法
func backAction() {
self.navigationController?.popViewController(animated: true)
}
}
......@@ -9,7 +9,7 @@
import UIKit
import LGButton
class ChangePassViewController: BaseViewController,NavBarViewDelegate {
class ChangePassViewController: BaseViewController {
@IBOutlet weak var newPBtn: UIButton!
@IBOutlet weak var oldPBtn: UIButton!
......@@ -59,10 +59,7 @@ class ChangePassViewController: BaseViewController,NavBarViewDelegate {
@IBAction func submitAction(_ sender: Any) {
}
//MARK: -delegate方法
func backAction() {
self.navigationController?.popViewController(animated: true)
}
}
......@@ -9,7 +9,7 @@
import UIKit
import LGButton
class BindViewController: BaseViewController,NavBarViewDelegate {
class BindViewController: BaseViewController {
@IBOutlet weak var submitBtn: LGButton!
@IBOutlet weak var pinkView: UIView!
......@@ -64,9 +64,6 @@ class BindViewController: BaseViewController,NavBarViewDelegate {
@IBAction func submitBindingAction(_ sender: Any) {
print("确认绑定账号")
}
//MARK: -delegate方法
func backAction() {
self.navigationController?.popViewController(animated: true)
}
}
......@@ -8,7 +8,7 @@
import UIKit
class PayViewController: BaseViewController,NavBarViewDelegate {
class PayViewController: BaseViewController {
@IBOutlet weak var pinkView: UIView!
......@@ -51,9 +51,5 @@ class PayViewController: BaseViewController,NavBarViewDelegate {
print("进入格利支付")
}
//MARK: -delegate方法
func backAction() {
self.navigationController?.popViewController(animated: true)
}
}
......@@ -9,7 +9,7 @@
import UIKit
import ViewAnimator
class MsgCenterViewController: BaseViewController,NavBarViewDelegate,UITableViewDelegate,UITableViewDataSource {
class MsgCenterViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource {
//MARK: -animateView
......@@ -40,16 +40,7 @@ class MsgCenterViewController: BaseViewController,NavBarViewDelegate,UITableView
}
//MARK: -delegate方法
func backAction() {
self.navigationController?.popViewController(animated: true)
//tabelviewcell进场动画
// UIView.animate(views: msgTbv!.visibleCells, animations:[animations], reversed: false,
// initialAlpha: 0, finalAlpha: 1.0, completion: {
// self.msgTbv!.reloadData()
// })
}
//MARK: -Cell delegate方法
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 120
......
......@@ -8,7 +8,7 @@
import UIKit
class BluetoothConnectViewController: BaseViewController,NavBarViewDelegate,UITableViewDelegate,UITableViewDataSource {
class BluetoothConnectViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource {
......@@ -106,9 +106,8 @@ class BluetoothConnectViewController: BaseViewController,NavBarViewDelegate,UITa
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 49
}
//MARK: -delegate方法
func backAction() {
self.navigationController?.popViewController(animated: true)
}
override func backAction() {
print("重写back")
}
}
......@@ -8,7 +8,7 @@
import UIKit
class AccountViewController: BaseViewController,NavBarViewDelegate{
class AccountViewController: BaseViewController{
@IBOutlet weak var phoneLbl: UILabel!
@IBOutlet weak var accountLbl: UILabel!
......@@ -44,9 +44,6 @@ class AccountViewController: BaseViewController,NavBarViewDelegate{
print("退出登录")
}
//MARK: -delegate方法
func backAction() {
self.navigationController?.popViewController(animated: true)
}
}
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