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

Commit

Permalink
Use SwiftUI App entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Feb 15, 2024
1 parent d00b5ee commit 0e30cfa
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 35 deletions.
19 changes: 4 additions & 15 deletions Aware.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
objects = {

/* Begin PBXBuildFile section */
036DA9B52B7AF52E0066B4B2 /* App.swift in Sources */ = {isa = PBXBuildFile; fileRef = 036DA9B42B7AF52E0066B4B2 /* App.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 */; };
03F9E2311C24CCA8001DBE86 /* CustomTimeIntervalFormatStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03F9E2301C24CCA8001DBE86 /* CustomTimeIntervalFormatStyle.swift */; };
03F9E2331C24CD2E001DBE86 /* CustomTimeIntervalFormatStyleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03F9E2321C24CD2E001DBE86 /* CustomTimeIntervalFormatStyleTests.swift */; };
/* End PBXBuildFile section */
Expand All @@ -25,10 +25,10 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
036DA9B42B7AF52E0066B4B2 /* App.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = App.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>"; };
036EBD1D1C1408C200121D0B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
038D0B381C4DDD5600040C44 /* Aware.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Aware.entitlements; sourceTree = "<group>"; };
03F9E2261C24CAD3001DBE86 /* AwareTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AwareTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
03F9E2301C24CCA8001DBE86 /* CustomTimeIntervalFormatStyle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomTimeIntervalFormatStyle.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -74,10 +74,10 @@
036EBD171C1408C200121D0B /* Aware */ = {
isa = PBXGroup;
children = (
036DA9B42B7AF52E0066B4B2 /* App.swift */,
036EBD181C1408C200121D0B /* AppDelegate.swift */,
03F9E2301C24CCA8001DBE86 /* CustomTimeIntervalFormatStyle.swift */,
036EBD1A1C1408C200121D0B /* Assets.xcassets */,
036EBD1C1C1408C200121D0B /* MainMenu.xib */,
038D0B381C4DDD5600040C44 /* Aware.entitlements */,
);
path = Aware;
Expand Down Expand Up @@ -184,7 +184,6 @@
buildActionMask = 2147483647;
files = (
036EBD1B1C1408C200121D0B /* Assets.xcassets in Resources */,
036EBD1E1C1408C200121D0B /* MainMenu.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -202,6 +201,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
036DA9B52B7AF52E0066B4B2 /* App.swift in Sources */,
03F9E2311C24CCA8001DBE86 /* CustomTimeIntervalFormatStyle.swift in Sources */,
036EBD191C1408C200121D0B /* AppDelegate.swift in Sources */,
);
Expand All @@ -225,17 +225,6 @@
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
036EBD1C1C1408C200121D0B /* MainMenu.xib */ = {
isa = PBXVariantGroup;
children = (
036EBD1D1C1408C200121D0B /* Base */,
);
name = MainMenu.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
036EBD201C1408C200121D0B /* Debug */ = {
isa = XCBuildConfiguration;
Expand Down
17 changes: 17 additions & 0 deletions Aware/App.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// App.swift
// Aware
//
// Created by Joshua Peek on 2/12/24.
//

import SwiftUI

@main
struct AwareApp: App {
@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate

var body: some Scene {
_EmptyScene()
}
}
5 changes: 2 additions & 3 deletions Aware/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
// Copyright © 2015 Joshua Peek. All rights reserved.
//

import Cocoa
import AppKit

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
var timerStart: Date = .init()

Expand All @@ -29,7 +28,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
return defaultsValue ?? type(of: self).defaultUserIdleSeconds
}

let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
lazy var statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)

func applicationDidFinishLaunching(_: Notification) {
userIdleSeconds = readUserIdleSeconds()
Expand Down
17 changes: 0 additions & 17 deletions Aware/Base.lproj/MainMenu.xib

This file was deleted.

0 comments on commit 0e30cfa

Please sign in to comment.