From d4d3b491af5dfcc1c01cd9efde2f59156cf9298c Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sat, 8 Jul 2017 13:07:04 -0700 Subject: [PATCH] Convert RSWeb to Swift 4. --- Frameworks/RSWeb/RSWeb.xcodeproj/project.pbxproj | 10 ++++------ Frameworks/RSWeb/RSWeb/MacWebBrowser.swift | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Frameworks/RSWeb/RSWeb.xcodeproj/project.pbxproj b/Frameworks/RSWeb/RSWeb.xcodeproj/project.pbxproj index 97fc49c39..cb3c96b2a 100755 --- a/Frameworks/RSWeb/RSWeb.xcodeproj/project.pbxproj +++ b/Frameworks/RSWeb/RSWeb.xcodeproj/project.pbxproj @@ -463,7 +463,9 @@ SDKROOT = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_TREAT_WARNINGS_AS_ERRORS = YES; + SWIFT_VERSION = 4.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -532,7 +534,9 @@ RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_TREAT_WARNINGS_AS_ERRORS = YES; + SWIFT_VERSION = 4.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -557,7 +561,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -579,7 +582,6 @@ PRODUCT_BUNDLE_IDENTIFIER = com.ranchero.RSWeb; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; }; name = Release; }; @@ -593,7 +595,6 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.ranchero.RSWebTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -607,7 +608,6 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.ranchero.RSWebTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; }; name = Release; }; @@ -631,7 +631,6 @@ SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -655,7 +654,6 @@ PRODUCT_NAME = RSWeb; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; diff --git a/Frameworks/RSWeb/RSWeb/MacWebBrowser.swift b/Frameworks/RSWeb/RSWeb/MacWebBrowser.swift index 8b6026030..e061f4117 100755 --- a/Frameworks/RSWeb/RSWeb/MacWebBrowser.swift +++ b/Frameworks/RSWeb/RSWeb/MacWebBrowser.swift @@ -18,7 +18,7 @@ public class MacWebBrowser { if (inBackground) { do { - try NSWorkspace.shared().open(preparedURL, options: [.withoutActivation], configuration: [String: Any]()) + try NSWorkspace.shared.open(preparedURL, options: [.withoutActivation], configuration: [:]) return true } catch { @@ -26,7 +26,7 @@ public class MacWebBrowser { } } - return NSWorkspace.shared().open(preparedURL) + return NSWorkspace.shared.open(preparedURL) } }