Commit e18785fc by Maurits van Beusekom Committed by GitHub

Merge pull request #41 from BaseflowIT/issues/38

Updated to latest Swift version (4.2)
parents aa689e6c fdc46cd4
...@@ -46,7 +46,7 @@ matrix: ...@@ -46,7 +46,7 @@ matrix:
env: env:
- SHARD="Build example ipas" - SHARD="Build example ipas"
language: generic language: generic
osx_image: xcode9.3 osx_image: xcode10.1
before_script: before_script:
- ./scripts/before_build_ipas.sh - ./scripts/before_build_ipas.sh
- export PATH=$HOME/flutter/bin:$HOME/flutter/bin/cache/dart-sdk/bin:$PATH - export PATH=$HOME/flutter/bin:$HOME/flutter/bin/cache/dart-sdk/bin:$PATH
......
...@@ -222,7 +222,7 @@ ...@@ -222,7 +222,7 @@
); );
inputPaths = ( inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", "${PODS_ROOT}/../.symlinks/flutter/ios-release/Flutter.framework",
"${BUILT_PRODUCTS_DIR}/permission_handler/permission_handler.framework", "${BUILT_PRODUCTS_DIR}/permission_handler/permission_handler.framework",
); );
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
...@@ -445,7 +445,7 @@ ...@@ -445,7 +445,7 @@
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0; SWIFT_VERSION = 4.2;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
}; };
name = Debug; name = Debug;
...@@ -472,7 +472,7 @@ ...@@ -472,7 +472,7 @@
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0; SWIFT_VERSION = 4.2;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
}; };
name = Release; name = Release;
......
...@@ -5,7 +5,7 @@ import Flutter ...@@ -5,7 +5,7 @@ import Flutter
@objc class AppDelegate: FlutterAppDelegate { @objc class AppDelegate: FlutterAppDelegate {
override func application( override func application(
_ application: UIApplication, _ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool { ) -> Bool {
GeneratedPluginRegistrant.register(with: self) GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions) return super.application(application, didFinishLaunchingWithOptions: launchOptions)
......
...@@ -47,12 +47,12 @@ class PermissionManager: NSObject { ...@@ -47,12 +47,12 @@ class PermissionManager: NSObject {
static func openAppSettings(result: @escaping FlutterResult) { static func openAppSettings(result: @escaping FlutterResult) {
if #available(iOS 8.0, *) { if #available(iOS 8.0, *) {
if #available(iOS 10, *) { if #available(iOS 10, *) {
UIApplication.shared.open(URL.init(string: UIApplicationOpenSettingsURLString)!, options: [:], UIApplication.shared.open(URL.init(string: UIApplication.openSettingsURLString)!, options: convertToUIApplicationOpenExternalURLOptionsKeyDictionary([:]),
completionHandler: { completionHandler: {
(success) in result(success) (success) in result(success)
}) })
} else { } else {
let success = UIApplication.shared.openURL(URL.init(string: UIApplicationOpenSettingsURLString)!) let success = UIApplication.shared.openURL(URL.init(string: UIApplication.openSettingsURLString)!)
result(success) result(success)
} }
} }
...@@ -89,3 +89,8 @@ class PermissionManager: NSObject { ...@@ -89,3 +89,8 @@ class PermissionManager: NSObject {
} }
} }
} }
// Helper function inserted by Swift 4.2 migrator.
fileprivate func convertToUIApplicationOpenExternalURLOptionsKeyDictionary(_ input: [String: Any]) -> [UIApplication.OpenExternalURLOptionsKey: Any] {
return Dictionary(uniqueKeysWithValues: input.map { key, value in (UIApplication.OpenExternalURLOptionsKey(rawValue: key), value)})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment