Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to swift 5 + min target: macos 10.13 #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions kmbmpdc.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -256,16 +256,16 @@
TargetAttributes = {
81AA7BF81D48B13D00416934 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1200;
};
81AA7C071D48B13E00416934 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1200;
TestTargetID = 81AA7BF81D48B13D00416934;
};
81AA7C121D48B13E00416934 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1200;
TestTargetID = 81AA7BF81D48B13D00416934;
};
};
Expand All @@ -275,6 +275,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -413,7 +414,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
Expand Down Expand Up @@ -461,7 +462,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand All @@ -487,14 +488,14 @@
"${SRCROOT}/Frameworks/**",
"$(PROJECT_DIR)/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.13;
OTHER_SWIFT_FLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = me.perala.kmbmpdc;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_INCLUDE_PATHS = "${SRCROOT}/Frameworks/**";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
Expand All @@ -517,13 +518,13 @@
"${SRCROOT}/Frameworks/**",
"$(PROJECT_DIR)/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.13;
OTHER_SWIFT_FLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = me.perala.kmbmpdc;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_INCLUDE_PATHS = "${SRCROOT}/Frameworks/**";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
Expand All @@ -538,7 +539,7 @@
PRODUCT_BUNDLE_IDENTIFIER = me.perala.kmbmpdcTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/kmbmpdc.app/Contents/MacOS/kmbmpdc";
};
name = Debug;
Expand All @@ -553,7 +554,7 @@
PRODUCT_BUNDLE_IDENTIFIER = me.perala.kmbmpdcTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/kmbmpdc.app/Contents/MacOS/kmbmpdc";
};
name = Release;
Expand All @@ -567,7 +568,7 @@
PRODUCT_BUNDLE_IDENTIFIER = me.perala.kmbmpdcUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TEST_TARGET_NAME = kmbmpdc;
};
name = Debug;
Expand All @@ -581,7 +582,7 @@
PRODUCT_BUNDLE_IDENTIFIER = me.perala.kmbmpdcUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TEST_TARGET_NAME = kmbmpdc;
};
name = Release;
Expand Down
2 changes: 1 addition & 1 deletion kmbmpdc/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import MediaKeyTap

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDelegate, MediaKeyTapDelegate {
let controller = Controller(nibName: NSNib.Name("Controller"), bundle: Bundle.main)
let controller = Controller(nibName: "Controller", bundle: Bundle.main)
let popover = NSPopover()
let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.squareLength)

Expand Down
16 changes: 8 additions & 8 deletions kmbmpdc/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import Cocoa

struct Constants {
struct Images {
static let pauseButton = NSImage.Name("PauseButton")
static let pauseButtonAlt = NSImage.Name("PauseButtonAlt")
static let placeholderCover = NSImage.Name("PlaceholderCover")
static let playButton = NSImage.Name("PlayButton")
static let playButtonAlt = NSImage.Name("PlayButtonAlt")
static let statusPaused = NSImage.Name("StatusPaused")
static let statusPlaying = NSImage.Name("StatusPlaying")
static let pauseButton = "PauseButton"
static let pauseButtonAlt = "PauseButtonAlt"
static let placeholderCover = "PlaceholderCover"
static let playButton = "PlayButton"
static let playButtonAlt = "PlayButtonAlt"
static let statusPaused = "StatusPaused"
static let statusPlaying = "StatusPlaying"
}

struct Nibs {
static let search = NSNib.Name("Search")
static let search = "Search"
}

struct Notifications {
Expand Down
2 changes: 1 addition & 1 deletion kmbmpdc/Controller.swift
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class Controller: NSViewController {
func reconnectSchedule() {
let timer = Timer(timeInterval: reconnectTimer, target: self,
selector: #selector(Controller.reconnect), userInfo: nil, repeats: false)
RunLoop.main.add(timer, forMode: .commonModes)
RunLoop.main.add(timer, forMode: RunLoop.Mode.common)

reconnectTimer *= 2
if reconnectTimer > 60.0 {
Expand Down