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) }