Skip to content
This repository was archived by the owner on Jun 26, 2023. It is now read-only.

Commit e0ddc48

Browse files
committed
Unify whitespace
1 parent b04a2ac commit e0ddc48

File tree

10 files changed

+41
-37
lines changed

10 files changed

+41
-37
lines changed

Dynamic/Auxiliary/Notification.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ enum UserNotification {
2222
case "issues.new": self = .reportBug
2323
default:
2424
guard let last = rawValue.split(separator: ".").last
25-
, let id = Int(last) else { return nil }
26-
self = .issue(id: id)
25+
, let id = Int(last)
26+
else { return nil }
27+
self = .issue(id: id)
2728
}
2829
}
2930

Dynamic/Components/Appearance/AppleInterfaceStyle+NSAppearance.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ extension AppleInterfaceStyle {
3535
static var current: AppleInterfaceStyle {
3636
return isDark ? .darkAqua : .aqua
3737
}
38-
38+
3939
static var isDark: Bool {
4040
return NSAppearance.current.isDark
4141
}

Dynamic/Components/Appearance/AppleScriptHelper.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ extension AppleScript {
5858
showErrorThenRedirect()
5959
}
6060
}
61-
61+
6262
public static func showErrorThenRedirect() {
6363
runModal(ofNSAlert: { alert in
6464
alert.alertStyle = .critical
@@ -76,11 +76,11 @@ extension AppleScript {
7676
redirectToSystemPreferences()
7777
})
7878
}
79-
79+
8080
public static func redirectToSystemPreferences() {
8181
openURL("x-apple.systempreferences:com.apple.preference.security?Privacy_Automation")
8282
}
83-
83+
8484
public static func requestPermission(
8585
retryOnInternalError: Bool = true,
8686
then process: @escaping Handler<Bool>

Dynamic/Components/Preferences.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ extension Preferences {
4141

4242
extension Preferences {
4343
private static var handles: [NSKeyValueObservation] = []
44-
44+
4545
public static func stopObserving() {
4646
StatusBarItem.only.stopObserving()
4747
handles.lazy.forEach { $0.invalidate() }
4848
handles = []
4949
}
50-
50+
5151
public static func startObserving() {
5252
stopObserving()
5353
StatusBarItem.only.startObserving()
@@ -164,7 +164,7 @@ extension Preferences {
164164
setPreferred(to: newValue)
165165
}
166166
}
167-
167+
168168
@objc dynamic var scheduleType: Int {
169169
get {
170170
return preferences.integer(forKey: #function)
@@ -173,7 +173,7 @@ extension Preferences {
173173
setPreferred(to: newValue)
174174
}
175175
}
176-
176+
177177
var scheduleZenithType: Zenith {
178178
get {
179179
return Zenith(rawValue: scheduleType) ?? .official
@@ -243,7 +243,7 @@ extension Preferences {
243243
})
244244
}
245245
}
246-
246+
247247
var placemark: String? {
248248
get {
249249
return preferences.string(forKey: #function)
@@ -252,7 +252,7 @@ extension Preferences {
252252
setPreferred(to: newValue)
253253
}
254254
}
255-
255+
256256
@objc dynamic var rawSettingsStyle: Int {
257257
get {
258258
return preferences.integer(forKey: #function)
@@ -261,7 +261,7 @@ extension Preferences {
261261
setPreferred(to: newValue)
262262
}
263263
}
264-
264+
265265
var settingsStyle: StatusBarItem.Style {
266266
get {
267267
return StatusBarItem.Style(rawValue: rawSettingsStyle) ?? .menu
@@ -270,7 +270,7 @@ extension Preferences {
270270
rawSettingsStyle = newValue.rawValue
271271
}
272272
}
273-
273+
274274
var toggleShortcutKey: String {
275275
return "toggleShortcut"
276276
}

Dynamic/Components/Scheduler/Scheduler.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,12 @@ public final class Scheduler: NSObject {
150150

151151
private override init() {
152152
super.init()
153-
for name in [NSWorkspace.didWakeNotification,
154-
NSWorkspace.screensDidWakeNotification,
155-
NSWorkspace.sessionDidBecomeActiveNotification] {
153+
let notifications = [
154+
NSWorkspace.didWakeNotification,
155+
NSWorkspace.screensDidWakeNotification,
156+
NSWorkspace.sessionDidBecomeActiveNotification
157+
]
158+
for name in notifications {
156159
NSWorkspace.shared.notificationCenter.addObserver(
157160
self, selector: #selector(workspaceDidWake),
158161
name: name, object: nil

Dynamic/View Controller/Access Points/StatusBarItem.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Cocoa
1111
public final class StatusBarItem {
1212
public static let only = StatusBarItem()
1313
private init() { }
14-
14+
1515
enum Style: Int {
1616
case menu
1717
case rightClick
@@ -38,7 +38,7 @@ public final class StatusBarItem {
3838
AppleInterfaceStyle.Coordinator.toggleInterfaceStyle()
3939
}
4040
}
41-
41+
4242
private func buildMenu() -> NSMenu {
4343
let menu = NSMenu()
4444
let toggleItem = NSMenuItem(

Dynamic/View Controller/Settings/SettingsViewController.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ class SettingsViewController: NSViewController {
2929
NSApp.activate(ignoringOtherApps: true)
3030
window?.makeKeyAndOrderFront(nil)
3131
}
32-
32+
3333
@IBAction func close(_ sender: Any) {
3434
SettingsViewController.window?.close()
3535
}
36-
36+
3737
override func viewDidAppear() {
3838
super.viewDidAppear()
3939
// The following is required to attach touchbar to a view controller.
@@ -42,12 +42,12 @@ class SettingsViewController: NSViewController {
4242
view.window?.bind(NSBindingName(rawValue: #keyPath(touchBar)), to: self, withKeyPath: #keyPath(touchBar), options: nil)
4343
NSUserDefaultsController.shared.appliesImmediately = true
4444
}
45-
45+
4646
override func viewDidDisappear() {
4747
super.viewDidDisappear()
4848
UserNotification.removeAll()
4949
}
50-
50+
5151
@IBAction func reSetup(_ sender: Any) {
5252
let name = Bundle.main.bundleIdentifier!
5353
preferences.removePersistentDomain(forName: name)

Dynamic/View Controller/Settings/TouchBarForSettingsVC.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extension SettingsViewController: NSTouchBarDelegate {
1515
touchBar.defaultItemIdentifiers = [.thresholdPopoverItem, .scheduleTypePopoverItem]
1616
return touchBar
1717
}
18-
18+
1919
func touchBar(_ touchBar: NSTouchBar, makeItemForIdentifier identifier: NSTouchBarItem.Identifier) -> NSTouchBarItem? {
2020
let defaultsController = NSUserDefaultsController.shared
2121
switch identifier {
@@ -71,7 +71,7 @@ extension SettingsViewController: NSScrubberDataSource, NSScrubberDelegate {
7171
func numberOfItems(for scrubber: NSScrubber) -> Int {
7272
return 5
7373
}
74-
74+
7575
func scrubber(_ scrubber: NSScrubber, viewForItemAt index: Int) -> NSScrubberItemView {
7676
let view = NSScrubberTextItemView()
7777
switch index {
@@ -90,7 +90,7 @@ extension SettingsViewController: NSScrubberDataSource, NSScrubberDelegate {
9090
}
9191
return view
9292
}
93-
93+
9494
func scrubber(_ scrubber: NSScrubber, didSelectItemAt selectedIndex: Int) {
9595
preferences.scheduleType = selectedIndex
9696
}

Dynamic/View Controller/Welcome/AllowLocationViewController.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Cocoa
1010
import CoreLocation
1111

1212
class AllowLocationViewController: NSViewController, LastSetupStep {
13-
13+
1414
@IBOutlet weak var showPreferences: NSButton!
1515

1616
var whenNotAuthorized: Bool {
@@ -21,7 +21,7 @@ class AllowLocationViewController: NSViewController, LastSetupStep {
2121
return true
2222
}
2323
}
24-
24+
2525
override func viewDidAppear() {
2626
super.viewDidAppear()
2727
guard whenNotAuthorized else { return }
@@ -38,20 +38,20 @@ class AllowLocationViewController: NSViewController, LastSetupStep {
3838
}
3939
}
4040
}
41-
41+
4242
// MARK: - Navigation
43-
43+
4444
@IBAction func skip(_ sender: Any) {
4545
showNextOnce()
4646
}
47-
47+
4848
@IBAction func openPreferences(_ sender: NSButton) {
4949
guard whenNotAuthorized else { return }
5050
redirectToSystemPreferences()
5151
}
52-
52+
5353
private var firstTime = true
54-
54+
5555
func showNextOnce() {
5656
if firstTime {
5757
firstTime = false
@@ -94,7 +94,7 @@ extension AllowLocationViewController: CLLocationManagerDelegate {
9494
}
9595
})
9696
}
97-
97+
9898
func locationManager(_ manager: CLLocationManager,
9999
didChangeAuthorization status: CLAuthorizationStatus) {
100100
_ = whenNotAuthorized

Dynamic/View Controller/Welcome/SlideSegue.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ class SlideSegue: NSStoryboardSegue, NSViewControllerPresentationAnimator {
1414
let destination = destinationController as! NSViewController
1515
source.present(destination, animator: self)
1616
}
17-
17+
1818
private let animationDuration: TimeInterval = 0.75
1919
private let frameWidth: CGFloat = 480
2020
private lazy var origin = CGPoint(x: frameWidth, y: 0)
21-
21+
2222
func animatePresentation(of viewController: NSViewController, from fromViewController: NSViewController) {
2323
let presented = viewController.view
2424
presented.wantsLayer = true
@@ -35,7 +35,7 @@ class SlideSegue: NSStoryboardSegue, NSViewControllerPresentationAnimator {
3535
presented.animator().frame.size.width = frameWidth
3636
}
3737
}
38-
38+
3939
func animateDismissal(of viewController: NSViewController, from fromViewController: NSViewController) {
4040
let presented = viewController.view
4141
let presentor = fromViewController.view

0 commit comments

Comments
 (0)