Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Use built in scheduledTimer
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Feb 12, 2024
1 parent a034613 commit a8061b5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 65 deletions.
4 changes: 0 additions & 4 deletions Aware.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
0337E7871C14E37B003A8150 /* Timer+Block.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0337E7861C14E37B003A8150 /* Timer+Block.swift */; };
036EBD191C1408C200121D0B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 036EBD181C1408C200121D0B /* AppDelegate.swift */; };
036EBD1B1C1408C200121D0B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 036EBD1A1C1408C200121D0B /* Assets.xcassets */; };
036EBD1E1C1408C200121D0B /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 036EBD1C1C1408C200121D0B /* MainMenu.xib */; };
Expand All @@ -26,7 +25,6 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
0337E7861C14E37B003A8150 /* Timer+Block.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Timer+Block.swift"; sourceTree = "<group>"; };
036EBD151C1408C200121D0B /* Aware.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Aware.app; sourceTree = BUILT_PRODUCTS_DIR; };
036EBD181C1408C200121D0B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
036EBD1A1C1408C200121D0B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand Down Expand Up @@ -78,7 +76,6 @@
children = (
036EBD181C1408C200121D0B /* AppDelegate.swift */,
03F9E2301C24CCA8001DBE86 /* NSTimeIntervalFormatter.swift */,
0337E7861C14E37B003A8150 /* Timer+Block.swift */,
036EBD1A1C1408C200121D0B /* Assets.xcassets */,
036EBD1C1C1408C200121D0B /* MainMenu.xib */,
038D0B381C4DDD5600040C44 /* Aware.entitlements */,
Expand Down Expand Up @@ -207,7 +204,6 @@
files = (
03F9E2311C24CCA8001DBE86 /* NSTimeIntervalFormatter.swift in Sources */,
036EBD191C1408C200121D0B /* AppDelegate.swift in Sources */,
0337E7871C14E37B003A8150 /* Timer+Block.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion Aware/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
statusItem.menu = menu

updateButton()
_ = Timer.scheduledTimer(buttonRefreshRate, userInfo: nil, repeats: true) { _ in self.updateButton() }
_ = Timer.scheduledTimer(withTimeInterval: buttonRefreshRate, repeats: true) { _ in self.updateButton() }

let notificationCenter = NSWorkspace.shared.notificationCenter
notificationCenter.addObserver(forName: NSWorkspace.willSleepNotification, object: nil, queue: nil) { _ in self.resetTimer() }
Expand Down
60 changes: 0 additions & 60 deletions Aware/Timer+Block.swift

This file was deleted.

0 comments on commit a8061b5

Please sign in to comment.