| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- //
- // 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)
-
- 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<M: Any>: BaseTableViewController<M> {
- weak var delegate: SlideSegmentViewChildViewControllerDelegate?
-
- override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
- }
- }
- // BaseSlideSegmentViewChildViewController
- class BaseGroupedSlideSegmentViewChildViewController<M: Any>: GroupedTableViewController<M> {
- weak var delegate: SlideSegmentViewChildViewControllerDelegate?
-
- override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
- }
- }
|