forked from quoid/userscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewController.swift
More file actions
29 lines (24 loc) · 888 Bytes
/
Copy pathViewController.swift
File metadata and controls
29 lines (24 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//
// ViewController.swift
// Userscripts
//
// Created by Justin Wasack on 4/25/19.
// Copyright © 2019 Justin Wasack. All rights reserved.
//
import Cocoa
import SafariServices.SFSafariApplication
class ViewController: NSViewController {
@IBOutlet var appNameLabel: NSTextField!
override func viewDidLoad() {
super.viewDidLoad()
let appVersion = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String
self.appNameLabel.stringValue = "Userscripts - Version \(appVersion)";
}
@IBAction func openSafariExtensionPreferences(_ sender: AnyObject?) {
SFSafariApplication.showPreferencesForExtension(withIdentifier: "com.userscripts.macos.Userscripts-Extension") { error in
if let _ = error {
// Insert code to inform the user that something went wrong.
}
}
}
}