From a16ef9d4d22b6eed2cc64ea96731e1b554f751e6 Mon Sep 17 00:00:00 2001 From: Tom Bachant Date: Tue, 1 Jan 2019 00:15:46 -0800 Subject: [PATCH] feat: upgrade to Swift 4.2 (#10) --- .../Classes/BPStatusBarAlert.swift | 2 +- .../project.pbxproj | 25 +++++++++++++------ .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++ Example/BPStatusBarAlert/AppDelegate.swift | 2 +- Example/Podfile.lock | 6 ++--- 5 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 Example/BPStatusBarAlert.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/BPStatusBarAlert/Classes/BPStatusBarAlert.swift b/BPStatusBarAlert/Classes/BPStatusBarAlert.swift index 27c2668..186adbc 100644 --- a/BPStatusBarAlert/Classes/BPStatusBarAlert.swift +++ b/BPStatusBarAlert/Classes/BPStatusBarAlert.swift @@ -183,7 +183,7 @@ extension BPStatusBarAlert { } containerWindow = UIWindow(frame: CGRect(x: 0, y: 0, width: keyWindow.frame.width, height: statusBarHeight)) containerWindow?.backgroundColor = UIColor.clear - containerWindow?.windowLevel = UIWindowLevelStatusBar + containerWindow?.windowLevel = UIWindow.Level.statusBar containerWindow?.rootViewController = UIViewController() containerWindow?.rootViewController?.view.addSubview(self) containerWindow?.isHidden = false diff --git a/Example/BPStatusBarAlert.xcodeproj/project.pbxproj b/Example/BPStatusBarAlert.xcodeproj/project.pbxproj index 3a7b651..7e6e796 100644 --- a/Example/BPStatusBarAlert.xcodeproj/project.pbxproj +++ b/Example/BPStatusBarAlert.xcodeproj/project.pbxproj @@ -219,7 +219,7 @@ }; 607FACE41AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; - LastSwiftMigration = 0820; + LastSwiftMigration = 1010; TestTargetID = 607FACCF1AFB9204008FA782; }; }; @@ -270,9 +270,12 @@ files = ( ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-BPStatusBarAlert_Example/Pods-BPStatusBarAlert_Example-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/BPStatusBarAlert/BPStatusBarAlert.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BPStatusBarAlert.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -285,13 +288,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-BPStatusBarAlert_Example-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 2B8F38DC4D610C83D2EE2813 /* [CP] Copy Pods Resources */ = { @@ -330,13 +336,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-BPStatusBarAlert_Tests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; D06DF8D50415C2E17081ADC4 /* [CP] Copy Pods Resources */ = { @@ -502,7 +511,7 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -517,7 +526,7 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; }; name = Release; }; @@ -537,7 +546,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -553,7 +563,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/Example/BPStatusBarAlert.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/BPStatusBarAlert.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Example/BPStatusBarAlert.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/BPStatusBarAlert/AppDelegate.swift b/Example/BPStatusBarAlert/AppDelegate.swift index b52e034..10bc181 100644 --- a/Example/BPStatusBarAlert/AppDelegate.swift +++ b/Example/BPStatusBarAlert/AppDelegate.swift @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 8acaf3b..5e53832 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - BPStatusBarAlert (0.1.0) + - BPStatusBarAlert (0.1.5) DEPENDENCIES: - BPStatusBarAlert (from `../`) @@ -9,8 +9,8 @@ EXTERNAL SOURCES: :path: ../ SPEC CHECKSUMS: - BPStatusBarAlert: 8f0d2d05f479286999dc45663ac5f2bf5231350a + BPStatusBarAlert: 66885c12e669a46e91ac43e83c16e57181f740e7 PODFILE CHECKSUM: c2c74b2d30e20ecbfd72d4075e2551111ab685e0 -COCOAPODS: 1.2.0.beta.3 +COCOAPODS: 1.4.0