From e68a09d96bbe9b263a333325fb4021c3f9e10e02 Mon Sep 17 00:00:00 2001 From: mtfum Date: Thu, 24 Jan 2019 23:27:05 +0700 Subject: [PATCH] Remove unnecessary class 'WindowRootViewController' and rename filename 'Window' to 'ContainerView' --- PKHUD.xcodeproj/project.pbxproj | 12 ++---- PKHUD/{Window.swift => ContainerView.swift} | 6 +-- PKHUD/WindowRootViewController.swift | 46 --------------------- 3 files changed, 7 insertions(+), 57 deletions(-) rename PKHUD/{Window.swift => ContainerView.swift} (95%) delete mode 100644 PKHUD/WindowRootViewController.swift diff --git a/PKHUD.xcodeproj/project.pbxproj b/PKHUD.xcodeproj/project.pbxproj index 006cf8a..44a88ae 100644 --- a/PKHUD.xcodeproj/project.pbxproj +++ b/PKHUD.xcodeproj/project.pbxproj @@ -30,8 +30,7 @@ F996324D19514FEF001F73CA /* PKHUDAssets.swift in Sources */ = {isa = PBXBuildFile; fileRef = F996324619514FEF001F73CA /* PKHUDAssets.swift */; }; F996324F19514FEF001F73CA /* PKHUD.swift in Sources */ = {isa = PBXBuildFile; fileRef = F996324819514FEF001F73CA /* PKHUD.swift */; }; F996325019514FEF001F73CA /* FrameView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F996324919514FEF001F73CA /* FrameView.swift */; }; - F996325219514FEF001F73CA /* Window.swift in Sources */ = {isa = PBXBuildFile; fileRef = F996324B19514FEF001F73CA /* Window.swift */; }; - F996325319514FEF001F73CA /* WindowRootViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F996324C19514FEF001F73CA /* WindowRootViewController.swift */; }; + F996325219514FEF001F73CA /* ContainerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F996324B19514FEF001F73CA /* ContainerView.swift */; }; F996325519514FF3001F73CA /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F996325419514FF3001F73CA /* Images.xcassets */; }; F996325919515052001F73CA /* DemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F996325819515052001F73CA /* DemoViewController.swift */; }; /* End PBXBuildFile section */ @@ -108,8 +107,7 @@ F996324619514FEF001F73CA /* PKHUDAssets.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PKHUDAssets.swift; sourceTree = ""; }; F996324819514FEF001F73CA /* PKHUD.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PKHUD.swift; sourceTree = ""; }; F996324919514FEF001F73CA /* FrameView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FrameView.swift; sourceTree = ""; }; - F996324B19514FEF001F73CA /* Window.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Window.swift; sourceTree = ""; }; - F996324C19514FEF001F73CA /* WindowRootViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WindowRootViewController.swift; sourceTree = ""; }; + F996324B19514FEF001F73CA /* ContainerView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContainerView.swift; sourceTree = ""; }; F996325419514FF3001F73CA /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; F996325819515052001F73CA /* DemoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoViewController.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -244,8 +242,7 @@ isa = PBXGroup; children = ( F996324919514FEF001F73CA /* FrameView.swift */, - F996324B19514FEF001F73CA /* Window.swift */, - F996324C19514FEF001F73CA /* WindowRootViewController.swift */, + F996324B19514FEF001F73CA /* ContainerView.swift */, ); name = Internal; sourceTree = ""; @@ -439,13 +436,12 @@ 640011571C5B6C080013F32B /* HUD.swift in Sources */, 3097AF3A1C4843AE007DD42B /* PKHUDRotatingImageView.swift in Sources */, F935B1611B2B8C8E003C3734 /* PKHUDTextView.swift in Sources */, - F996325319514FEF001F73CA /* WindowRootViewController.swift in Sources */, F908BEC31BB84D0B0015E5A8 /* PKHUDAnimating.swift in Sources */, F908BEC81BB85EA70015E5A8 /* PKHUDProgressView.swift in Sources */, F908BEC01BB849290015E5A8 /* PKHUDSuccessView.swift in Sources */, F908BEC51BB852C60015E5A8 /* PKHUDErrorView.swift in Sources */, F935B15D1B2B8C20003C3734 /* PKHUDSquareBaseView.swift in Sources */, - F996325219514FEF001F73CA /* Window.swift in Sources */, + F996325219514FEF001F73CA /* ContainerView.swift in Sources */, F935B15F1B2B8C7E003C3734 /* PKHUDWideBaseView.swift in Sources */, F996324D19514FEF001F73CA /* PKHUDAssets.swift in Sources */, F996324F19514FEF001F73CA /* PKHUD.swift in Sources */, diff --git a/PKHUD/Window.swift b/PKHUD/ContainerView.swift similarity index 95% rename from PKHUD/Window.swift rename to PKHUD/ContainerView.swift index 96e4432..87ec808 100644 --- a/PKHUD/Window.swift +++ b/PKHUD/ContainerView.swift @@ -25,7 +25,7 @@ internal class ContainerView: UIView { commonInit() } - fileprivate func commonInit() { + private func commonInit() { backgroundColor = UIColor.clear isHidden = true @@ -47,7 +47,7 @@ internal class ContainerView: UIView { isHidden = false } - fileprivate var willHide = false + private var willHide = false internal func hideFrameView(animated anim: Bool, completion: ((Bool) -> Void)? = nil) { let finalize: (_ finished: Bool) -> Void = { finished in @@ -75,7 +75,7 @@ internal class ContainerView: UIView { } } - fileprivate let backgroundView: UIView = { + private let backgroundView: UIView = { let view = UIView() view.backgroundColor = UIColor(white: 0.0, alpha: 0.25) view.alpha = 0.0 diff --git a/PKHUD/WindowRootViewController.swift b/PKHUD/WindowRootViewController.swift deleted file mode 100644 index 2e6d610..0000000 --- a/PKHUD/WindowRootViewController.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// PKHUD.WindowRootViewController.swift -// PKHUD -// -// Created by Philip Kluz on 6/18/14. -// Copyright (c) 2016 NSExceptional. All rights reserved. -// Licensed under the MIT license. -// - -import UIKit - -/// Serves as a configuration relay controller, tapping into the main window's rootViewController settings. -internal class WindowRootViewController: UIViewController { - - internal override var supportedInterfaceOrientations: UIInterfaceOrientationMask { - if let rootViewController = UIApplication.shared.delegate?.window??.rootViewController { - return rootViewController.supportedInterfaceOrientations - } else { - return UIInterfaceOrientationMask.portrait - } - } - - internal override var preferredStatusBarStyle: UIStatusBarStyle { - return self.presentingViewController?.preferredStatusBarStyle ?? UIApplication.shared.statusBarStyle - } - - internal override var prefersStatusBarHidden: Bool { - return self.presentingViewController?.prefersStatusBarHidden ?? UIApplication.shared.isStatusBarHidden - } - - internal override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation { - if let rootViewController = UIApplication.shared.delegate?.window??.rootViewController { - return rootViewController.preferredStatusBarUpdateAnimation - } else { - return .none - } - } - - internal override var shouldAutorotate: Bool { - if let rootViewController = UIApplication.shared.delegate?.window??.rootViewController { - return rootViewController.shouldAutorotate - } else { - return false - } - } -}