// // BaseSlideSegmentViewChildViewController.swift // MTP2_iOS // // Created by zhongyuan on 2018/4/4. // Copyright © 2018年 zhongyuan.All rights reserved. // import UIKit protocol SlideSegmentViewChildViewControllerDelegate: BaseProtocal { /// 自身没有navigationController,所以找父级控制器帮他push /// /// - Parameters: /// - sender: 成交单控制器 /// - viewController: 需要push的页面 func slideSegmentViewChildViewController(push viewController: UIViewController) /// slideSegmentViewChildViewController /// - Parameter viewController: viewController func slideSegmentViewChildViewController(present viewController: UIViewController) } // MARK: - SlideSegmentViewChildViewControllerDelegate默认实现 extension UIViewController: SlideSegmentViewChildViewControllerDelegate { func slideSegmentViewChildViewController(present viewController: UIViewController) { self.present(viewController, animated: true, completion: nil) } func slideSegmentViewChildViewController(push viewController: UIViewController) { self.navigationController?.pushViewController(viewController, animated: true) } } // BaseSlideSegmentViewChildViewController class BaseSlideSegmentViewChildViewController: BaseTableViewController { weak var delegate: SlideSegmentViewChildViewControllerDelegate? override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {} } // BaseSlideSegmentViewChildViewController class BaseGroupedSlideSegmentViewChildViewController: GroupedTableViewController { weak var delegate: SlideSegmentViewChildViewControllerDelegate? override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {} }