From d2099fe10234d32537da80727076988d87093567 Mon Sep 17 00:00:00 2001 From: Maksim Karelov Date: Thu, 28 Mar 2019 22:32:27 +0300 Subject: [PATCH] Fix messaging with Vivaldi and migrate to Swift5 --- native/Cartfile.resolved | 4 ++-- native/YMC.xcodeproj/project.pbxproj | 5 +++-- native/YMC/Application/AppDelegate/AppDelegate.swift | 4 +++- native/YMC/Classes/Player.swift | 2 +- native/YMC/Info.plist | 4 ++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/native/Cartfile.resolved b/native/Cartfile.resolved index 439272c..21c4b2c 100644 --- a/native/Cartfile.resolved +++ b/native/Cartfile.resolved @@ -1,4 +1,4 @@ -github "JohnSundell/Files" "2.3.0" +github "JohnSundell/Files" "3.0.0" github "ReactiveX/RxSwift" "4.4.2" -github "SwiftyBeaver/SwiftyBeaver" "1.6.2" +github "SwiftyBeaver/SwiftyBeaver" "1.7.0" github "Ty3uK/MediaKeyTap" "066ab19ffb1d44a02780f058af33a6155550e8ab" diff --git a/native/YMC.xcodeproj/project.pbxproj b/native/YMC.xcodeproj/project.pbxproj index 53b379b..b6c60c0 100644 --- a/native/YMC.xcodeproj/project.pbxproj +++ b/native/YMC.xcodeproj/project.pbxproj @@ -228,6 +228,7 @@ TargetAttributes = { CE0E362A2212898700877823 = { CreatedOnToolsVersion = 10.1; + LastSwiftMigration = 1020; SystemCapabilities = { com.apple.HardenedRuntime = { enabled = 0; @@ -435,7 +436,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = info.karelov.YMC; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -457,7 +458,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = info.karelov.YMC; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/native/YMC/Application/AppDelegate/AppDelegate.swift b/native/YMC/Application/AppDelegate/AppDelegate.swift index 483d807..bbb0bb8 100644 --- a/native/YMC/Application/AppDelegate/AppDelegate.swift +++ b/native/YMC/Application/AppDelegate/AppDelegate.swift @@ -17,7 +17,9 @@ class AppDelegate: NSObject, NSApplicationDelegate { let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength) let popover = NSPopover() - let runStdinMonitoring = CommandLine.arguments.first(where: { $0.contains("ymc.json") }) != nil + let runStdinMonitoring = CommandLine.arguments.first(where: { + $0.contains("ymc.json") || $0.contains("chrome-extension://") + }) != nil var playerViewController: PlayerViewController? = nil var mediaKeyTap: MediaKeyTap? = nil var isAccessibilityAvailable = false diff --git a/native/YMC/Classes/Player.swift b/native/YMC/Classes/Player.swift index 4c90bf8..961ea9c 100644 --- a/native/YMC/Classes/Player.swift +++ b/native/YMC/Classes/Player.swift @@ -92,7 +92,7 @@ class Player { } public var coverImage: NSImage? { get { - guard let result = try? _coverImage$.value() else { return nil } + guard let result = ((try? _coverImage$.value()) as NSImage??) else { return nil } return result } } diff --git a/native/YMC/Info.plist b/native/YMC/Info.plist index dd8e696..bf71543 100644 --- a/native/YMC/Info.plist +++ b/native/YMC/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0.2 + 1.0.3 CFBundleURLTypes @@ -30,7 +30,7 @@ CFBundleVersion - 3 + 4 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) LSUIElement