|
//
// NavigationBarPushAndPopDelegate.swift
// PaiaiUIKit
//
// Created by ffib on 2019/1/16.
// Copyright © 2019 yb. All rights reserved.
//
import Foundation
public protocol NavigationBarPushAndPopDelegate: class {
func setupNavigationBarPushAndPopDelegate()
}
public extension NavigationBarPushAndPopDelegate where Self: UIViewController & NavigationControllerDelegate {
func setupNavigationBarPushAndPopDelegate() {
navigationController?.setDelegate(self)
}
}
public extension NavigationControllerDelegate where Self: UIViewController & NavigationBarInOut {
func navigationController(_ navigationController: UINavigationController,
willShow viewController: UIViewController, animated: Bool) {
if viewController != self {
navigationBarFadeIn()
} else {
navigationBarFadeOut()
}
}
}
|