Files
yingmeng-ios-switf/yinmeng-ios/Base/ViewController/BaseViewController.swift
2024-02-22 19:59:38 +08:00

39 lines
839 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// BaseViewController.swift
// yinmeng-ios
//
// Created by MaiMang on 2024/2/21.
//
import UIKit
///
protocol HiddenNavigationBarProtocol where Self: UIViewController {}
class BaseViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if (self is HiddenNavigationBarProtocol){
self.navigationController?.setNavigationBarHidden(true, animated: true)
}else {
self.navigationController?.setNavigationBarHidden(false, animated: true)
}
}
override var preferredStatusBarStyle: UIStatusBarStyle {
.lightContent
}
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.viewBackGround
}
deinit {
print("🎷\(String(describing: self)): Deinited")
}
}