-
-
Save anonymous/1f8ad96ebcfb4ecfa489ee56ce6df1f6 to your computer and use it in GitHub Desktop.
Test for touchBar... (no idea if it works)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@available(OSX 10.12.2, *) | |
extension ViewController: NSTouchBarDelegate { | |
override func makeTouchBar() -> NSTouchBar? { | |
let touchBar = NSTouchBar() | |
// return touchBar info | |
print(touchBar) // if nothing returns no touchBar available? | |
return touchBar | |
} | |
} | |
class AppDelegate: NSObject, NSApplicationDelegate { | |
@IBOutlet weak var window: NSWindow! | |
func applicationDidFinishLaunching(aNotification: NSNotification) { | |
if #available(OSX 10.12.2, *) { | |
ViewController().makeTouchBar() | |
} else { | |
// Fallback on earlier versions | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment