FruitMachine-Swift/FruitMachine/AppDelegate.swift

37 lines
1.1 KiB
Swift
Raw Normal View History

2017-07-20 03:44:57 +00:00
//
// AppDelegate.swift
// FruitMachine
//
// Created by Christopher Rohl on 7/19/17.
// Copyright © 2017 Christopher Rohl. All rights reserved.
//
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
2017-07-27 23:22:13 +00:00
let AppleScreenNotifications = Notification.Name("com.luigithirty.appleScreenNotifications")
2017-07-20 03:44:57 +00:00
func applicationDidFinishLaunching(_ aNotification: Notification) {
// Insert code here to initialize your application
}
func applicationWillTerminate(_ aNotification: Notification) {
// Insert code here to tear down your application
}
2017-07-27 23:22:13 +00:00
@IBAction func view_scale_1x(_ sender: Any) {
NotificationCenter.default.post(Notification(name: AppleScreenNotifications, object: "scaleFactor", userInfo: ["scaleFactor": 1]))
}
@IBAction func view_scale_2x(_ sender: Any) {
NotificationCenter.default.post(Notification(name: AppleScreenNotifications, object: "scaleFactor", userInfo: ["scaleFactor": 2]))
}
2017-07-31 07:03:14 +00:00
func applicationShouldTerminateAfterLastWindowClosed (_ theApplication: NSApplication) -> Bool {
return true
}
2017-07-20 03:44:57 +00:00
}