Commit 71d2bdf5 authored by Aral Balkan's avatar Aral Balkan

Update to use Swift 4.2; now compatible with Xcode 10.2

parent c94b7114
Pipeline #826 failed with stages
......@@ -187,6 +187,7 @@
A7EC4AE91D9952B1001EB7D1 = {
CreatedOnToolsVersion = 8.0;
DevelopmentTeam = 5Q42VF5GXA;
LastSwiftMigration = 1010;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.ApplicationGroups.Mac = {
......@@ -203,6 +204,7 @@
A7EC4AFF1D9952FB001EB7D1 = {
CreatedOnToolsVersion = 8.0;
DevelopmentTeam = 5Q42VF5GXA;
LastSwiftMigration = 1010;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.ApplicationGroups.Mac = {
......@@ -340,6 +342,7 @@
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
};
name = Debug;
};
......@@ -381,6 +384,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
};
name = Release;
};
......@@ -397,7 +401,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = ind.ie.BetterTester;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
......@@ -414,7 +419,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = ind.ie.BetterTester;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
};
name = Release;
};
......@@ -429,7 +435,8 @@
PRODUCT_BUNDLE_IDENTIFIER = ind.ie.BetterTester.Blocker;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
......@@ -444,7 +451,8 @@
PRODUCT_BUNDLE_IDENTIFIER = ind.ie.BetterTester.Blocker;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
};
name = Release;
};
......
......@@ -25,7 +25,7 @@ extension NSTextView {
}
*/
func makePlainText(withFontSize
fontSize: CGFloat = NSFont.smallSystemFontSize())
fontSize: CGFloat = NSFont.smallSystemFontSize)
{
//---------------------------------------------------------
......@@ -35,7 +35,7 @@ extension NSTextView {
//self.font = NSFont.userFixedPitchFont(ofSize: NSFont.smallSystemFontSize)
//medium font
self.font = NSFont.userFixedPitchFont(ofSize: NSFont.systemFontSize())
self.font = NSFont.userFixedPitchFont(ofSize: NSFont.systemFontSize)
//---------------------------------------------------------
self.isRulerVisible = false
......
......@@ -73,7 +73,7 @@ class ViewController: NSViewController, NSTextViewDelegate
saveBlockRulesToSharedContainer(rules: blockerListData)
// Update the view
self.textView.string = String(data: blockerListData, encoding: .utf8)
self.textView.string = String(data: blockerListData, encoding: .utf8) ?? ""
// Reload the blocker
reloadContentBlocker()
......@@ -99,7 +99,7 @@ class ViewController: NSViewController, NSTextViewDelegate
{
/* with */ (result) in
if (result == NSFileHandlingPanelOKButton)
if (result == NSApplication.ModalResponse.OK)
{
self.blockerListURL = openPanel.urls[0]
......@@ -119,8 +119,8 @@ class ViewController: NSViewController, NSTextViewDelegate
@IBAction func updateRulesFromHereAction(_ sender: NSButton)
{
print("Updating rules from the text view")
let blockerListData = self.textView.string!.data(using: .utf8)!
print(self.textView.string!)
let blockerListData = self.textView.string.data(using: .utf8)!
print(self.textView.string)
saveBlockRulesToSharedContainer(rules: blockerListData)
reloadContentBlocker()
}
......@@ -133,13 +133,7 @@ class ViewController: NSViewController, NSTextViewDelegate
/// based on whether there is any text in the text view.
func textDidChange(_ notification: Notification)
{
if let text = self.textView.string
{
self.updateRulesFromHereButton.isEnabled = (text != "")
}
else
{
self.updateRulesFromHereButton.isEnabled = false
}
let text = self.textView.string
self.updateRulesFromHereButton.isEnabled = (text != "")
}
}
......@@ -28,7 +28,7 @@ class ContentBlockerRequestHandler: NSObject, NSExtensionRequestHandling {
if (error != nil)
{
NSLog("Error loading JSON: \(error)")
NSLog("Error loading JSON: \(error!)")
}
}
......
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