Skip to content

Commit

Permalink
update to Swift 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
thompsonate committed Aug 4, 2018
1 parent b483bb8 commit c0513ed
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
12 changes: 6 additions & 6 deletions Shifty.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@
43C7A4841F19F2CB00A697C0 = {
CreatedOnToolsVersion = 8.3.2;
DevelopmentTeam = 3Q7XKEDZ36;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.Sandbox = {
Expand All @@ -380,7 +380,7 @@
43CC9E421EBAB19300983528 = {
CreatedOnToolsVersion = 8.3.1;
DevelopmentTeam = 3Q7XKEDZ36;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.Sandbox = {
Expand Down Expand Up @@ -606,7 +606,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -628,7 +628,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down Expand Up @@ -765,7 +765,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Shifty/Shifty-Bridging-Header.h";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -791,7 +791,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Shifty/Shifty-Bridging-Header.h";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion Shifty/AccessibilityView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AccessibilityView: NSView {
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)

guard let nib = NSNib(nibNamed: .init("AccessibilityView"), bundle: Bundle(for: type(of: self))) else { return }
guard let nib = NSNib(nibNamed: "AccessibilityView", bundle: Bundle(for: type(of: self))) else { return }
nib.instantiate(withOwner: self, topLevelObjects: nil)

var newConstraints: [NSLayoutConstraint] = []
Expand Down
2 changes: 1 addition & 1 deletion Shifty/AccessibilityWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AccessibilityWindow: NSWindowController {
@IBOutlet weak var openSysPrefsButton: NSButton!

override var windowNibName: NSNib.Name {
get { return NSNib.Name("AccessibilityWindow") }
get { return "AccessibilityWindow" }
}

override func windowDidLoad() {
Expand Down
2 changes: 1 addition & 1 deletion Shifty/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}

func showSetupWindow() {
let storyboard = NSStoryboard(name: .init("Setup"), bundle: nil)
let storyboard = NSStoryboard(name: "Setup", bundle: nil)
let controller = storyboard.instantiateInitialController() as! NSWindowController
setupWindow = controller.window

Expand Down
4 changes: 2 additions & 2 deletions Shifty/CustomTimeWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CustomTimeWindow: NSWindowController {
let onlyIntValueFormatter = OnlyIntValueFormatter()

override var windowNibName: NSNib.Name {
return NSNib.Name("CustomTimeWindow")
return "CustomTimeWindow"
}

override func windowDidLoad() {
Expand All @@ -37,7 +37,7 @@ class CustomTimeWindow: NSWindowController {
window?.center()
}

let saveName = NSWindow.FrameAutosaveName.init("customTimeWindowFrame")
let saveName = "customTimeWindowFrame"

window?.setFrameUsingName(saveName)

Expand Down
2 changes: 1 addition & 1 deletion Shifty/PrefAboutViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let ShiftyUpdater = SUUpdater()
class PrefAboutViewController: NSViewController, MASPreferencesViewController {

override var nibName: NSNib.Name {
get { return NSNib.Name("PrefAboutViewController") }
get { return "PrefAboutViewController" }
}

var viewIdentifier: String = "PrefAboutViewController"
Expand Down
4 changes: 2 additions & 2 deletions Shifty/PrefGeneralViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import SwiftLog
class PrefGeneralViewController: NSViewController, MASPreferencesViewController {

override var nibName: NSNib.Name {
return NSNib.Name("PrefGeneralViewController")
return "PrefGeneralViewController"
}

var viewIdentifier: String = "PrefGeneralViewController"

var toolbarItemImage: NSImage? {
return NSImage(named: .preferencesGeneral)
return NSImage(named: NSImage.preferencesGeneralName)
}

var toolbarItemLabel: String? {
Expand Down
2 changes: 1 addition & 1 deletion Shifty/PrefShortcutsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class PrefShortcutsViewController: NSViewController, MASPreferencesViewControlle
let statusMenuController = (NSApplication.shared.delegate as? AppDelegate)?.statusMenu.delegate as? StatusMenuController

override var nibName: NSNib.Name {
return NSNib.Name("PrefShortcutsViewController")
return "PrefShortcutsViewController"
}

var viewIdentifier: String = "PrefShortcutsViewController"
Expand Down
10 changes: 5 additions & 5 deletions Shifty/Setup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import SwiftLog

class SetupWindowController: NSWindowController {
override var storyboard: NSStoryboard {
return NSStoryboard(name: .init("Setup"), bundle: nil)
return NSStoryboard(name: "Setup", bundle: nil)
}

override func windowDidLoad() {
Expand Down Expand Up @@ -77,7 +77,7 @@ class AccessibilityViewController: NSViewController {
}

func showNextView() {
performSegue(withIdentifier: NSStoryboardSegue.Identifier("showCompleteView"), sender: self)
performSegue(withIdentifier: "showCompleteView", sender: self)
}
}

Expand All @@ -87,9 +87,9 @@ class ContainerViewController: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()

let setupStoryboard = NSStoryboard(name: .init("Setup"), bundle: nil)
sourceViewController = setupStoryboard.instantiateController(withIdentifier: .init("sourceViewController")) as! NSViewController
self.insertChildViewController(sourceViewController, at: 0)
let setupStoryboard = NSStoryboard(name: "Setup", bundle: nil)
sourceViewController = setupStoryboard.instantiateController(withIdentifier: "sourceViewController") as! NSViewController
self.insertChild(sourceViewController, at: 0)
self.view.addSubview(sourceViewController.view)
self.view.frame = sourceViewController.view.frame

Expand Down
4 changes: 2 additions & 2 deletions Shifty/SlideSegue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SlideSegue: NSStoryboardSegue {
let destinationViewController = self.destinationController as! NSViewController
let containerViewController = sourceViewController.parent

containerViewController?.insertChildViewController(destinationViewController, at: 1)
containerViewController?.insertChild(destinationViewController, at: 1)

let targetSize = destinationViewController.view.frame.size

Expand All @@ -54,6 +54,6 @@ class SlideSegue: NSStoryboardSegue {
containerViewController?.view.topAnchor.constraint(equalTo: destinationViewController.view.topAnchor).isActive = true
})

containerViewController?.removeChildViewController(at: 0)
containerViewController?.removeChild(at: 0)
}
}

0 comments on commit c0513ed

Please sign in to comment.