From 80a17dc2b817d36e8ffe75e4b31d820280a3dde8 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Mon, 15 Jun 2020 18:58:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E8=B5=84=E6=BA=90=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xcshareddata/xcschemes/ProHUD.xcscheme | 67 +++++++++++++++++++ Example/Example.xcodeproj/project.pbxproj | 4 +- Example/Example/AppDelegate.swift | 10 ++- Example/Example/RootVC.swift | 6 +- Example/Podfile | 10 +-- Example/Podfile.lock | 25 +++---- ProHUD.podspec | 6 +- Source/ProHUD.swift | 10 +-- 8 files changed, 106 insertions(+), 32 deletions(-) create mode 100644 .swiftpm/xcode/xcshareddata/xcschemes/ProHUD.xcscheme diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/ProHUD.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/ProHUD.xcscheme new file mode 100644 index 0000000..6214c27 --- /dev/null +++ b/.swiftpm/xcode/xcshareddata/xcschemes/ProHUD.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index 97b5c54..2be3976 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -304,7 +304,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -358,7 +358,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/Example/Example/AppDelegate.swift b/Example/Example/AppDelegate.swift index e1991e1..7c96ad9 100644 --- a/Example/Example/AppDelegate.swift +++ b/Example/Example/AppDelegate.swift @@ -18,12 +18,18 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. + let vc = RootVC() window = UIWindow.init(frame: UIScreen.main.bounds) - window?.rootViewController = RootVC() + window?.rootViewController = vc window?.makeKeyAndVisible() ProHUD.config { (cfg) in - cfg.rootViewController = window!.rootViewController + cfg.rootViewController = vc + if #available(iOS 13.0, *) { + cfg.windowScene = window?.windowScene + } else { + // Fallback on earlier versions + } cfg.alert { (a) in a.titleFont = .bold(22) a.bodyFont = .regular(17) diff --git a/Example/Example/RootVC.swift b/Example/Example/RootVC.swift index 97674ae..973b7b0 100644 --- a/Example/Example/RootVC.swift +++ b/Example/Example/RootVC.swift @@ -18,7 +18,11 @@ class RootVC: UIViewController { let nav = UINavigationController(rootViewController: vc) addChild(nav) view.addSubview(nav.view) - nav.navigationBar.prefersLargeTitles = true + if #available(iOS 11.0, *) { + nav.navigationBar.prefersLargeTitles = true + } else { + // Fallback on earlier versions + } } diff --git a/Example/Podfile b/Example/Podfile index 48f0a8b..4b38fd5 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -2,12 +2,12 @@ platform :ios, '10.0' use_frameworks! target 'Example' do - + pod 'ProHUD', :path => '..' - - pod 'SnapKit', '4.2.0' - pod 'Inspire', '1.0.5' # :path => '../Inspire' - + + pod 'SnapKit', '5.0.0' + pod 'Inspire', :path => '../../Inspire' + end diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 79bd736..cb8ef97 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,29 +1,30 @@ PODS: - - Inspire (1.0.5) + - Inspire (1.1.0) - ProHUD (1.0): - Inspire - - SnapKit (= 4.2.0) - - SnapKit (4.2.0) + - SnapKit (= 5.0) + - SnapKit (5.0.0) DEPENDENCIES: - - Inspire (= 1.0.5) + - Inspire (from `../../Inspire`) - ProHUD (from `..`) - - SnapKit (= 4.2.0) + - SnapKit (= 5.0.0) SPEC REPOS: - https://github.com/cocoapods/specs.git: - - Inspire + trunk: - SnapKit EXTERNAL SOURCES: + Inspire: + :path: "../../Inspire" ProHUD: :path: ".." SPEC CHECKSUMS: - Inspire: fcd7b5ed3b30506b7f04645719b52e0a89884cd4 - ProHUD: 6e5ce4d0599f9b8d2481783368cb08947df7657f - SnapKit: fe8a619752f3f27075cc9a90244d75c6c3f27e2a + Inspire: 0beb2517cbf0111fe13c6bb1ab9ea791abd1f42b + ProHUD: 7128b55036885ac4f8b4d0b0783ee6f8eb3a2ea9 + SnapKit: fd22d10eb9aff484d79a8724eab922c1ddf89bcf -PODFILE CHECKSUM: 973ed9d97f2f88c3dde66acf49139682be3748eb +PODFILE CHECKSUM: 80148eec6ba2e9631b208c7b277316b6c551afc4 -COCOAPODS: 1.7.5 +COCOAPODS: 1.9.2 diff --git a/ProHUD.podspec b/ProHUD.podspec index 2b7456e..fb3bbcc 100755 --- a/ProHUD.podspec +++ b/ProHUD.podspec @@ -9,12 +9,12 @@ Pod::Spec.new do |s| s.ios.deployment_target = '10.0' - s.source_files = 'ProHUD/**/*.swift' - s.resource_bundles = { 'ProHUD' => ['ProHUD/*.{xcassets,strings,xml,storyboard,xib,xcdatamodeld,gif,lproj}'] } + s.source_files = 'Source/**/*.swift' + s.resource_bundles = { 'ProHUD' => ['Source/**/*.{xcassets,strings,xml,storyboard,xib,xcdatamodeld,gif,lproj}'] } s.requires_arc = true s.swift_version = '5.0' s.dependency 'SnapKit', '5.0' - s.dependency 'Inspire' + s.dependency 'Inspire' end diff --git a/Source/ProHUD.swift b/Source/ProHUD.swift index c62ac3d..9df296d 100644 --- a/Source/ProHUD.swift +++ b/Source/ProHUD.swift @@ -83,17 +83,13 @@ internal extension ProHUD { /// 获取Bundle static var bundle: Bundle { - var b = Bundle.init(for: Alert.self) - let p = b.path(forResource: "ProHUD", ofType: "bundle") - if let bb = Bundle.init(path: p ?? "") { - b = bb - } - return b + let path = Bundle(for: HUDController.self).path(forResource: "ProHUD", ofType: "bundle") + return Bundle(path: path ?? "") ?? Bundle.main } /// 获取Image static func image(named: String) -> UIImage? { - return UIImage(named: named) ?? UIImage.init(named: named, in: bundle, compatibleWith: nil) + return UIImage(named: named) ?? UIImage(named: named, in: bundle, compatibleWith: nil) }