Skip to content

Commit

Permalink
avaliable for >=10.12.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Toxblh committed Apr 9, 2018
1 parent 74d57cd commit aaa7bc3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions MTMR.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
Expand Down Expand Up @@ -465,7 +465,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand Down
8 changes: 5 additions & 3 deletions MTMR/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {



func applicationDidFinishLaunching(_ aNotification: Notification) {
TouchBarController.shared.setupControlStripPresence()
if #available(OSX 10.12.2, *) {
TouchBarController.shared.setupControlStripPresence()
} else {
// Fallback on earlier versions
}
// Insert code here to initialize your application
}

Expand Down
1 change: 1 addition & 0 deletions MTMR/AppleScriptTouchBarItem.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Foundation

@available(OSX 10.12.2, *)
class AppleScriptTouchBarItem: NSCustomTouchBarItem {
let script: NSAppleScript
private var timer: Timer!
Expand Down
1 change: 1 addition & 0 deletions MTMR/TimeTouchBarItem.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Cocoa

@available(OSX 10.12.2, *)
class TimeTouchBarItem: NSCustomTouchBarItem {
private let dateFormatter = DateFormatter()
private var timer: Timer!
Expand Down
2 changes: 2 additions & 0 deletions MTMR/TouchBarController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import Cocoa

@available(OSX 10.12.2, *)
class TouchBarController: NSObject, NSTouchBarDelegate {

static let shared = TouchBarController()
Expand Down Expand Up @@ -101,6 +102,7 @@ class TouchBarController: NSObject, NSTouchBarDelegate {

}

@available(OSX 10.12.2, *)
extension CustomButtonTouchBarItem {
convenience init(identifier: NSTouchBarItem.Identifier, title: String, HIDKeycode: Int) {
self.init(identifier: identifier, title: title) { _ in
Expand Down
2 changes: 2 additions & 0 deletions MTMR/TouchBarItems.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import Cocoa

@available(OSX 10.12.2, *)
extension NSTouchBarItem.Identifier {
static let escButton = NSTouchBarItem.Identifier("com.toxblh.mtmr.escButton")
static let dismissButton = NSTouchBarItem.Identifier("com.toxblh.mtmr.dismissButton")
Expand Down Expand Up @@ -35,6 +36,7 @@ extension NSTouchBarItem.Identifier {
static let controlStripItem = NSTouchBarItem.Identifier("com.toxblh.mtmr.controlStrip")
}

@available(OSX 10.12.2, *)
class CustomButtonTouchBarItem: NSCustomTouchBarItem {
let tapClosure: (NSCustomTouchBarItem) -> ()

Expand Down

0 comments on commit aaa7bc3

Please sign in to comment.