From eac7b2c83316e5233ea6971cc83fb03fa9192366 Mon Sep 17 00:00:00 2001 From: Zandor Smith Date: Sun, 31 Mar 2019 13:30:37 +0200 Subject: [PATCH] Remove WhiteNavigationController in favour of the pod with the same name. --- .../project.pbxproj | 1 + Example/Pods/Pods.xcodeproj/project.pbxproj | 13 +-- GeneralToolsFramework.podspec | 2 +- .../WhiteNavigationController.swift | 100 ------------------ 4 files changed, 3 insertions(+), 113 deletions(-) delete mode 100644 GeneralToolsFramework/Classes/Views/NavigationController/WhiteNavigationController.swift diff --git a/Example/GeneralToolsFramework.xcodeproj/project.pbxproj b/Example/GeneralToolsFramework.xcodeproj/project.pbxproj index c50079f..98dcf6a 100644 --- a/Example/GeneralToolsFramework.xcodeproj/project.pbxproj +++ b/Example/GeneralToolsFramework.xcodeproj/project.pbxproj @@ -223,6 +223,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index 1dd2efe..60010ba 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -62,7 +62,6 @@ FC733DA22213875E007E5A37 /* UIAlertController+UIImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC733DA12213875E007E5A37 /* UIAlertController+UIImageView.swift */; }; FC733DA42213879A007E5A37 /* UIImage+Size.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC733DA32213879A007E5A37 /* UIImage+Size.swift */; }; FC733DA622138CCE007E5A37 /* UINavigationBar+LargeTitleHeight.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC733DA522138CCE007E5A37 /* UINavigationBar+LargeTitleHeight.swift */; }; - FC733DA922138D02007E5A37 /* WhiteNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC733DA822138D02007E5A37 /* WhiteNavigationController.swift */; }; FC7F4D53220C416900E98016 /* Float+Round.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC7F4D52220C416900E98016 /* Float+Round.swift */; }; FC7F4D55220C41B200E98016 /* Double+Round.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC7F4D54220C41B200E98016 /* Double+Round.swift */; }; FCF219C6220071ED00708104 /* APICallError.swift in Sources */ = {isa = PBXBuildFile; fileRef = FCF219C422006E0600708104 /* APICallError.swift */; }; @@ -184,7 +183,6 @@ FC733DA12213875E007E5A37 /* UIAlertController+UIImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIAlertController+UIImageView.swift"; sourceTree = ""; }; FC733DA32213879A007E5A37 /* UIImage+Size.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+Size.swift"; sourceTree = ""; }; FC733DA522138CCE007E5A37 /* UINavigationBar+LargeTitleHeight.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UINavigationBar+LargeTitleHeight.swift"; sourceTree = ""; }; - FC733DA822138D02007E5A37 /* WhiteNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WhiteNavigationController.swift; sourceTree = ""; }; FC7F4D52220C416900E98016 /* Float+Round.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Float+Round.swift"; sourceTree = ""; }; FC7F4D54220C41B200E98016 /* Double+Round.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Double+Round.swift"; sourceTree = ""; }; FCF219C422006E0600708104 /* APICallError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APICallError.swift; sourceTree = ""; }; @@ -408,7 +406,6 @@ FC733D942213840B007E5A37 /* ZSTagView.swift */, 04DFFDF39CCC2CCEC5A1B1274616C040 /* Button */, 0D6372A575635DC3E3C094379EFABF04 /* Table */, - FC733DA722138CF2007E5A37 /* NavigationController */, ); name = Views; path = GeneralToolsFramework/Classes/Views; @@ -493,14 +490,6 @@ path = GeneralToolsFramework/Classes/Color; sourceTree = ""; }; - FC733DA722138CF2007E5A37 /* NavigationController */ = { - isa = PBXGroup; - children = ( - FC733DA822138D02007E5A37 /* WhiteNavigationController.swift */, - ); - path = NavigationController; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -626,6 +615,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ); mainGroup = 7DB346D0F39D3F0E887471402A8071AB; @@ -674,7 +664,6 @@ FC733D962213842A007E5A37 /* ZSTagView.swift in Sources */, 724A8A49BB751D2610F66BA0B36E525B /* UISelectCheckmarkTableViewCell.swift in Sources */, 73ED328CB68F890FB3C7A326B355DA21 /* UISwitchTableViewCell.swift in Sources */, - FC733DA922138D02007E5A37 /* WhiteNavigationController.swift in Sources */, 754E78A1778981C814B6C3DBD1A99E16 /* UITableViewCell+GetTableView.swift in Sources */, FB7E47BF7B49E369BAC1F60919FBDE33 /* UITextFieldTableViewCell.swift in Sources */, 4AC360EAE554BAC8939B0B47FAC2D3C2 /* Upload.swift in Sources */, diff --git a/GeneralToolsFramework.podspec b/GeneralToolsFramework.podspec index 595b18e..e6917dc 100644 --- a/GeneralToolsFramework.podspec +++ b/GeneralToolsFramework.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'GeneralToolsFramework' - s.version = '1.0.2' + s.version = '1.1.0' s.summary = 'Contains general tools used in my iOS apps.' # This description is used to generate tags and improve search results. diff --git a/GeneralToolsFramework/Classes/Views/NavigationController/WhiteNavigationController.swift b/GeneralToolsFramework/Classes/Views/NavigationController/WhiteNavigationController.swift deleted file mode 100644 index 7487911..0000000 --- a/GeneralToolsFramework/Classes/Views/NavigationController/WhiteNavigationController.swift +++ /dev/null @@ -1,100 +0,0 @@ -// -// WhiteNavigationController.swift -// GeneralToolsFramework -// -// Created by Zandor Smith on 13/02/2019. -// - -import UIKit - -open class WhiteNavigationController: UINavigationController { - - public var barBlur: WhiteNavigationBarBlur? - - deinit { - NotificationCenter.default.removeObserver(self) - } - - override open func viewDidLoad() { - super.viewDidLoad() - - self.barBlur = WhiteNavigationBarBlur(effect: UIBlurEffect(style: .light)) - - self.navigationBar.isTranslucent = true - self.navigationBar.setBackgroundImage(UIImage(), for: .default) - self.navigationBar.addSubview(self.barBlur!) - - NotificationCenter.default.addObserver(self, selector: #selector(deviceOrientationDidChange), name: UIDevice.orientationDidChangeNotification, object: nil) - } - - override open func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - - self.barBlur?.layoutSubviews() - } - - override open func viewWillDisappear(_ animated: Bool) { - super.viewWillDisappear(animated) - } - - @objc func deviceOrientationDidChange(_ notification: Notification) { - self.barBlur?.layoutSubviews() - } - -} - -public class WhiteNavigationBarBlur: UIVisualEffectView { - - public let whiteView = UIView() - - var centerLabelSuperview: UIView? - - var navigationBar: UINavigationBar? { - return self.superview as? UINavigationBar - } - - override init(effect: UIVisualEffect?) { - super.init(effect: effect) - setup() - } - - required init?(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - setup() - } - - private func setup() { - self.contentView.addSubview(whiteView) - self.whiteView.backgroundColor = UIColor(white: 1.0, alpha: 0.5) - } - - override public func layoutSubviews() { - if let navigationBar = self.navigationBar { - let statusBarHeight = UIApplication.shared.statusBarFrame.size.height - - if self.centerLabelSuperview == nil { - for subview in navigationBar.subviews { - for subsubview in subview.subviews { - if subsubview.isMember(of: UILabel.self) { - let subviewName = String(describing: subview.self) - if !subviewName.contains(find: "Large") { - self.centerLabelSuperview = subsubview.superview - } - } - } - } - } - - if let bounds = self.centerLabelSuperview?.bounds { - self.frame = bounds.insetBy(dx: 0, dy: -(statusBarHeight)).offsetBy(dx: 0, dy: -(statusBarHeight)) - } else { - self.frame = navigationBar.bounds.insetBy(dx: 0, dy: -(statusBarHeight)).offsetBy(dx: 0, dy: -(statusBarHeight)) - } - - self.whiteView.frame = self.contentView.bounds - - navigationBar.sendSubviewToBack(self) - } - } - -}