mirror of
https://github.com/neon443/NearFuture.git
synced 2026-03-11 06:49:12 +00:00
forgot to commit 2.0, but just finished 3.0
3.0: home screen widgets small,med,large they auto refresh! major bug fixes inclluding past date handling past dates are now allowed 2.0: icloud sync ios required is 15, down from 18! auto icloud sync added icloud settings to manually push,pull or sync
This commit is contained in:
@@ -11,32 +11,45 @@
|
|||||||
A920C28C2D24011400E4F9B1 /* Item.swift in Sources */ = {isa = PBXBuildFile; fileRef = A920C28B2D24011400E4F9B1 /* Item.swift */; };
|
A920C28C2D24011400E4F9B1 /* Item.swift in Sources */ = {isa = PBXBuildFile; fileRef = A920C28B2D24011400E4F9B1 /* Item.swift */; };
|
||||||
A920C28E2D24011A00E4F9B1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A920C28D2D24011A00E4F9B1 /* Assets.xcassets */; };
|
A920C28E2D24011A00E4F9B1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A920C28D2D24011A00E4F9B1 /* Assets.xcassets */; };
|
||||||
A920C2922D24011A00E4F9B1 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A920C2912D24011A00E4F9B1 /* Preview Assets.xcassets */; };
|
A920C2922D24011A00E4F9B1 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A920C2912D24011A00E4F9B1 /* Preview Assets.xcassets */; };
|
||||||
A920C29C2D24011A00E4F9B1 /* NearFutureTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A920C29B2D24011A00E4F9B1 /* NearFutureTests.swift */; };
|
|
||||||
A920C2A62D24011B00E4F9B1 /* NearFutureUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A920C2A52D24011B00E4F9B1 /* NearFutureUITests.swift */; };
|
|
||||||
A920C2A82D24011B00E4F9B1 /* NearFutureUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A920C2A72D24011B00E4F9B1 /* NearFutureUITestsLaunchTests.swift */; };
|
|
||||||
A920C2B82D2401A300E4F9B1 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A920C2B42D2401A100E4F9B1 /* SettingsView.swift */; };
|
A920C2B82D2401A300E4F9B1 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A920C2B42D2401A100E4F9B1 /* SettingsView.swift */; };
|
||||||
A920C2BB2D2401A400E4F9B1 /* AddEventView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A920C2B72D2401A300E4F9B1 /* AddEventView.swift */; };
|
A920C2BB2D2401A400E4F9B1 /* AddEventView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A920C2B72D2401A300E4F9B1 /* AddEventView.swift */; };
|
||||||
A920C2BE2D24021A00E4F9B1 /* SFSymbolsPicker in Frameworks */ = {isa = PBXBuildFile; productRef = A920C2BD2D24021A00E4F9B1 /* SFSymbolsPicker */; };
|
A920C2BE2D24021A00E4F9B1 /* SFSymbolsPicker in Frameworks */ = {isa = PBXBuildFile; productRef = A920C2BD2D24021A00E4F9B1 /* SFSymbolsPicker */; };
|
||||||
A920C2C12D2403CA00E4F9B1 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A920C2C02D2403CA00E4F9B1 /* ContentView.swift */; };
|
A920C2C12D2403CA00E4F9B1 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A920C2C02D2403CA00E4F9B1 /* ContentView.swift */; };
|
||||||
|
A979F57F2D26B1300094C0B3 /* EditEventView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A979F57E2D26B1300094C0B3 /* EditEventView.swift */; };
|
||||||
|
A979F6052D270AF00094C0B3 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A979F6042D270AF00094C0B3 /* WidgetKit.framework */; };
|
||||||
|
A979F6072D270AF00094C0B3 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A979F6062D270AF00094C0B3 /* SwiftUI.framework */; };
|
||||||
|
A979F60A2D270AF00094C0B3 /* NearFutureWidgetsBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = A979F6092D270AF00094C0B3 /* NearFutureWidgetsBundle.swift */; };
|
||||||
|
A979F60C2D270AF00094C0B3 /* NearFutureWidgetsLiveActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = A979F60B2D270AF00094C0B3 /* NearFutureWidgetsLiveActivity.swift */; };
|
||||||
|
A979F6102D270AF90094C0B3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A979F60F2D270AF80094C0B3 /* Assets.xcassets */; };
|
||||||
|
A979F6142D270AF90094C0B3 /* NearFutureWidgetsExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = A979F6022D270AF00094C0B3 /* NearFutureWidgetsExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
||||||
|
A979F6182D2714310094C0B3 /* Item.swift in Sources */ = {isa = PBXBuildFile; fileRef = A920C28B2D24011400E4F9B1 /* Item.swift */; };
|
||||||
|
A9FC7EEA2D2823920020D75B /* NearFutureWidgets.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9FC7EE92D28238A0020D75B /* NearFutureWidgets.swift */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXContainerItemProxy section */
|
/* Begin PBXContainerItemProxy section */
|
||||||
A920C2982D24011A00E4F9B1 /* PBXContainerItemProxy */ = {
|
A979F6122D270AF90094C0B3 /* PBXContainerItemProxy */ = {
|
||||||
isa = PBXContainerItemProxy;
|
isa = PBXContainerItemProxy;
|
||||||
containerPortal = A920C27C2D24011300E4F9B1 /* Project object */;
|
containerPortal = A920C27C2D24011300E4F9B1 /* Project object */;
|
||||||
proxyType = 1;
|
proxyType = 1;
|
||||||
remoteGlobalIDString = A920C2832D24011300E4F9B1;
|
remoteGlobalIDString = A979F6012D270AF00094C0B3;
|
||||||
remoteInfo = NearFuture;
|
remoteInfo = NearFutureWidgetsExtension;
|
||||||
};
|
|
||||||
A920C2A22D24011B00E4F9B1 /* PBXContainerItemProxy */ = {
|
|
||||||
isa = PBXContainerItemProxy;
|
|
||||||
containerPortal = A920C27C2D24011300E4F9B1 /* Project object */;
|
|
||||||
proxyType = 1;
|
|
||||||
remoteGlobalIDString = A920C2832D24011300E4F9B1;
|
|
||||||
remoteInfo = NearFuture;
|
|
||||||
};
|
};
|
||||||
/* End PBXContainerItemProxy section */
|
/* End PBXContainerItemProxy section */
|
||||||
|
|
||||||
|
/* Begin PBXCopyFilesBuildPhase section */
|
||||||
|
A979F59C2D27006D0094C0B3 /* Embed Foundation Extensions */ = {
|
||||||
|
isa = PBXCopyFilesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
dstPath = "";
|
||||||
|
dstSubfolderSpec = 13;
|
||||||
|
files = (
|
||||||
|
A979F6142D270AF90094C0B3 /* NearFutureWidgetsExtension.appex in Embed Foundation Extensions */,
|
||||||
|
);
|
||||||
|
name = "Embed Foundation Extensions";
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXCopyFilesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
A920C2842D24011400E4F9B1 /* NearFuture.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NearFuture.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
A920C2842D24011400E4F9B1 /* NearFuture.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NearFuture.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
A920C2872D24011400E4F9B1 /* NearFutureApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NearFutureApp.swift; sourceTree = "<group>"; };
|
A920C2872D24011400E4F9B1 /* NearFutureApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NearFutureApp.swift; sourceTree = "<group>"; };
|
||||||
@@ -44,14 +57,25 @@
|
|||||||
A920C28D2D24011A00E4F9B1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
A920C28D2D24011A00E4F9B1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
A920C28F2D24011A00E4F9B1 /* NearFuture.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = NearFuture.entitlements; sourceTree = "<group>"; };
|
A920C28F2D24011A00E4F9B1 /* NearFuture.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = NearFuture.entitlements; sourceTree = "<group>"; };
|
||||||
A920C2912D24011A00E4F9B1 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
|
A920C2912D24011A00E4F9B1 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
|
||||||
A920C2972D24011A00E4F9B1 /* NearFutureTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NearFutureTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
||||||
A920C29B2D24011A00E4F9B1 /* NearFutureTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NearFutureTests.swift; sourceTree = "<group>"; };
|
|
||||||
A920C2A12D24011B00E4F9B1 /* NearFutureUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NearFutureUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
||||||
A920C2A52D24011B00E4F9B1 /* NearFutureUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NearFutureUITests.swift; sourceTree = "<group>"; };
|
|
||||||
A920C2A72D24011B00E4F9B1 /* NearFutureUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NearFutureUITestsLaunchTests.swift; sourceTree = "<group>"; };
|
|
||||||
A920C2B42D2401A100E4F9B1 /* SettingsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
|
A920C2B42D2401A100E4F9B1 /* SettingsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
|
||||||
A920C2B72D2401A300E4F9B1 /* AddEventView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddEventView.swift; sourceTree = "<group>"; };
|
A920C2B72D2401A300E4F9B1 /* AddEventView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddEventView.swift; sourceTree = "<group>"; };
|
||||||
A920C2C02D2403CA00E4F9B1 /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
|
A920C2C02D2403CA00E4F9B1 /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
|
||||||
|
A979F57E2D26B1300094C0B3 /* EditEventView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditEventView.swift; sourceTree = "<group>"; };
|
||||||
|
A979F58B2D2700680094C0B3 /* NearFutureWidgetsBundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NearFutureWidgetsBundle.swift; sourceTree = "<group>"; };
|
||||||
|
A979F58D2D2700680094C0B3 /* NearFutureWidgetsLiveActivity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NearFutureWidgetsLiveActivity.swift; sourceTree = "<group>"; };
|
||||||
|
A979F58F2D2700680094C0B3 /* NearFutureWidgets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NearFutureWidgets.swift; sourceTree = "<group>"; };
|
||||||
|
A979F5912D2700680094C0B3 /* AppIntent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppIntent.swift; sourceTree = "<group>"; };
|
||||||
|
A979F5932D27006D0094C0B3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
|
A979F5952D27006D0094C0B3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
|
A979F6022D270AF00094C0B3 /* NearFutureWidgetsExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = NearFutureWidgetsExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
A979F6042D270AF00094C0B3 /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; };
|
||||||
|
A979F6062D270AF00094C0B3 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; };
|
||||||
|
A979F6092D270AF00094C0B3 /* NearFutureWidgetsBundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NearFutureWidgetsBundle.swift; sourceTree = "<group>"; };
|
||||||
|
A979F60B2D270AF00094C0B3 /* NearFutureWidgetsLiveActivity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NearFutureWidgetsLiveActivity.swift; sourceTree = "<group>"; };
|
||||||
|
A979F60F2D270AF80094C0B3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
|
A979F6112D270AF90094C0B3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
|
A9C05E412D2805D7007DC497 /* NearFutureWidgetsExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = NearFutureWidgetsExtension.entitlements; sourceTree = "<group>"; };
|
||||||
|
A9FC7EE92D28238A0020D75B /* NearFutureWidgets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NearFutureWidgets.swift; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@@ -63,17 +87,12 @@
|
|||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
A920C2942D24011A00E4F9B1 /* Frameworks */ = {
|
A979F5FF2D270AF00094C0B3 /* Frameworks */ = {
|
||||||
isa = PBXFrameworksBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
A920C29E2D24011B00E4F9B1 /* Frameworks */ = {
|
|
||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
A979F6072D270AF00094C0B3 /* SwiftUI.framework in Frameworks */,
|
||||||
|
A979F6052D270AF00094C0B3 /* WidgetKit.framework in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -84,8 +103,8 @@
|
|||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
A920C2862D24011400E4F9B1 /* NearFuture */,
|
A920C2862D24011400E4F9B1 /* NearFuture */,
|
||||||
A920C29A2D24011A00E4F9B1 /* NearFutureTests */,
|
A979F6082D270AF00094C0B3 /* NearFutureWidgets */,
|
||||||
A920C2A42D24011B00E4F9B1 /* NearFutureUITests */,
|
A979F6032D270AF00094C0B3 /* Frameworks */,
|
||||||
A920C2852D24011400E4F9B1 /* Products */,
|
A920C2852D24011400E4F9B1 /* Products */,
|
||||||
);
|
);
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -94,8 +113,7 @@
|
|||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
A920C2842D24011400E4F9B1 /* NearFuture.app */,
|
A920C2842D24011400E4F9B1 /* NearFuture.app */,
|
||||||
A920C2972D24011A00E4F9B1 /* NearFutureTests.xctest */,
|
A979F6022D270AF00094C0B3 /* NearFutureWidgetsExtension.appex */,
|
||||||
A920C2A12D24011B00E4F9B1 /* NearFutureUITests.xctest */,
|
|
||||||
);
|
);
|
||||||
name = Products;
|
name = Products;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -103,6 +121,7 @@
|
|||||||
A920C2862D24011400E4F9B1 /* NearFuture */ = {
|
A920C2862D24011400E4F9B1 /* NearFuture */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
A979F57E2D26B1300094C0B3 /* EditEventView.swift */,
|
||||||
A920C2B72D2401A300E4F9B1 /* AddEventView.swift */,
|
A920C2B72D2401A300E4F9B1 /* AddEventView.swift */,
|
||||||
A920C2C02D2403CA00E4F9B1 /* ContentView.swift */,
|
A920C2C02D2403CA00E4F9B1 /* ContentView.swift */,
|
||||||
A920C2B42D2401A100E4F9B1 /* SettingsView.swift */,
|
A920C2B42D2401A100E4F9B1 /* SettingsView.swift */,
|
||||||
@@ -118,26 +137,45 @@
|
|||||||
A920C2902D24011A00E4F9B1 /* Preview Content */ = {
|
A920C2902D24011A00E4F9B1 /* Preview Content */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
A979F58A2D2700680094C0B3 /* NearFutureWidgets */,
|
||||||
A920C2912D24011A00E4F9B1 /* Preview Assets.xcassets */,
|
A920C2912D24011A00E4F9B1 /* Preview Assets.xcassets */,
|
||||||
);
|
);
|
||||||
path = "Preview Content";
|
path = "Preview Content";
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
A920C29A2D24011A00E4F9B1 /* NearFutureTests */ = {
|
A979F58A2D2700680094C0B3 /* NearFutureWidgets */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
A920C29B2D24011A00E4F9B1 /* NearFutureTests.swift */,
|
A979F58B2D2700680094C0B3 /* NearFutureWidgetsBundle.swift */,
|
||||||
|
A979F58D2D2700680094C0B3 /* NearFutureWidgetsLiveActivity.swift */,
|
||||||
|
A979F58F2D2700680094C0B3 /* NearFutureWidgets.swift */,
|
||||||
|
A979F5912D2700680094C0B3 /* AppIntent.swift */,
|
||||||
|
A979F5932D27006D0094C0B3 /* Assets.xcassets */,
|
||||||
|
A979F5952D27006D0094C0B3 /* Info.plist */,
|
||||||
);
|
);
|
||||||
path = NearFutureTests;
|
path = NearFutureWidgets;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
A920C2A42D24011B00E4F9B1 /* NearFutureUITests */ = {
|
A979F6032D270AF00094C0B3 /* Frameworks */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
A920C2A52D24011B00E4F9B1 /* NearFutureUITests.swift */,
|
A979F6042D270AF00094C0B3 /* WidgetKit.framework */,
|
||||||
A920C2A72D24011B00E4F9B1 /* NearFutureUITestsLaunchTests.swift */,
|
A979F6062D270AF00094C0B3 /* SwiftUI.framework */,
|
||||||
);
|
);
|
||||||
path = NearFutureUITests;
|
name = Frameworks;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
A979F6082D270AF00094C0B3 /* NearFutureWidgets */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
A9FC7EE92D28238A0020D75B /* NearFutureWidgets.swift */,
|
||||||
|
A979F6092D270AF00094C0B3 /* NearFutureWidgetsBundle.swift */,
|
||||||
|
A979F60B2D270AF00094C0B3 /* NearFutureWidgetsLiveActivity.swift */,
|
||||||
|
A979F60F2D270AF80094C0B3 /* Assets.xcassets */,
|
||||||
|
A979F6112D270AF90094C0B3 /* Info.plist */,
|
||||||
|
A9C05E412D2805D7007DC497 /* NearFutureWidgetsExtension.entitlements */,
|
||||||
|
);
|
||||||
|
path = NearFutureWidgets;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
/* End PBXGroup section */
|
/* End PBXGroup section */
|
||||||
@@ -150,10 +188,12 @@
|
|||||||
A920C2802D24011300E4F9B1 /* Sources */,
|
A920C2802D24011300E4F9B1 /* Sources */,
|
||||||
A920C2812D24011300E4F9B1 /* Frameworks */,
|
A920C2812D24011300E4F9B1 /* Frameworks */,
|
||||||
A920C2822D24011300E4F9B1 /* Resources */,
|
A920C2822D24011300E4F9B1 /* Resources */,
|
||||||
|
A979F59C2D27006D0094C0B3 /* Embed Foundation Extensions */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
dependencies = (
|
dependencies = (
|
||||||
|
A979F6132D270AF90094C0B3 /* PBXTargetDependency */,
|
||||||
);
|
);
|
||||||
name = NearFuture;
|
name = NearFuture;
|
||||||
packageProductDependencies = (
|
packageProductDependencies = (
|
||||||
@@ -163,41 +203,22 @@
|
|||||||
productReference = A920C2842D24011400E4F9B1 /* NearFuture.app */;
|
productReference = A920C2842D24011400E4F9B1 /* NearFuture.app */;
|
||||||
productType = "com.apple.product-type.application";
|
productType = "com.apple.product-type.application";
|
||||||
};
|
};
|
||||||
A920C2962D24011A00E4F9B1 /* NearFutureTests */ = {
|
A979F6012D270AF00094C0B3 /* NearFutureWidgetsExtension */ = {
|
||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = A920C2AE2D24011B00E4F9B1 /* Build configuration list for PBXNativeTarget "NearFutureTests" */;
|
buildConfigurationList = A979F6152D270AF90094C0B3 /* Build configuration list for PBXNativeTarget "NearFutureWidgetsExtension" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
A920C2932D24011A00E4F9B1 /* Sources */,
|
A979F5FE2D270AF00094C0B3 /* Sources */,
|
||||||
A920C2942D24011A00E4F9B1 /* Frameworks */,
|
A979F5FF2D270AF00094C0B3 /* Frameworks */,
|
||||||
A920C2952D24011A00E4F9B1 /* Resources */,
|
A979F6002D270AF00094C0B3 /* Resources */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
dependencies = (
|
dependencies = (
|
||||||
A920C2992D24011A00E4F9B1 /* PBXTargetDependency */,
|
|
||||||
);
|
);
|
||||||
name = NearFutureTests;
|
name = NearFutureWidgetsExtension;
|
||||||
productName = NearFutureTests;
|
productName = NearFutureWidgetsExtension;
|
||||||
productReference = A920C2972D24011A00E4F9B1 /* NearFutureTests.xctest */;
|
productReference = A979F6022D270AF00094C0B3 /* NearFutureWidgetsExtension.appex */;
|
||||||
productType = "com.apple.product-type.bundle.unit-test";
|
productType = "com.apple.product-type.app-extension";
|
||||||
};
|
|
||||||
A920C2A02D24011B00E4F9B1 /* NearFutureUITests */ = {
|
|
||||||
isa = PBXNativeTarget;
|
|
||||||
buildConfigurationList = A920C2B12D24011B00E4F9B1 /* Build configuration list for PBXNativeTarget "NearFutureUITests" */;
|
|
||||||
buildPhases = (
|
|
||||||
A920C29D2D24011B00E4F9B1 /* Sources */,
|
|
||||||
A920C29E2D24011B00E4F9B1 /* Frameworks */,
|
|
||||||
A920C29F2D24011B00E4F9B1 /* Resources */,
|
|
||||||
);
|
|
||||||
buildRules = (
|
|
||||||
);
|
|
||||||
dependencies = (
|
|
||||||
A920C2A32D24011B00E4F9B1 /* PBXTargetDependency */,
|
|
||||||
);
|
|
||||||
name = NearFutureUITests;
|
|
||||||
productName = NearFutureUITests;
|
|
||||||
productReference = A920C2A12D24011B00E4F9B1 /* NearFutureUITests.xctest */;
|
|
||||||
productType = "com.apple.product-type.bundle.ui-testing";
|
|
||||||
};
|
};
|
||||||
/* End PBXNativeTarget section */
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
@@ -212,13 +233,8 @@
|
|||||||
A920C2832D24011300E4F9B1 = {
|
A920C2832D24011300E4F9B1 = {
|
||||||
CreatedOnToolsVersion = 15.4;
|
CreatedOnToolsVersion = 15.4;
|
||||||
};
|
};
|
||||||
A920C2962D24011A00E4F9B1 = {
|
A979F6012D270AF00094C0B3 = {
|
||||||
CreatedOnToolsVersion = 15.4;
|
CreatedOnToolsVersion = 15.4;
|
||||||
TestTargetID = A920C2832D24011300E4F9B1;
|
|
||||||
};
|
|
||||||
A920C2A02D24011B00E4F9B1 = {
|
|
||||||
CreatedOnToolsVersion = 15.4;
|
|
||||||
TestTargetID = A920C2832D24011300E4F9B1;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -239,8 +255,7 @@
|
|||||||
projectRoot = "";
|
projectRoot = "";
|
||||||
targets = (
|
targets = (
|
||||||
A920C2832D24011300E4F9B1 /* NearFuture */,
|
A920C2832D24011300E4F9B1 /* NearFuture */,
|
||||||
A920C2962D24011A00E4F9B1 /* NearFutureTests */,
|
A979F6012D270AF00094C0B3 /* NearFutureWidgetsExtension */,
|
||||||
A920C2A02D24011B00E4F9B1 /* NearFutureUITests */,
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
/* End PBXProject section */
|
/* End PBXProject section */
|
||||||
@@ -255,17 +270,11 @@
|
|||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
A920C2952D24011A00E4F9B1 /* Resources */ = {
|
A979F6002D270AF00094C0B3 /* Resources */ = {
|
||||||
isa = PBXResourcesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
A920C29F2D24011B00E4F9B1 /* Resources */ = {
|
|
||||||
isa = PBXResourcesBuildPhase;
|
isa = PBXResourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
A979F6102D270AF90094C0B3 /* Assets.xcassets in Resources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -281,38 +290,28 @@
|
|||||||
A920C2B82D2401A300E4F9B1 /* SettingsView.swift in Sources */,
|
A920C2B82D2401A300E4F9B1 /* SettingsView.swift in Sources */,
|
||||||
A920C28C2D24011400E4F9B1 /* Item.swift in Sources */,
|
A920C28C2D24011400E4F9B1 /* Item.swift in Sources */,
|
||||||
A920C2882D24011400E4F9B1 /* NearFutureApp.swift in Sources */,
|
A920C2882D24011400E4F9B1 /* NearFutureApp.swift in Sources */,
|
||||||
|
A979F57F2D26B1300094C0B3 /* EditEventView.swift in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
A920C2932D24011A00E4F9B1 /* Sources */ = {
|
A979F5FE2D270AF00094C0B3 /* Sources */ = {
|
||||||
isa = PBXSourcesBuildPhase;
|
isa = PBXSourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
A920C29C2D24011A00E4F9B1 /* NearFutureTests.swift in Sources */,
|
A979F6182D2714310094C0B3 /* Item.swift in Sources */,
|
||||||
);
|
A979F60A2D270AF00094C0B3 /* NearFutureWidgetsBundle.swift in Sources */,
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
A9FC7EEA2D2823920020D75B /* NearFutureWidgets.swift in Sources */,
|
||||||
};
|
A979F60C2D270AF00094C0B3 /* NearFutureWidgetsLiveActivity.swift in Sources */,
|
||||||
A920C29D2D24011B00E4F9B1 /* Sources */ = {
|
|
||||||
isa = PBXSourcesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
A920C2A62D24011B00E4F9B1 /* NearFutureUITests.swift in Sources */,
|
|
||||||
A920C2A82D24011B00E4F9B1 /* NearFutureUITestsLaunchTests.swift in Sources */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
/* End PBXSourcesBuildPhase section */
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXTargetDependency section */
|
/* Begin PBXTargetDependency section */
|
||||||
A920C2992D24011A00E4F9B1 /* PBXTargetDependency */ = {
|
A979F6132D270AF90094C0B3 /* PBXTargetDependency */ = {
|
||||||
isa = PBXTargetDependency;
|
isa = PBXTargetDependency;
|
||||||
target = A920C2832D24011300E4F9B1 /* NearFuture */;
|
target = A979F6012D270AF00094C0B3 /* NearFutureWidgetsExtension */;
|
||||||
targetProxy = A920C2982D24011A00E4F9B1 /* PBXContainerItemProxy */;
|
targetProxy = A979F6122D270AF90094C0B3 /* PBXContainerItemProxy */;
|
||||||
};
|
|
||||||
A920C2A32D24011B00E4F9B1 /* PBXTargetDependency */ = {
|
|
||||||
isa = PBXTargetDependency;
|
|
||||||
target = A920C2832D24011300E4F9B1 /* NearFuture */;
|
|
||||||
targetProxy = A920C2A22D24011B00E4F9B1 /* PBXContainerItemProxy */;
|
|
||||||
};
|
};
|
||||||
/* End PBXTargetDependency section */
|
/* End PBXTargetDependency section */
|
||||||
|
|
||||||
@@ -434,16 +433,18 @@
|
|||||||
A920C2AC2D24011B00E4F9B1 /* Debug */ = {
|
A920C2AC2D24011B00E4F9B1 /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
|
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||||
CODE_SIGN_ENTITLEMENTS = NearFuture/NearFuture.entitlements;
|
CODE_SIGN_ENTITLEMENTS = NearFuture/NearFuture.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 11;
|
||||||
DEVELOPMENT_ASSET_PATHS = "\"NearFuture/Preview Content\"";
|
DEVELOPMENT_ASSET_PATHS = "\"NearFuture/Preview Content\"";
|
||||||
DEVELOPMENT_TEAM = P6PV2R9443;
|
DEVELOPMENT_TEAM = P6PV2R9443;
|
||||||
ENABLE_HARDENED_RUNTIME = YES;
|
ENABLE_HARDENED_RUNTIME = NO;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
INFOPLIST_KEY_CFBundleDisplayName = "Near Future";
|
||||||
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
|
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
|
||||||
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES;
|
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES;
|
||||||
"INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES;
|
"INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES;
|
||||||
@@ -454,11 +455,11 @@
|
|||||||
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault;
|
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault;
|
||||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
||||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 17.5;
|
IPHONEOS_DEPLOYMENT_TARGET = 15;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
|
||||||
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
|
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
|
||||||
MACOSX_DEPLOYMENT_TARGET = 14.0;
|
MACOSX_DEPLOYMENT_TARGET = 13;
|
||||||
MARKETING_VERSION = 1.0;
|
MARKETING_VERSION = 2.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = dev.neon443.NearFuture;
|
PRODUCT_BUNDLE_IDENTIFIER = dev.neon443.NearFuture;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SDKROOT = auto;
|
SDKROOT = auto;
|
||||||
@@ -472,16 +473,18 @@
|
|||||||
A920C2AD2D24011B00E4F9B1 /* Release */ = {
|
A920C2AD2D24011B00E4F9B1 /* Release */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
|
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||||
CODE_SIGN_ENTITLEMENTS = NearFuture/NearFuture.entitlements;
|
CODE_SIGN_ENTITLEMENTS = NearFuture/NearFuture.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 11;
|
||||||
DEVELOPMENT_ASSET_PATHS = "\"NearFuture/Preview Content\"";
|
DEVELOPMENT_ASSET_PATHS = "\"NearFuture/Preview Content\"";
|
||||||
DEVELOPMENT_TEAM = P6PV2R9443;
|
DEVELOPMENT_TEAM = P6PV2R9443;
|
||||||
ENABLE_HARDENED_RUNTIME = YES;
|
ENABLE_HARDENED_RUNTIME = NO;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
INFOPLIST_KEY_CFBundleDisplayName = "Near Future";
|
||||||
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
|
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
|
||||||
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES;
|
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES;
|
||||||
"INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES;
|
"INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES;
|
||||||
@@ -492,11 +495,11 @@
|
|||||||
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault;
|
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault;
|
||||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
||||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 17.5;
|
IPHONEOS_DEPLOYMENT_TARGET = 15;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
|
||||||
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
|
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
|
||||||
MACOSX_DEPLOYMENT_TARGET = 14.0;
|
MACOSX_DEPLOYMENT_TARGET = 13;
|
||||||
MARKETING_VERSION = 1.0;
|
MARKETING_VERSION = 2.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = dev.neon443.NearFuture;
|
PRODUCT_BUNDLE_IDENTIFIER = dev.neon443.NearFuture;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SDKROOT = auto;
|
SDKROOT = auto;
|
||||||
@@ -507,93 +510,64 @@
|
|||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
A920C2AF2D24011B00E4F9B1 /* Debug */ = {
|
A979F6162D270AF90094C0B3 /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
|
||||||
|
CODE_SIGN_ENTITLEMENTS = NearFutureWidgets/NearFutureWidgetsExtension.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 11;
|
||||||
DEVELOPMENT_TEAM = P6PV2R9443;
|
DEVELOPMENT_TEAM = P6PV2R9443;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 17.5;
|
INFOPLIST_FILE = NearFutureWidgets/Info.plist;
|
||||||
MACOSX_DEPLOYMENT_TARGET = 14.5;
|
INFOPLIST_KEY_CFBundleDisplayName = NearFutureWidgets;
|
||||||
MARKETING_VERSION = 1.0;
|
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = dev.neon443.NearFutureTests;
|
IPHONEOS_DEPLOYMENT_TARGET = 17;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
"@executable_path/../../Frameworks",
|
||||||
|
);
|
||||||
|
MARKETING_VERSION = 2.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = dev.neon443.NearFuture.NearFutureWidgets;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SDKROOT = auto;
|
SDKROOT = iphoneos;
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
|
SKIP_INSTALL = YES;
|
||||||
SWIFT_EMIT_LOC_STRINGS = NO;
|
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NearFuture.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/NearFuture";
|
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
A920C2B02D24011B00E4F9B1 /* Release */ = {
|
A979F6172D270AF90094C0B3 /* Release */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
|
||||||
|
CODE_SIGN_ENTITLEMENTS = NearFutureWidgets/NearFutureWidgetsExtension.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 11;
|
||||||
DEVELOPMENT_TEAM = P6PV2R9443;
|
DEVELOPMENT_TEAM = P6PV2R9443;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 17.5;
|
INFOPLIST_FILE = NearFutureWidgets/Info.plist;
|
||||||
MACOSX_DEPLOYMENT_TARGET = 14.5;
|
INFOPLIST_KEY_CFBundleDisplayName = NearFutureWidgets;
|
||||||
MARKETING_VERSION = 1.0;
|
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = dev.neon443.NearFutureTests;
|
IPHONEOS_DEPLOYMENT_TARGET = 17;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
"@executable_path/../../Frameworks",
|
||||||
|
);
|
||||||
|
MARKETING_VERSION = 2.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = dev.neon443.NearFuture.NearFutureWidgets;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SDKROOT = auto;
|
SDKROOT = iphoneos;
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
|
SKIP_INSTALL = YES;
|
||||||
SWIFT_EMIT_LOC_STRINGS = NO;
|
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NearFuture.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/NearFuture";
|
VALIDATE_PRODUCT = YES;
|
||||||
};
|
|
||||||
name = Release;
|
|
||||||
};
|
|
||||||
A920C2B22D24011B00E4F9B1 /* Debug */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
|
||||||
CODE_SIGN_STYLE = Automatic;
|
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
|
||||||
DEVELOPMENT_TEAM = P6PV2R9443;
|
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 17.5;
|
|
||||||
MACOSX_DEPLOYMENT_TARGET = 14.5;
|
|
||||||
MARKETING_VERSION = 1.0;
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = dev.neon443.NearFutureUITests;
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
||||||
SDKROOT = auto;
|
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
|
|
||||||
SWIFT_EMIT_LOC_STRINGS = NO;
|
|
||||||
SWIFT_VERSION = 5.0;
|
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
|
||||||
TEST_TARGET_NAME = NearFuture;
|
|
||||||
};
|
|
||||||
name = Debug;
|
|
||||||
};
|
|
||||||
A920C2B32D24011B00E4F9B1 /* Release */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
|
||||||
CODE_SIGN_STYLE = Automatic;
|
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
|
||||||
DEVELOPMENT_TEAM = P6PV2R9443;
|
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 17.5;
|
|
||||||
MACOSX_DEPLOYMENT_TARGET = 14.5;
|
|
||||||
MARKETING_VERSION = 1.0;
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = dev.neon443.NearFutureUITests;
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
||||||
SDKROOT = auto;
|
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
|
|
||||||
SWIFT_EMIT_LOC_STRINGS = NO;
|
|
||||||
SWIFT_VERSION = 5.0;
|
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
|
||||||
TEST_TARGET_NAME = NearFuture;
|
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
@@ -618,20 +592,11 @@
|
|||||||
defaultConfigurationIsVisible = 0;
|
defaultConfigurationIsVisible = 0;
|
||||||
defaultConfigurationName = Release;
|
defaultConfigurationName = Release;
|
||||||
};
|
};
|
||||||
A920C2AE2D24011B00E4F9B1 /* Build configuration list for PBXNativeTarget "NearFutureTests" */ = {
|
A979F6152D270AF90094C0B3 /* Build configuration list for PBXNativeTarget "NearFutureWidgetsExtension" */ = {
|
||||||
isa = XCConfigurationList;
|
isa = XCConfigurationList;
|
||||||
buildConfigurations = (
|
buildConfigurations = (
|
||||||
A920C2AF2D24011B00E4F9B1 /* Debug */,
|
A979F6162D270AF90094C0B3 /* Debug */,
|
||||||
A920C2B02D24011B00E4F9B1 /* Release */,
|
A979F6172D270AF90094C0B3 /* Release */,
|
||||||
);
|
|
||||||
defaultConfigurationIsVisible = 0;
|
|
||||||
defaultConfigurationName = Release;
|
|
||||||
};
|
|
||||||
A920C2B12D24011B00E4F9B1 /* Build configuration list for PBXNativeTarget "NearFutureUITests" */ = {
|
|
||||||
isa = XCConfigurationList;
|
|
||||||
buildConfigurations = (
|
|
||||||
A920C2B22D24011B00E4F9B1 /* Debug */,
|
|
||||||
A920C2B32D24011B00E4F9B1 /* Release */,
|
|
||||||
);
|
);
|
||||||
defaultConfigurationIsVisible = 0;
|
defaultConfigurationIsVisible = 0;
|
||||||
defaultConfigurationName = Release;
|
defaultConfigurationName = Release;
|
||||||
|
|||||||
@@ -10,19 +10,33 @@ import SFSymbolsPicker
|
|||||||
|
|
||||||
struct AddEventView: View {
|
struct AddEventView: View {
|
||||||
@ObservedObject var viewModel: EventViewModel
|
@ObservedObject var viewModel: EventViewModel
|
||||||
|
|
||||||
@Binding var eventName: String
|
@Binding var eventName: String
|
||||||
@Binding var eventSymbol: String
|
@Binding var eventSymbol: String
|
||||||
@Binding var eventColor: Color
|
@Binding var eventColor: Color
|
||||||
@Binding var eventDescription: String
|
@Binding var eventDescription: String
|
||||||
@Binding var eventDate: Date
|
@Binding var eventDate: Date
|
||||||
@Binding var eventRecurrence: Event.RecurrenceType
|
@Binding var eventRecurrence: Event.RecurrenceType
|
||||||
@Binding var isPresented: Bool
|
|
||||||
|
@State var adding : Bool
|
||||||
@State var isSymbolPickerPresented = false
|
@State var isSymbolPickerPresented = false
|
||||||
|
|
||||||
|
@FocusState private var focusedField: Field?
|
||||||
|
private enum Field {
|
||||||
|
case Name, Description
|
||||||
|
}
|
||||||
|
|
||||||
|
@Environment(\.dismiss) var dismiss
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationStack {
|
NavigationView {
|
||||||
Form {
|
Form {
|
||||||
Section(header: Text("Event Details").font(.headline).foregroundColor(.blue)) {
|
Section(
|
||||||
|
header:
|
||||||
|
Text("Event Details")
|
||||||
|
.font(.headline)
|
||||||
|
.foregroundColor(.accentColor)
|
||||||
|
) {
|
||||||
// name & symbol
|
// name & symbol
|
||||||
HStack(spacing: 5) {
|
HStack(spacing: 5) {
|
||||||
Button() {
|
Button() {
|
||||||
@@ -32,6 +46,7 @@ struct AddEventView: View {
|
|||||||
.resizable()
|
.resizable()
|
||||||
.scaledToFit()
|
.scaledToFit()
|
||||||
.frame(width: 25, height: 25)
|
.frame(width: 25, height: 25)
|
||||||
|
.foregroundStyle(eventColor)
|
||||||
}
|
}
|
||||||
// .frame(width: 30)
|
// .frame(width: 30)
|
||||||
.buttonStyle(.bordered)
|
.buttonStyle(.bordered)
|
||||||
@@ -50,6 +65,10 @@ struct AddEventView: View {
|
|||||||
.textFieldStyle(RoundedBorderTextFieldStyle())
|
.textFieldStyle(RoundedBorderTextFieldStyle())
|
||||||
.padding(.trailing, eventName.isEmpty ? 0 : 30)
|
.padding(.trailing, eventName.isEmpty ? 0 : 30)
|
||||||
.animation(.spring, value: eventName)
|
.animation(.spring, value: eventName)
|
||||||
|
.focused($focusedField, equals: Field.Name)
|
||||||
|
.onSubmit {
|
||||||
|
focusedField = .Description
|
||||||
|
}
|
||||||
MagicClearButton(text: $eventName)
|
MagicClearButton(text: $eventName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -60,12 +79,16 @@ struct AddEventView: View {
|
|||||||
.textFieldStyle(RoundedBorderTextFieldStyle())
|
.textFieldStyle(RoundedBorderTextFieldStyle())
|
||||||
.padding(.trailing, eventDescription.isEmpty ? 0 : 30)
|
.padding(.trailing, eventDescription.isEmpty ? 0 : 30)
|
||||||
.animation(.spring, value: eventDescription)
|
.animation(.spring, value: eventDescription)
|
||||||
|
.focused($focusedField, equals: Field.Description)
|
||||||
|
.onSubmit {
|
||||||
|
focusedField = nil
|
||||||
|
}
|
||||||
MagicClearButton(text: $eventDescription)
|
MagicClearButton(text: $eventDescription)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// date picker
|
// date picker
|
||||||
DatePicker("Event Date", selection: $eventDate, in: Date()..., displayedComponents: .date)
|
DatePicker("Event Date", selection: $eventDate, displayedComponents: .date)
|
||||||
.datePickerStyle(WheelDatePickerStyle())
|
.datePickerStyle(WheelDatePickerStyle())
|
||||||
|
|
||||||
// re-ocurrence Picker
|
// re-ocurrence Picker
|
||||||
@@ -83,7 +106,8 @@ struct AddEventView: View {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// save button
|
// save button only show iff adding new event
|
||||||
|
if adding {
|
||||||
Button {
|
Button {
|
||||||
viewModel.addEvent(
|
viewModel.addEvent(
|
||||||
name: eventName,
|
name: eventName,
|
||||||
@@ -93,6 +117,38 @@ struct AddEventView: View {
|
|||||||
date: eventDate,
|
date: eventDate,
|
||||||
recurrence: eventRecurrence
|
recurrence: eventRecurrence
|
||||||
)
|
)
|
||||||
|
resetAddEventView()
|
||||||
|
} label: {
|
||||||
|
Text("Save Event")
|
||||||
|
.font(.headline)
|
||||||
|
.cornerRadius(10)
|
||||||
|
.shadow(radius: 10)
|
||||||
|
.buttonStyle(BorderedProminentButtonStyle())
|
||||||
|
}
|
||||||
|
.disabled(eventName.isEmpty)
|
||||||
|
if eventName.isEmpty {
|
||||||
|
Text("Give your event a name.")
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.navigationTitle("\(adding ? "Add Event" : "")")
|
||||||
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
|
.toolbar {
|
||||||
|
ToolbarItem(placement: .topBarTrailing) {
|
||||||
|
if adding {
|
||||||
|
Button() {
|
||||||
|
dismiss()
|
||||||
|
} label: {
|
||||||
|
Image(systemName: "xmark.circle.fill")
|
||||||
|
.symbolRenderingMode(.hierarchical)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func resetAddEventView() {
|
||||||
//reset addeventView
|
//reset addeventView
|
||||||
eventName = ""
|
eventName = ""
|
||||||
eventSymbol = "star"
|
eventSymbol = "star"
|
||||||
@@ -108,39 +164,9 @@ struct AddEventView: View {
|
|||||||
eventDescription = ""
|
eventDescription = ""
|
||||||
eventDate = Date()
|
eventDate = Date()
|
||||||
eventRecurrence = .none
|
eventRecurrence = .none
|
||||||
isPresented = false
|
dismiss()
|
||||||
} label: {
|
|
||||||
Text("Save Event")
|
|
||||||
.font(.headline)
|
|
||||||
.cornerRadius(10)
|
|
||||||
.shadow(radius: 10)
|
|
||||||
.buttonStyle(BorderedProminentButtonStyle())
|
|
||||||
}
|
|
||||||
.disabled(eventName.isEmpty || eventDescription.isEmpty)
|
|
||||||
if eventName.isEmpty && eventDescription.isEmpty {
|
|
||||||
Text("Give your event a name and description.")
|
|
||||||
} else if eventName.isEmpty {
|
|
||||||
Text("Give your event a name.")
|
|
||||||
} else if eventDescription.isEmpty {
|
|
||||||
Text("Give your event a description.")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navigationTitle("Add Event")
|
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
|
||||||
.toolbar {
|
|
||||||
ToolbarItem(placement: .topBarTrailing) {
|
|
||||||
Button() {
|
|
||||||
isPresented.toggle()
|
|
||||||
} label: {
|
|
||||||
Image(systemName: "xmark.circle.fill")
|
|
||||||
.symbolRenderingMode(.hierarchical)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct MagicClearButton: View {
|
struct MagicClearButton: View {
|
||||||
@Binding var text: String
|
@Binding var text: String
|
||||||
var body: some View {
|
var body: some View {
|
||||||
@@ -176,7 +202,8 @@ struct AddEvent_Preview: PreviewProvider {
|
|||||||
eventDescription: .constant("A very special day"),
|
eventDescription: .constant("A very special day"),
|
||||||
eventDate: $date,
|
eventDate: $date,
|
||||||
eventRecurrence: .constant(.monthly),
|
eventRecurrence: .constant(.monthly),
|
||||||
isPresented: .constant(true)
|
adding: true
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
{
|
{
|
||||||
"colors" : [
|
"colors" : [
|
||||||
{
|
{
|
||||||
|
"color" : {
|
||||||
|
"color-space" : "extended-srgb",
|
||||||
|
"components" : {
|
||||||
|
"alpha" : "1.000",
|
||||||
|
"blue" : "0.000",
|
||||||
|
"green" : "0.375",
|
||||||
|
"red" : "1.000"
|
||||||
|
}
|
||||||
|
},
|
||||||
"idiom" : "universal"
|
"idiom" : "universal"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"images" : [
|
"images" : [
|
||||||
{
|
{
|
||||||
|
"filename" : "telescope-pointed-at-the-milky-way-galaxy-royalty-free-image-93204189-1533148569-2899733190.jpg",
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"platform" : "ios",
|
"platform" : "ios",
|
||||||
"size" : "1024x1024"
|
"size" : "1024x1024"
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 218 KiB |
@@ -94,6 +94,7 @@ struct ContentView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Environment(\.colorScheme) var appearance
|
@Environment(\.colorScheme) var appearance
|
||||||
private var backgroundGradient: LinearGradient {
|
private var backgroundGradient: LinearGradient {
|
||||||
switch appearance {
|
switch appearance {
|
||||||
@@ -119,6 +120,10 @@ struct ContentView: View {
|
|||||||
}
|
}
|
||||||
@State var showSettings: Bool = false
|
@State var showSettings: Bool = false
|
||||||
|
|
||||||
|
@FocusState private var focusedField: Field?
|
||||||
|
private enum Field {
|
||||||
|
case Search
|
||||||
|
}
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationView {
|
NavigationView {
|
||||||
ZStack {
|
ZStack {
|
||||||
@@ -133,24 +138,39 @@ struct ContentView: View {
|
|||||||
.padding(.trailing, searchInput.isEmpty ? 0 : 30)
|
.padding(.trailing, searchInput.isEmpty ? 0 : 30)
|
||||||
.animation(.spring, value: searchInput)
|
.animation(.spring, value: searchInput)
|
||||||
.textFieldStyle(RoundedBorderTextFieldStyle())
|
.textFieldStyle(RoundedBorderTextFieldStyle())
|
||||||
|
.focused($focusedField, equals: Field.Search)
|
||||||
|
.onSubmit {
|
||||||
|
focusedField = nil
|
||||||
|
}
|
||||||
MagicClearButton(text: $searchInput)
|
MagicClearButton(text: $searchInput)
|
||||||
}
|
}
|
||||||
.padding(.horizontal)
|
.padding(.horizontal)
|
||||||
List {
|
List {
|
||||||
ForEach(filteredEvents) { event in
|
ForEach(filteredEvents) { event in
|
||||||
var eventBackgroundGradient: LinearGradient {
|
EventListView(viewModel: viewModel, event: event)
|
||||||
return LinearGradient(
|
|
||||||
colors: [
|
|
||||||
event.color.color,
|
|
||||||
Color.black
|
|
||||||
],
|
|
||||||
startPoint: .leading,
|
|
||||||
endPoint: .trailing
|
|
||||||
)
|
|
||||||
}
|
|
||||||
EventListView(event: event)
|
|
||||||
}
|
}
|
||||||
.onDelete(perform: viewModel.removeEvent)
|
.onDelete(perform: viewModel.removeEvent)
|
||||||
|
if !searchInput.isEmpty {
|
||||||
|
HStack {
|
||||||
|
Image(systemName: "questionmark.square.dashed")
|
||||||
|
.resizable()
|
||||||
|
.scaledToFit()
|
||||||
|
.frame(width: 30, height: 30)
|
||||||
|
.padding(.trailing)
|
||||||
|
Text("Can't find what you're looking for?")
|
||||||
|
}
|
||||||
|
Text("Tip: The Search bar searches event names and descriptions")
|
||||||
|
Button() {
|
||||||
|
searchInput = ""
|
||||||
|
focusedField = nil
|
||||||
|
} label: {
|
||||||
|
HStack {
|
||||||
|
Image(systemName: "xmark")
|
||||||
|
Text("Clear Filters")
|
||||||
|
}
|
||||||
|
.foregroundStyle(Color.accentColor)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navigationTitle("Near Future")
|
.navigationTitle("Near Future")
|
||||||
@@ -164,14 +184,13 @@ struct ContentView: View {
|
|||||||
eventDescription: $eventDescription,
|
eventDescription: $eventDescription,
|
||||||
eventDate: $eventDate,
|
eventDate: $eventDate,
|
||||||
eventRecurrence: $eventRecurrence,
|
eventRecurrence: $eventRecurrence,
|
||||||
isPresented: $showingAddEventView
|
adding: true //adding event
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
.sheet(
|
.sheet(
|
||||||
isPresented: $showSettings) {
|
isPresented: $showSettings) {
|
||||||
SettingsView(
|
SettingsView(
|
||||||
viewModel: viewModel,
|
viewModel: viewModel
|
||||||
showSettings: $showSettings
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
.toolbar {
|
.toolbar {
|
||||||
@@ -193,52 +212,61 @@ struct ContentView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct EventListView: View {
|
struct EventListView: View {
|
||||||
|
@StateObject var viewModel: EventViewModel
|
||||||
@State var event: Event
|
@State var event: Event
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
// var testColor = Color.red
|
NavigationLink() {
|
||||||
// var codableColor = ColorCodable(testColor)
|
EditEventView(
|
||||||
// Text("\(codableColor.red), \(codableColor.green), \(codableColor.blue), \(codableColor.alpha)")
|
viewModel: viewModel,
|
||||||
ZStack {
|
event: $event
|
||||||
|
)
|
||||||
|
} label: {
|
||||||
HStack {
|
HStack {
|
||||||
RoundedRectangle(cornerRadius: 5)
|
RoundedRectangle(cornerRadius: 5)
|
||||||
.frame(width: 5)
|
.frame(width: 5)
|
||||||
.foregroundStyle(event.color.color)
|
.foregroundStyle(event.color.color)
|
||||||
.padding(.leading, -5)
|
.padding(.leading, -10)
|
||||||
|
.padding(.vertical, 5)
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
HStack {
|
HStack {
|
||||||
Text("\(Image(systemName: event.symbol)) \(event.name)")
|
Image(systemName: event.symbol)
|
||||||
|
.resizable()
|
||||||
|
.scaledToFit()
|
||||||
|
.frame(width: 20, height: 20)
|
||||||
|
.foregroundStyle(event.color.color)
|
||||||
|
Text("\(event.name)")
|
||||||
.font(.headline)
|
.font(.headline)
|
||||||
}
|
}
|
||||||
|
if !event.description.isEmpty {
|
||||||
Text(event.description)
|
Text(event.description)
|
||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
.foregroundColor(.gray)
|
.foregroundColor(.gray)
|
||||||
if event.recurrence != .none {
|
|
||||||
Text("Recurring: \(event.recurrence.rawValue.capitalized)")
|
|
||||||
.font(.subheadline)
|
|
||||||
.foregroundColor(.blue)
|
|
||||||
}
|
}
|
||||||
Text(event.date.formatted(date: .long, time: .omitted))
|
Text(event.date.formatted(date: .long, time: .omitted))
|
||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
.foregroundColor(.blue)
|
.foregroundColor(event.color.color)
|
||||||
|
if event.recurrence != .none {
|
||||||
|
Text("Recurring: \(event.recurrence.rawValue.capitalized)")
|
||||||
|
.font(.subheadline)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
Text("\(daysUntilEvent(event.date))")
|
Text("\(daysUntilEvent(event.date, short: false))")
|
||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
.foregroundColor(.gray)
|
.foregroundColor(event.color.color)
|
||||||
}
|
|
||||||
.padding(.vertical, 8)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
ContentView()
|
ContentView()
|
||||||
}
|
}
|
||||||
|
|||||||
89
NearFuture/EditEventView.swift
Normal file
89
NearFuture/EditEventView.swift
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
//
|
||||||
|
// EditEventView.swift
|
||||||
|
// NearFuture
|
||||||
|
//
|
||||||
|
// Created by Nihaal Sharma on 02/01/2025.
|
||||||
|
//
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct EditEventView: View {
|
||||||
|
@Environment(\.dismiss) var dismiss
|
||||||
|
@ObservedObject var viewModel: EventViewModel
|
||||||
|
@Binding var event: Event
|
||||||
|
|
||||||
|
@State private var eventName: String
|
||||||
|
@State private var eventSymbol: String
|
||||||
|
@State private var eventColor: Color
|
||||||
|
@State private var eventDescription: String
|
||||||
|
@State private var eventDate: Date
|
||||||
|
@State private var eventRecurrence: Event.RecurrenceType
|
||||||
|
|
||||||
|
init(viewModel: EventViewModel, event: Binding<Event>) {
|
||||||
|
self.viewModel = viewModel
|
||||||
|
_event = event
|
||||||
|
_eventName = State(initialValue: event.wrappedValue.name)
|
||||||
|
_eventSymbol = State(initialValue: event.wrappedValue.symbol)
|
||||||
|
_eventColor = State(initialValue: event.wrappedValue.color.color)
|
||||||
|
_eventDescription = State(initialValue: event.wrappedValue.description)
|
||||||
|
_eventDate = State(initialValue: event.wrappedValue.date)
|
||||||
|
_eventRecurrence = State(initialValue: event.wrappedValue.recurrence)
|
||||||
|
}
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
// NavigationView {
|
||||||
|
AddEventView(
|
||||||
|
viewModel: viewModel,
|
||||||
|
eventName: $eventName,
|
||||||
|
eventSymbol: $eventSymbol,
|
||||||
|
eventColor: $eventColor,
|
||||||
|
eventDescription: $eventDescription,
|
||||||
|
eventDate: $eventDate,
|
||||||
|
eventRecurrence: $eventRecurrence,
|
||||||
|
adding: false //bc we editing existing event
|
||||||
|
)
|
||||||
|
.navigationTitle("Edit Event")
|
||||||
|
.toolbar {
|
||||||
|
ToolbarItem(placement: .topBarTrailing) {
|
||||||
|
Button() {
|
||||||
|
event.name = eventName
|
||||||
|
event.symbol = eventSymbol
|
||||||
|
event.color = ColorCodable(eventColor)
|
||||||
|
event.description = eventDescription
|
||||||
|
event.date = eventDate
|
||||||
|
event.recurrence = eventRecurrence
|
||||||
|
|
||||||
|
//if there is an event in vM.events with the id of the event we r editing,
|
||||||
|
//firstindex - loops through the arr and finds first element where that events id matches editing event's id
|
||||||
|
if let index = viewModel.events.firstIndex(where: { xEvent in
|
||||||
|
xEvent.id == event.id
|
||||||
|
}) {
|
||||||
|
viewModel.events[index] = event
|
||||||
|
}
|
||||||
|
viewModel.saveEvents()
|
||||||
|
|
||||||
|
dismiss()
|
||||||
|
} label: {
|
||||||
|
Text("Done")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Preview {
|
||||||
|
EditEventView(
|
||||||
|
viewModel: EventViewModel(),
|
||||||
|
event: .constant(
|
||||||
|
Event(
|
||||||
|
name: "Birthday",
|
||||||
|
symbol: "gear",
|
||||||
|
color: ColorCodable(.red),
|
||||||
|
description: "an event",
|
||||||
|
date: Date(),
|
||||||
|
recurrence: .yearly
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -8,15 +8,16 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import SwiftData
|
import SwiftData
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
import WidgetKit
|
||||||
|
|
||||||
@Model
|
//@Model
|
||||||
final class Item {
|
//final class Item {
|
||||||
var timestamp: Date
|
// var timestamp: Date
|
||||||
|
//
|
||||||
init(timestamp: Date) {
|
// init(timestamp: Date) {
|
||||||
self.timestamp = timestamp
|
// self.timestamp = timestamp
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
struct Event: Identifiable, Codable {
|
struct Event: Identifiable, Codable {
|
||||||
var id = UUID()
|
var id = UUID()
|
||||||
@@ -54,7 +55,6 @@ struct ColorCodable: Codable {
|
|||||||
self.green = Double(g)
|
self.green = Double(g)
|
||||||
self.blue = Double(b)
|
self.blue = Double(b)
|
||||||
self.alpha = Double(a)
|
self.alpha = Double(a)
|
||||||
|
|
||||||
}
|
}
|
||||||
init(red: Double, green: Double, blue: Double, alpha: Double = 1.0) {
|
init(red: Double, green: Double, blue: Double, alpha: Double = 1.0) {
|
||||||
self.red = red
|
self.red = red
|
||||||
@@ -64,31 +64,48 @@ struct ColorCodable: Codable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func daysUntilEvent(_ eventDate: Date) -> String {
|
func daysUntilEvent(_ eventDate: Date, short: Bool) -> String {
|
||||||
let calendar = Calendar.current
|
let calendar = Calendar.current
|
||||||
let currentDate = Date()
|
let currentDate = Date()
|
||||||
let components = calendar.dateComponents([.day], from: currentDate, to: eventDate)
|
let components = calendar.dateComponents([.day], from: currentDate, to: eventDate)
|
||||||
guard let days = components.day else { return "N/A" }
|
guard let days = components.day else { return "N/A" }
|
||||||
guard days >= 0 else {
|
guard days >= 0 else {
|
||||||
return "\(days) days ago"
|
if short {
|
||||||
|
return "\(days)d"
|
||||||
|
} else {
|
||||||
|
return "\(-days) day\(-days == 1 ? "" : "s") ago"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
guard days != 0 else {
|
guard days != 0 else {
|
||||||
return "Today"
|
return "Today"
|
||||||
}
|
}
|
||||||
return "\(days) days"
|
if short {
|
||||||
|
return "\(days)d"
|
||||||
|
} else {
|
||||||
|
return "\(days) day\(days == 1 ? "" : "s")"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class EventViewModel: ObservableObject {
|
class EventViewModel: ObservableObject {
|
||||||
@Published var events: [Event] = []
|
@Published var events: [Event] = []
|
||||||
@Published var icloudData: [Event] = []
|
@Published var icloudData: [Event] = []
|
||||||
|
|
||||||
|
@Published var lastSync: Date? = nil
|
||||||
|
@Published var icloudEventCount: Int = 0
|
||||||
|
@Published var localEventCount: Int = 0
|
||||||
|
@Published var syncStatus: String = "Not Synced"
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
loadEvents()
|
loadEvents()
|
||||||
}
|
}
|
||||||
|
|
||||||
//icloud
|
//appgroup or regular userdefaults
|
||||||
|
let appGroupUserDefaults = UserDefaults(suiteName: "group.com.neon443.NearFuture") ?? UserDefaults.standard
|
||||||
|
|
||||||
|
//icloud store
|
||||||
let icloudStore = NSUbiquitousKeyValueStore.default
|
let icloudStore = NSUbiquitousKeyValueStore.default
|
||||||
|
|
||||||
|
// load from icloud or local
|
||||||
func loadEvents() {
|
func loadEvents() {
|
||||||
//load icloud 1st
|
//load icloud 1st
|
||||||
if let icData = icloudStore.data(forKey: "events") {
|
if let icData = icloudStore.data(forKey: "events") {
|
||||||
@@ -99,30 +116,41 @@ class EventViewModel: ObservableObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if events.isEmpty, let savedData = UserDefaults.standard.data(forKey: "events") {
|
if events.isEmpty, let savedData = appGroupUserDefaults.data(forKey: "events") {
|
||||||
let decoder = JSONDecoder()
|
let decoder = JSONDecoder()
|
||||||
if let decodedEvents = try? decoder.decode([Event].self, from: savedData) {
|
if let decodedEvents = try? decoder.decode([Event].self, from: savedData) {
|
||||||
self.events = decodedEvents
|
self.events = decodedEvents
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
updateSyncStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// save to local and icloud
|
||||||
func saveEvents() {
|
func saveEvents() {
|
||||||
let encoder = JSONEncoder()
|
let encoder = JSONEncoder()
|
||||||
if let encoded = try? encoder.encode(events) {
|
if let encoded = try? encoder.encode(events) {
|
||||||
UserDefaults.standard.set(encoded, forKey: "events")
|
appGroupUserDefaults.set(encoded, forKey: "events")
|
||||||
|
|
||||||
// do {
|
//sync
|
||||||
icloudStore.set(encoded, forKey: "events")
|
icloudStore.set(encoded, forKey: "events")
|
||||||
icloudStore.synchronize()
|
icloudStore.synchronize()
|
||||||
// } catch {
|
|
||||||
// print("Error saving to iCloud: \(error)")
|
|
||||||
// }
|
|
||||||
|
|
||||||
if icloudStore.data(forKey: "events") != nil {
|
updateSyncStatus()
|
||||||
print(icloudStore.dictionaryRepresentation)
|
loadEvents()
|
||||||
|
WidgetCenter.shared.reloadAllTimelines()//reload all widgets when saving events
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func updateSyncStatus() {
|
||||||
|
lastSync = Date()
|
||||||
|
icloudEventCount = icloudData.count
|
||||||
|
localEventCount = events.count
|
||||||
|
|
||||||
|
if icloudEventCount == localEventCount {
|
||||||
|
syncStatus = "Successful"
|
||||||
|
} else {
|
||||||
|
syncStatus = "Pending"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func addEvent(
|
func addEvent(
|
||||||
@@ -150,28 +178,83 @@ class EventViewModel: ObservableObject {
|
|||||||
saveEvents() //sync local and icl
|
saveEvents() //sync local and icl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func hasUbiquitousKeyValueStore() -> Bool {
|
||||||
|
let icloud = NSUbiquitousKeyValueStore.default
|
||||||
|
|
||||||
|
let key = "com.neon443.NearFuture.testkey"
|
||||||
|
let value = "testValue"
|
||||||
|
|
||||||
|
icloud.set(value, forKey: key)
|
||||||
|
icloud.synchronize()
|
||||||
|
|
||||||
|
if let retrievedVal = icloud.string(forKey: key) {
|
||||||
|
print("has UbiquitousKeyValueStore: retrieved \(retrievedVal)")
|
||||||
|
icloud.removeObject(forKey: key)
|
||||||
|
icloud.synchronize()
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
print("!has UbiquitousKeyValueStore")
|
||||||
|
icloud.removeObject(forKey: key)
|
||||||
|
icloud.synchronize()
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func sync() {
|
||||||
|
NSUbiquitousKeyValueStore.default.synchronize()
|
||||||
|
loadEvents()
|
||||||
|
}
|
||||||
|
|
||||||
|
func replaceLocalWithiCloudData() {
|
||||||
|
icloudStore.synchronize()
|
||||||
|
self.events = self.icloudData
|
||||||
|
saveEvents()
|
||||||
|
}
|
||||||
|
|
||||||
|
func replaceiCloudWithLocalData() {
|
||||||
|
icloudStore.synchronize()
|
||||||
|
self.icloudData = self.events
|
||||||
|
saveEvents()
|
||||||
|
}
|
||||||
|
|
||||||
//MARK: Danger Zone
|
//MARK: Danger Zone
|
||||||
func dangerClearLocalData() {
|
func dangerClearLocalData() {
|
||||||
UserDefaults.standard.removeObject(forKey: "events")
|
UserDefaults.standard.removeObject(forKey: "events")
|
||||||
|
appGroupUserDefaults.removeObject(forKey: "events")
|
||||||
|
events.removeAll()
|
||||||
|
updateSyncStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
func dangerCleariCloudData() {
|
func dangerCleariCloudData() {
|
||||||
let icloud = NSUbiquitousKeyValueStore()
|
icloudStore.removeObject(forKey: "events")
|
||||||
icloud.removeObject(forKey: "events")
|
icloudStore.synchronize()
|
||||||
icloud.synchronize()
|
icloudData.removeAll()
|
||||||
|
updateSyncStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
func dangerResetLocalData() {
|
func dangerResetLocalData() {
|
||||||
let userDFDict = UserDefaults.standard.dictionaryRepresentation()
|
let userDFDict = UserDefaults.standard.dictionaryRepresentation()
|
||||||
for key in userDFDict.keys {
|
for key in userDFDict.keys {
|
||||||
UserDefaults.standard.removeObject(forKey: key)
|
UserDefaults.standard.removeObject(forKey: key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let appGUSDDict = appGroupUserDefaults.dictionaryRepresentation()
|
||||||
|
for key in appGUSDDict.keys {
|
||||||
|
appGroupUserDefaults.removeObject(forKey: key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
events.removeAll()
|
||||||
|
updateSyncStatus()
|
||||||
|
}
|
||||||
|
|
||||||
func dangerResetiCloud() {
|
func dangerResetiCloud() {
|
||||||
let icloud = NSUbiquitousKeyValueStore()
|
let icloudDict = icloudStore.dictionaryRepresentation
|
||||||
let icloudDict = NSUbiquitousKeyValueStore().dictionaryRepresentation
|
|
||||||
for key in icloudDict.keys {
|
for key in icloudDict.keys {
|
||||||
icloud.removeObject(forKey: key)
|
icloudStore.removeObject(forKey: key)
|
||||||
}
|
}
|
||||||
icloud.synchronize()
|
icloudStore.synchronize()
|
||||||
|
icloudData.removeAll()
|
||||||
|
updateSyncStatus()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
<array/>
|
<array/>
|
||||||
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
|
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
|
||||||
<string>$(TeamIdentifierPrefix)$(CFBundleIdentifier)</string>
|
<string>$(TeamIdentifierPrefix)$(CFBundleIdentifier)</string>
|
||||||
<key>com.apple.security.app-sandbox</key>
|
<key>com.apple.security.application-groups</key>
|
||||||
<true/>
|
<array>
|
||||||
<key>com.apple.security.files.user-selected.read-only</key>
|
<string>group.com.neon443.NearFuture</string>
|
||||||
<true/>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -10,23 +10,23 @@ import SwiftData
|
|||||||
|
|
||||||
@main
|
@main
|
||||||
struct NearFutureApp: App {
|
struct NearFutureApp: App {
|
||||||
var sharedModelContainer: ModelContainer = {
|
// var sharedModelContainer: ModelContainer = {
|
||||||
let schema = Schema([
|
// let schema = Schema([
|
||||||
Item.self,
|
// Item.self,
|
||||||
])
|
// ])
|
||||||
let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false)
|
// let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false)
|
||||||
|
//
|
||||||
do {
|
// do {
|
||||||
return try ModelContainer(for: schema, configurations: [modelConfiguration])
|
// return try ModelContainer(for: schema, configurations: [modelConfiguration])
|
||||||
} catch {
|
// } catch {
|
||||||
fatalError("Could not create ModelContainer: \(error)")
|
// fatalError("Could not create ModelContainer: \(error)")
|
||||||
}
|
// }
|
||||||
}()
|
// }()
|
||||||
|
|
||||||
var body: some Scene {
|
var body: some Scene {
|
||||||
WindowGroup {
|
WindowGroup {
|
||||||
ContentView()
|
ContentView()
|
||||||
}
|
}
|
||||||
.modelContainer(sharedModelContainer)
|
// .modelContainer(sharedModelContainer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
18
NearFuture/Preview Content/NearFutureWidgets/AppIntent.swift
Normal file
18
NearFuture/Preview Content/NearFutureWidgets/AppIntent.swift
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
//
|
||||||
|
// AppIntent.swift
|
||||||
|
// NearFutureWidgets
|
||||||
|
//
|
||||||
|
// Created by Nihaal Sharma on 02/01/2025.
|
||||||
|
//
|
||||||
|
|
||||||
|
import WidgetKit
|
||||||
|
import AppIntents
|
||||||
|
|
||||||
|
struct ConfigurationAppIntent: WidgetConfigurationIntent {
|
||||||
|
static var title: LocalizedStringResource = "Configuration"
|
||||||
|
static var description = IntentDescription("This is an example widget.")
|
||||||
|
|
||||||
|
// An example configurable parameter.
|
||||||
|
@Parameter(title: "Favorite Emoji", default: "😃")
|
||||||
|
var favoriteEmoji: String
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"colors" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"platform" : "ios",
|
||||||
|
"size" : "1024x1024"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"colors" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
11
NearFuture/Preview Content/NearFutureWidgets/Info.plist
Normal file
11
NearFuture/Preview Content/NearFutureWidgets/Info.plist
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>NSExtension</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSExtensionPointIdentifier</key>
|
||||||
|
<string>com.apple.widgetkit-extension</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
//
|
||||||
|
// NearFutureWidgets.swift
|
||||||
|
// NearFutureWidgets
|
||||||
|
//
|
||||||
|
// Created by Nihaal Sharma on 02/01/2025.
|
||||||
|
//
|
||||||
|
|
||||||
|
import WidgetKit
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct Provider: AppIntentTimelineProvider {
|
||||||
|
func placeholder(in context: Context) -> SimpleEntry {
|
||||||
|
SimpleEntry(date: Date(), configuration: ConfigurationAppIntent())
|
||||||
|
}
|
||||||
|
|
||||||
|
func snapshot(for configuration: ConfigurationAppIntent, in context: Context) async -> SimpleEntry {
|
||||||
|
SimpleEntry(date: Date(), configuration: configuration)
|
||||||
|
}
|
||||||
|
|
||||||
|
func timeline(for configuration: ConfigurationAppIntent, in context: Context) async -> Timeline<SimpleEntry> {
|
||||||
|
var entries: [SimpleEntry] = []
|
||||||
|
|
||||||
|
// Generate a timeline consisting of five entries an hour apart, starting from the current date.
|
||||||
|
let currentDate = Date()
|
||||||
|
for hourOffset in 0 ..< 5 {
|
||||||
|
let entryDate = Calendar.current.date(byAdding: .hour, value: hourOffset, to: currentDate)!
|
||||||
|
let entry = SimpleEntry(date: entryDate, configuration: configuration)
|
||||||
|
entries.append(entry)
|
||||||
|
}
|
||||||
|
|
||||||
|
return Timeline(entries: entries, policy: .atEnd)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SimpleEntry: TimelineEntry {
|
||||||
|
let date: Date
|
||||||
|
let configuration: ConfigurationAppIntent
|
||||||
|
}
|
||||||
|
|
||||||
|
struct NearFutureWidgetsEntryView : View {
|
||||||
|
var entry: Provider.Entry
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
VStack {
|
||||||
|
Text("Time:")
|
||||||
|
Text(entry.date, style: .time)
|
||||||
|
|
||||||
|
Text("Favorite Emoji:")
|
||||||
|
Text(entry.configuration.favoriteEmoji)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct NearFutureWidgets: Widget {
|
||||||
|
let kind: String = "NearFutureWidgets"
|
||||||
|
|
||||||
|
var body: some WidgetConfiguration {
|
||||||
|
AppIntentConfiguration(kind: kind, intent: ConfigurationAppIntent.self, provider: Provider()) { entry in
|
||||||
|
NearFutureWidgetsEntryView(entry: entry)
|
||||||
|
.containerBackground(.fill.tertiary, for: .widget)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension ConfigurationAppIntent {
|
||||||
|
fileprivate static var smiley: ConfigurationAppIntent {
|
||||||
|
let intent = ConfigurationAppIntent()
|
||||||
|
intent.favoriteEmoji = "😀"
|
||||||
|
return intent
|
||||||
|
}
|
||||||
|
|
||||||
|
fileprivate static var starEyes: ConfigurationAppIntent {
|
||||||
|
let intent = ConfigurationAppIntent()
|
||||||
|
intent.favoriteEmoji = "🤩"
|
||||||
|
return intent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Preview(as: .systemSmall) {
|
||||||
|
NearFutureWidgets()
|
||||||
|
} timeline: {
|
||||||
|
SimpleEntry(date: .now, configuration: .smiley)
|
||||||
|
SimpleEntry(date: .now, configuration: .starEyes)
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
//
|
||||||
|
// NearFutureWidgetsBundle.swift
|
||||||
|
// NearFutureWidgets
|
||||||
|
//
|
||||||
|
// Created by Nihaal Sharma on 02/01/2025.
|
||||||
|
//
|
||||||
|
|
||||||
|
import WidgetKit
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
@main
|
||||||
|
struct NearFutureWidgetsBundle: WidgetBundle {
|
||||||
|
var body: some Widget {
|
||||||
|
NearFutureWidgets()
|
||||||
|
NearFutureWidgetsLiveActivity()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
//
|
||||||
|
// NearFutureWidgetsLiveActivity.swift
|
||||||
|
// NearFutureWidgets
|
||||||
|
//
|
||||||
|
// Created by Nihaal Sharma on 02/01/2025.
|
||||||
|
//
|
||||||
|
|
||||||
|
import ActivityKit
|
||||||
|
import WidgetKit
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct NearFutureWidgetsAttributes: ActivityAttributes {
|
||||||
|
public struct ContentState: Codable, Hashable {
|
||||||
|
// Dynamic stateful properties about your activity go here!
|
||||||
|
var emoji: String
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fixed non-changing properties about your activity go here!
|
||||||
|
var name: String
|
||||||
|
}
|
||||||
|
|
||||||
|
struct NearFutureWidgetsLiveActivity: Widget {
|
||||||
|
var body: some WidgetConfiguration {
|
||||||
|
ActivityConfiguration(for: NearFutureWidgetsAttributes.self) { context in
|
||||||
|
// Lock screen/banner UI goes here
|
||||||
|
VStack {
|
||||||
|
Text("Hello \(context.state.emoji)")
|
||||||
|
}
|
||||||
|
.activityBackgroundTint(Color.cyan)
|
||||||
|
.activitySystemActionForegroundColor(Color.black)
|
||||||
|
|
||||||
|
} dynamicIsland: { context in
|
||||||
|
DynamicIsland {
|
||||||
|
// Expanded UI goes here. Compose the expanded UI through
|
||||||
|
// various regions, like leading/trailing/center/bottom
|
||||||
|
DynamicIslandExpandedRegion(.leading) {
|
||||||
|
Text("Leading")
|
||||||
|
}
|
||||||
|
DynamicIslandExpandedRegion(.trailing) {
|
||||||
|
Text("Trailing")
|
||||||
|
}
|
||||||
|
DynamicIslandExpandedRegion(.bottom) {
|
||||||
|
Text("Bottom \(context.state.emoji)")
|
||||||
|
// more content
|
||||||
|
}
|
||||||
|
} compactLeading: {
|
||||||
|
Text("L")
|
||||||
|
} compactTrailing: {
|
||||||
|
Text("T \(context.state.emoji)")
|
||||||
|
} minimal: {
|
||||||
|
Text(context.state.emoji)
|
||||||
|
}
|
||||||
|
.widgetURL(URL(string: "http://www.apple.com"))
|
||||||
|
.keylineTint(Color.red)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension NearFutureWidgetsAttributes {
|
||||||
|
fileprivate static var preview: NearFutureWidgetsAttributes {
|
||||||
|
NearFutureWidgetsAttributes(name: "World")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension NearFutureWidgetsAttributes.ContentState {
|
||||||
|
fileprivate static var smiley: NearFutureWidgetsAttributes.ContentState {
|
||||||
|
NearFutureWidgetsAttributes.ContentState(emoji: "😀")
|
||||||
|
}
|
||||||
|
|
||||||
|
fileprivate static var starEyes: NearFutureWidgetsAttributes.ContentState {
|
||||||
|
NearFutureWidgetsAttributes.ContentState(emoji: "🤩")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Preview("Notification", as: .content, using: NearFutureWidgetsAttributes.preview) {
|
||||||
|
NearFutureWidgetsLiveActivity()
|
||||||
|
} contentStates: {
|
||||||
|
NearFutureWidgetsAttributes.ContentState.smiley
|
||||||
|
NearFutureWidgetsAttributes.ContentState.starEyes
|
||||||
|
}
|
||||||
@@ -9,11 +9,64 @@ import SwiftUI
|
|||||||
|
|
||||||
struct SettingsView: View {
|
struct SettingsView: View {
|
||||||
@State var viewModel: EventViewModel
|
@State var viewModel: EventViewModel
|
||||||
@Binding var showSettings: Bool
|
@Environment(\.dismiss) var dismiss
|
||||||
|
|
||||||
|
@State private var hasUbiquitous: Bool = false
|
||||||
|
@State private var lastSyncWasSuccessful: Bool = false
|
||||||
|
@State private var lastSyncWasNormalAgo: Bool = false
|
||||||
|
@State private var localCountEqualToiCloud: Bool = false
|
||||||
|
@State private var icloudCountEqualToLocal: Bool = false
|
||||||
|
|
||||||
|
func updateStatus() {
|
||||||
|
let vm = viewModel
|
||||||
|
hasUbiquitous = vm.hasUbiquitousKeyValueStore()
|
||||||
|
lastSyncWasSuccessful = vm.syncStatus.contains("Success")
|
||||||
|
lastSyncWasNormalAgo = vm.lastSync?.timeIntervalSinceNow.isNormal ?? false
|
||||||
|
localCountEqualToiCloud = vm.localEventCount == vm.icloudEventCount
|
||||||
|
icloudCountEqualToLocal = vm.icloudEventCount == vm.localEventCount
|
||||||
|
}
|
||||||
|
|
||||||
|
var iCloudStatusColor: Color {
|
||||||
|
let allTrue = hasUbiquitous && lastSyncWasSuccessful && lastSyncWasNormalAgo && localCountEqualToiCloud && icloudCountEqualToLocal
|
||||||
|
let someTrue = hasUbiquitous || lastSyncWasSuccessful || lastSyncWasNormalAgo || localCountEqualToiCloud || icloudCountEqualToLocal
|
||||||
|
|
||||||
|
if allTrue {
|
||||||
|
return .green
|
||||||
|
} else if someTrue {
|
||||||
|
return .orange
|
||||||
|
} else {
|
||||||
|
return .red
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationStack {
|
NavigationView {
|
||||||
List {
|
List {
|
||||||
|
NavigationLink() {
|
||||||
|
iCloudSettingsView(
|
||||||
|
viewModel: viewModel,
|
||||||
|
hasUbiquitous: $hasUbiquitous,
|
||||||
|
lastSyncWasSuccessful: $lastSyncWasSuccessful,
|
||||||
|
lastSyncWasNormalAgo: $lastSyncWasNormalAgo,
|
||||||
|
localCountEqualToiCloud: $localCountEqualToiCloud,
|
||||||
|
icloudCountEqualToLocal: $icloudCountEqualToLocal,
|
||||||
|
updateStatus: updateStatus
|
||||||
|
)
|
||||||
|
} label: {
|
||||||
|
HStack {
|
||||||
|
Image(systemName: "icloud.fill")
|
||||||
|
Text("iCloud")
|
||||||
|
Spacer()
|
||||||
|
Circle()
|
||||||
|
.frame(width: 20, height: 20)
|
||||||
|
.foregroundStyle(iCloudStatusColor)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.onAppear {
|
||||||
|
viewModel.sync()
|
||||||
|
updateStatus()
|
||||||
|
}
|
||||||
|
|
||||||
Section("Danger Zone") {
|
Section("Danger Zone") {
|
||||||
Button("Delete local data", role: .destructive) {
|
Button("Delete local data", role: .destructive) {
|
||||||
viewModel.dangerClearLocalData()
|
viewModel.dangerClearLocalData()
|
||||||
@@ -40,7 +93,7 @@ struct SettingsView: View {
|
|||||||
.toolbar {
|
.toolbar {
|
||||||
ToolbarItem(placement: .topBarTrailing) {
|
ToolbarItem(placement: .topBarTrailing) {
|
||||||
Button() {
|
Button() {
|
||||||
showSettings.toggle()
|
dismiss()
|
||||||
} label: {
|
} label: {
|
||||||
Image(systemName: "xmark.circle.fill")
|
Image(systemName: "xmark.circle.fill")
|
||||||
.symbolRenderingMode(.hierarchical)
|
.symbolRenderingMode(.hierarchical)
|
||||||
@@ -51,9 +104,171 @@ struct SettingsView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct iCloudSettingsView: View {
|
||||||
|
@State var viewModel: EventViewModel
|
||||||
|
@State var showPushAlert: Bool = false
|
||||||
|
@State var showPullAlert: Bool = false
|
||||||
|
|
||||||
|
@Binding var hasUbiquitous: Bool
|
||||||
|
@Binding var lastSyncWasSuccessful: Bool
|
||||||
|
@Binding var lastSyncWasNormalAgo: Bool
|
||||||
|
@Binding var localCountEqualToiCloud: Bool
|
||||||
|
@Binding var icloudCountEqualToLocal: Bool
|
||||||
|
|
||||||
|
var updateStatus: () -> Void
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
List {
|
||||||
|
HStack {
|
||||||
|
Spacer()
|
||||||
|
VStack {
|
||||||
|
ZStack {
|
||||||
|
Image(systemName: "icloud")
|
||||||
|
.resizable()
|
||||||
|
.scaledToFit()
|
||||||
|
.frame(width: 75, height: 75)
|
||||||
|
.symbolRenderingMode(.multicolor)
|
||||||
|
Text("\(viewModel.icloudEventCount)")
|
||||||
|
.font(.title2)
|
||||||
|
}
|
||||||
|
HStack {
|
||||||
|
Button(role: .destructive) {
|
||||||
|
showPushAlert.toggle()
|
||||||
|
} label: {
|
||||||
|
Image(systemName: "arrow.up")
|
||||||
|
.resizable()
|
||||||
|
.scaledToFit()
|
||||||
|
.frame(width: 30, height: 40)
|
||||||
|
}
|
||||||
|
.buttonStyle(BorderedButtonStyle())
|
||||||
|
.alert("Warning", isPresented: $showPushAlert) {
|
||||||
|
Button("OK", role: .destructive) {
|
||||||
|
viewModel.replaceiCloudWithLocalData()
|
||||||
|
viewModel.sync()
|
||||||
|
updateStatus()
|
||||||
|
}
|
||||||
|
Button("Cancel", role: .cancel) {}
|
||||||
|
} message: {
|
||||||
|
Text("This will replace Events stored in iCloud with Events stored locally.")
|
||||||
|
}
|
||||||
|
|
||||||
|
Button() {
|
||||||
|
viewModel.sync()
|
||||||
|
updateStatus()
|
||||||
|
} label: {
|
||||||
|
Image(systemName: "arrow.triangle.2.circlepath")
|
||||||
|
.resizable()
|
||||||
|
.scaledToFit()
|
||||||
|
.frame(width: 30, height: 40)
|
||||||
|
.foregroundStyle(Color.accentColor)
|
||||||
|
}
|
||||||
|
.buttonStyle(BorderedButtonStyle())
|
||||||
|
|
||||||
|
Button(role: .destructive) {
|
||||||
|
showPullAlert.toggle()
|
||||||
|
} label: {
|
||||||
|
Image(systemName: "arrow.down")
|
||||||
|
.resizable()
|
||||||
|
.scaledToFit()
|
||||||
|
.frame(width: 30, height: 40)
|
||||||
|
}
|
||||||
|
.buttonStyle(BorderedButtonStyle())
|
||||||
|
.alert("Warning", isPresented: $showPullAlert) {
|
||||||
|
Button("OK", role: .destructive) {
|
||||||
|
viewModel.replaceLocalWithiCloudData()
|
||||||
|
viewModel.sync()
|
||||||
|
updateStatus()
|
||||||
|
}
|
||||||
|
Button("Cancel", role: .cancel) {}
|
||||||
|
} message: {
|
||||||
|
Text("This will replace Events stored locally with Events stored in iCloud.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ZStack {
|
||||||
|
Image(systemName: "iphone.gen3")
|
||||||
|
.resizable()
|
||||||
|
.scaledToFit()
|
||||||
|
.frame(width: 75, height: 75)
|
||||||
|
.symbolRenderingMode(.monochrome)
|
||||||
|
Text("\(viewModel.localEventCount)")
|
||||||
|
.font(.headline)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Spacer()
|
||||||
|
}
|
||||||
|
.onAppear {
|
||||||
|
viewModel.sync()
|
||||||
|
updateStatus()
|
||||||
|
}
|
||||||
|
|
||||||
|
HStack {
|
||||||
|
Circle()
|
||||||
|
.frame(width: 20, height: 20)
|
||||||
|
.foregroundStyle(hasUbiquitous ? .green : .red)
|
||||||
|
Text("iCloud Key Value Store:")
|
||||||
|
Text("\(hasUbiquitous ? "" : "Not ")Working")
|
||||||
|
.bold()
|
||||||
|
}
|
||||||
|
|
||||||
|
HStack {
|
||||||
|
Circle()
|
||||||
|
.frame(width: 20, height: 20)
|
||||||
|
.foregroundStyle(lastSyncWasSuccessful ? .green : .red)
|
||||||
|
Text("Sync Status:")
|
||||||
|
Text("\(viewModel.syncStatus)")
|
||||||
|
.bold()
|
||||||
|
}
|
||||||
|
|
||||||
|
HStack {
|
||||||
|
Circle()
|
||||||
|
.frame(width: 20, height: 20)
|
||||||
|
.foregroundStyle(lastSyncWasNormalAgo ? .green : .red)
|
||||||
|
Text("Last Sync:")
|
||||||
|
Text("\(viewModel.lastSync?.formatted() ?? "Never")")
|
||||||
|
.bold()
|
||||||
|
}
|
||||||
|
|
||||||
|
HStack {
|
||||||
|
Circle()
|
||||||
|
.frame(width: 20, height: 20)
|
||||||
|
.foregroundStyle(localCountEqualToiCloud ? .green : .red)
|
||||||
|
Text("\(viewModel.localEventCount)")
|
||||||
|
.bold()
|
||||||
|
Text("Local Events")
|
||||||
|
}
|
||||||
|
|
||||||
|
HStack {
|
||||||
|
Circle()
|
||||||
|
.frame(width: 20, height: 20)
|
||||||
|
.foregroundStyle(icloudCountEqualToLocal ? .green : .red)
|
||||||
|
Text("\(viewModel.icloudEventCount)")
|
||||||
|
.bold()
|
||||||
|
Text("Events in iCloud")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.navigationTitle("iCloud")
|
||||||
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
SettingsView(
|
SettingsView(
|
||||||
viewModel: EventViewModel(),
|
viewModel: EventViewModel()
|
||||||
showSettings: .constant(true)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#Preview("iCloudSettingsView") {
|
||||||
|
iCloudSettingsView(
|
||||||
|
viewModel: EventViewModel(),
|
||||||
|
hasUbiquitous: .constant(true),
|
||||||
|
lastSyncWasSuccessful: .constant(true),
|
||||||
|
lastSyncWasNormalAgo: .constant(true),
|
||||||
|
localCountEqualToiCloud: .constant(true),
|
||||||
|
icloudCountEqualToLocal: .constant(true),
|
||||||
|
updateStatus: test
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
func test() -> Void {
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
//
|
|
||||||
// NearFutureTests.swift
|
|
||||||
// NearFutureTests
|
|
||||||
//
|
|
||||||
// Created by Nihaal Sharma on 31/12/2024.
|
|
||||||
//
|
|
||||||
|
|
||||||
import XCTest
|
|
||||||
|
|
||||||
final class NearFutureTests: XCTestCase {
|
|
||||||
|
|
||||||
override func setUpWithError() throws {
|
|
||||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
|
||||||
}
|
|
||||||
|
|
||||||
override func tearDownWithError() throws {
|
|
||||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
|
||||||
}
|
|
||||||
|
|
||||||
func testExample() throws {
|
|
||||||
// This is an example of a functional test case.
|
|
||||||
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
|
||||||
// Any test you write for XCTest can be annotated as throws and async.
|
|
||||||
// Mark your test throws to produce an unexpected failure when your test encounters an uncaught error.
|
|
||||||
// Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards.
|
|
||||||
}
|
|
||||||
|
|
||||||
func testPerformanceExample() throws {
|
|
||||||
// This is an example of a performance test case.
|
|
||||||
measure {
|
|
||||||
// Put the code you want to measure the time of here.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
//
|
|
||||||
// NearFutureUITests.swift
|
|
||||||
// NearFutureUITests
|
|
||||||
//
|
|
||||||
// Created by Nihaal Sharma on 31/12/2024.
|
|
||||||
//
|
|
||||||
|
|
||||||
import XCTest
|
|
||||||
|
|
||||||
final class NearFutureUITests: XCTestCase {
|
|
||||||
|
|
||||||
override func setUpWithError() throws {
|
|
||||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
|
||||||
|
|
||||||
// In UI tests it is usually best to stop immediately when a failure occurs.
|
|
||||||
continueAfterFailure = false
|
|
||||||
|
|
||||||
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
|
|
||||||
}
|
|
||||||
|
|
||||||
override func tearDownWithError() throws {
|
|
||||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
|
||||||
}
|
|
||||||
|
|
||||||
func testExample() throws {
|
|
||||||
// UI tests must launch the application that they test.
|
|
||||||
let app = XCUIApplication()
|
|
||||||
app.launch()
|
|
||||||
|
|
||||||
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
|
||||||
}
|
|
||||||
|
|
||||||
func testLaunchPerformance() throws {
|
|
||||||
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {
|
|
||||||
// This measures how long it takes to launch your application.
|
|
||||||
measure(metrics: [XCTApplicationLaunchMetric()]) {
|
|
||||||
XCUIApplication().launch()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
//
|
|
||||||
// NearFutureUITestsLaunchTests.swift
|
|
||||||
// NearFutureUITests
|
|
||||||
//
|
|
||||||
// Created by Nihaal Sharma on 31/12/2024.
|
|
||||||
//
|
|
||||||
|
|
||||||
import XCTest
|
|
||||||
|
|
||||||
final class NearFutureUITestsLaunchTests: XCTestCase {
|
|
||||||
|
|
||||||
override class var runsForEachTargetApplicationUIConfiguration: Bool {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
override func setUpWithError() throws {
|
|
||||||
continueAfterFailure = false
|
|
||||||
}
|
|
||||||
|
|
||||||
func testLaunch() throws {
|
|
||||||
let app = XCUIApplication()
|
|
||||||
app.launch()
|
|
||||||
|
|
||||||
// Insert steps here to perform after app launch but before taking a screenshot,
|
|
||||||
// such as logging into a test account or navigating somewhere in the app
|
|
||||||
|
|
||||||
let attachment = XCTAttachment(screenshot: app.screenshot())
|
|
||||||
attachment.name = "Launch Screen"
|
|
||||||
attachment.lifetime = .keepAlways
|
|
||||||
add(attachment)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"colors" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"platform" : "ios",
|
||||||
|
"size" : "1024x1024"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
6
NearFutureWidgets/Assets.xcassets/Contents.json
Normal file
6
NearFutureWidgets/Assets.xcassets/Contents.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"colors" : [
|
||||||
|
{
|
||||||
|
"color" : {
|
||||||
|
"color-space" : "extended-srgb",
|
||||||
|
"components" : {
|
||||||
|
"alpha" : "1.000",
|
||||||
|
"blue" : "0.135",
|
||||||
|
"green" : "0.135",
|
||||||
|
"red" : "0.135"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
11
NearFutureWidgets/Info.plist
Normal file
11
NearFutureWidgets/Info.plist
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>NSExtension</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSExtensionPointIdentifier</key>
|
||||||
|
<string>com.apple.widgetkit-extension</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
208
NearFutureWidgets/NearFutureWidgets.swift
Normal file
208
NearFutureWidgets/NearFutureWidgets.swift
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
//
|
||||||
|
// NearFutureWidgets.swift
|
||||||
|
// NearFutureWidgets
|
||||||
|
//
|
||||||
|
// Created by Nihaal Sharma on 02/01/2025.
|
||||||
|
//
|
||||||
|
|
||||||
|
import WidgetKit
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
// Timeline Entry for Widget
|
||||||
|
struct EventWidgetEntry: TimelineEntry {
|
||||||
|
let date: Date
|
||||||
|
let events: [Event]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Timeline Provider to handle widget data
|
||||||
|
struct EventWidgetProvider: TimelineProvider {
|
||||||
|
func placeholder(in context: Context) -> EventWidgetEntry {
|
||||||
|
EventWidgetEntry(date: Date(), events: [])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getSnapshot(in context: Context, completion: @escaping (EventWidgetEntry) -> ()) {
|
||||||
|
let entry = EventWidgetEntry(date: Date(), events: getEvents())
|
||||||
|
completion(entry)
|
||||||
|
}
|
||||||
|
|
||||||
|
func getTimeline(in context: Context, completion: @escaping (Timeline<EventWidgetEntry>) -> ()) {
|
||||||
|
let events = getEvents()
|
||||||
|
let currentDate = Date()
|
||||||
|
|
||||||
|
// Timeline entry for the current date
|
||||||
|
let entry = EventWidgetEntry(date: currentDate, events: events)
|
||||||
|
|
||||||
|
// Set timeline to refresh every 15 minutes
|
||||||
|
let nextUpdateDate = Calendar.current.date(byAdding: .minute, value: 15, to: currentDate)!
|
||||||
|
let timeline = Timeline(entries: [entry], policy: .after(nextUpdateDate))
|
||||||
|
|
||||||
|
completion(timeline)
|
||||||
|
}
|
||||||
|
|
||||||
|
private func getEvents() -> [Event] {
|
||||||
|
let viewModel = EventViewModel()
|
||||||
|
viewModel.loadEvents()
|
||||||
|
return viewModel.events
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Event Widget View
|
||||||
|
struct EventWidgetView: View {
|
||||||
|
var entry: EventWidgetEntry
|
||||||
|
@Environment(\.widgetFamily) var widgetFamily
|
||||||
|
var showedEvents: Int {
|
||||||
|
switch widgetFamily {
|
||||||
|
case .systemSmall:
|
||||||
|
return 3
|
||||||
|
case .systemMedium:
|
||||||
|
return 3
|
||||||
|
case .systemLarge:
|
||||||
|
return 6
|
||||||
|
default:
|
||||||
|
return 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
let isLarge = widgetFamily == .systemLarge
|
||||||
|
let events = entry.events
|
||||||
|
VStack {
|
||||||
|
Text("Upcoming Events")
|
||||||
|
.font(.subheadline)
|
||||||
|
.padding(.top, -12)
|
||||||
|
// .padding(.bottom, -5)
|
||||||
|
|
||||||
|
ForEach(events.prefix(showedEvents), id: \.id) { event in
|
||||||
|
HStack {
|
||||||
|
RoundedRectangle(cornerRadius: 5)
|
||||||
|
.frame(width: 5)
|
||||||
|
.frame(maxHeight: isLarge ? 50 : 30)
|
||||||
|
.foregroundStyle(event.color.color)
|
||||||
|
.padding(.leading, -18)
|
||||||
|
.padding(.vertical, 2)
|
||||||
|
VStack(alignment: .leading) {
|
||||||
|
HStack {
|
||||||
|
Image(systemName: event.symbol)
|
||||||
|
.resizable()
|
||||||
|
.scaledToFit()
|
||||||
|
.frame(width: 15, height: 15)
|
||||||
|
.foregroundStyle(event.color.color)
|
||||||
|
Text("\(event.name)")
|
||||||
|
.font(.footnote)
|
||||||
|
.padding(.leading, -5)
|
||||||
|
}
|
||||||
|
|
||||||
|
if isLarge {
|
||||||
|
if !event.description.isEmpty {
|
||||||
|
Text(event.description)
|
||||||
|
.font(.caption2)
|
||||||
|
.foregroundColor(.gray)
|
||||||
|
.padding(.top, -5)
|
||||||
|
}
|
||||||
|
Text(event.date.formatted(date: .long, time: .omitted))
|
||||||
|
.font(.caption2)
|
||||||
|
.foregroundColor(event.color.color)
|
||||||
|
.padding(.top, -5)
|
||||||
|
}
|
||||||
|
if event.recurrence != .none {
|
||||||
|
Text("\(event.recurrence.rawValue.capitalized)")
|
||||||
|
.font(.caption2)
|
||||||
|
.padding(.top, -5)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.padding(.leading, -15)
|
||||||
|
|
||||||
|
Spacer()
|
||||||
|
|
||||||
|
Text(daysUntilEvent(event.date, short: !isLarge))
|
||||||
|
.font(.caption)
|
||||||
|
.foregroundColor(event.color.color)
|
||||||
|
.padding(.trailing, -12)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Spacer()
|
||||||
|
if showedEvents < events.count {
|
||||||
|
let xMoreEvents = events.count - showedEvents
|
||||||
|
Text("+\(xMoreEvents) more event\(xMoreEvents == 1 ? "" : "s")")
|
||||||
|
.font(.caption2)
|
||||||
|
.foregroundStyle(.gray)
|
||||||
|
.padding(.top, -5)
|
||||||
|
.padding(.bottom, -15)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.containerBackground(Color.widgetBackground, for: .widget)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Widget_Previews: PreviewProvider {
|
||||||
|
static var events = [
|
||||||
|
Event(
|
||||||
|
name: "Event Name",
|
||||||
|
symbol: "gear",
|
||||||
|
color: ColorCodable(.blue),
|
||||||
|
description: "Event description",
|
||||||
|
date: Date.distantFuture,
|
||||||
|
recurrence: .yearly
|
||||||
|
),
|
||||||
|
Event(
|
||||||
|
name: "A Day",
|
||||||
|
symbol: "star",
|
||||||
|
color: ColorCodable(.orange),
|
||||||
|
description: "description",
|
||||||
|
date: Date(),
|
||||||
|
recurrence: .daily
|
||||||
|
),
|
||||||
|
Event(
|
||||||
|
name: "A Day",
|
||||||
|
symbol: "star",
|
||||||
|
color: ColorCodable(.orange),
|
||||||
|
description: "description",
|
||||||
|
date: Date(),
|
||||||
|
recurrence: .daily
|
||||||
|
),
|
||||||
|
Event(
|
||||||
|
name: "A Day",
|
||||||
|
symbol: "star",
|
||||||
|
color: ColorCodable(.orange),
|
||||||
|
description: "description",
|
||||||
|
date: Date(),
|
||||||
|
recurrence: .daily
|
||||||
|
),
|
||||||
|
Event(
|
||||||
|
name: "A Day",
|
||||||
|
symbol: "star",
|
||||||
|
color: ColorCodable(.orange),
|
||||||
|
description: "description",
|
||||||
|
date: Date(),
|
||||||
|
recurrence: .daily
|
||||||
|
)
|
||||||
|
]
|
||||||
|
static var previews: some View {
|
||||||
|
Group {
|
||||||
|
EventWidgetView(
|
||||||
|
entry: EventWidgetEntry(
|
||||||
|
date: Date(),
|
||||||
|
events: events
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.previewContext(WidgetPreviewContext(family: .systemLarge))
|
||||||
|
.previewDisplayName("Large")
|
||||||
|
EventWidgetView(
|
||||||
|
entry: EventWidgetEntry(
|
||||||
|
date: Date(),
|
||||||
|
events: events
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.previewContext(WidgetPreviewContext(family: .systemMedium))
|
||||||
|
.previewDisplayName("Medium")
|
||||||
|
EventWidgetView(
|
||||||
|
entry: EventWidgetEntry(
|
||||||
|
date: Date(),
|
||||||
|
events: events
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.previewContext(WidgetPreviewContext(family: .systemSmall))
|
||||||
|
.previewDisplayName("Small")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
31
NearFutureWidgets/NearFutureWidgetsBundle.swift
Normal file
31
NearFutureWidgets/NearFutureWidgetsBundle.swift
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
//
|
||||||
|
// NearFutureWidgetsBundle.swift
|
||||||
|
// NearFutureWidgets
|
||||||
|
//
|
||||||
|
// Created by Nihaal Sharma on 02/01/2025.
|
||||||
|
//
|
||||||
|
|
||||||
|
import WidgetKit
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
//@main
|
||||||
|
//struct NearFutureWidgetsBundle: WidgetBundle {
|
||||||
|
// var body: some Widget {
|
||||||
|
// NearFutureWidgets()
|
||||||
|
// NearFutureWidgetsLiveActivity()
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
@main
|
||||||
|
struct NearFutureWidget: Widget {
|
||||||
|
let kind: String = "NearFutureWidget"
|
||||||
|
|
||||||
|
var body: some WidgetConfiguration {
|
||||||
|
StaticConfiguration(kind: kind, provider: EventWidgetProvider()) { entry in
|
||||||
|
EventWidgetView(entry: entry)
|
||||||
|
}
|
||||||
|
.configurationDisplayName("Upcoming Events Widget")
|
||||||
|
.description("Displays your upcoming events.")
|
||||||
|
.supportedFamilies([.systemSmall, .systemMedium, .systemLarge])
|
||||||
|
}
|
||||||
|
}
|
||||||
10
NearFutureWidgets/NearFutureWidgetsExtension.entitlements
Normal file
10
NearFutureWidgets/NearFutureWidgetsExtension.entitlements
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>com.apple.security.application-groups</key>
|
||||||
|
<array>
|
||||||
|
<string>group.com.neon443.NearFuture</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
80
NearFutureWidgets/NearFutureWidgetsLiveActivity.swift
Normal file
80
NearFutureWidgets/NearFutureWidgetsLiveActivity.swift
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
//
|
||||||
|
// NearFutureWidgetsLiveActivity.swift
|
||||||
|
// NearFutureWidgets
|
||||||
|
//
|
||||||
|
// Created by Nihaal Sharma on 02/01/2025.
|
||||||
|
//
|
||||||
|
|
||||||
|
import ActivityKit
|
||||||
|
import WidgetKit
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct NearFutureWidgetsAttributes: ActivityAttributes {
|
||||||
|
public struct ContentState: Codable, Hashable {
|
||||||
|
// Dynamic stateful properties about your activity go here!
|
||||||
|
var emoji: String
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fixed non-changing properties about your activity go here!
|
||||||
|
var name: String
|
||||||
|
}
|
||||||
|
|
||||||
|
struct NearFutureWidgetsLiveActivity: Widget {
|
||||||
|
var body: some WidgetConfiguration {
|
||||||
|
ActivityConfiguration(for: NearFutureWidgetsAttributes.self) { context in
|
||||||
|
// Lock screen/banner UI goes here
|
||||||
|
VStack {
|
||||||
|
Text("Hello \(context.state.emoji)")
|
||||||
|
}
|
||||||
|
.activityBackgroundTint(Color.cyan)
|
||||||
|
.activitySystemActionForegroundColor(Color.black)
|
||||||
|
|
||||||
|
} dynamicIsland: { context in
|
||||||
|
DynamicIsland {
|
||||||
|
// Expanded UI goes here. Compose the expanded UI through
|
||||||
|
// various regions, like leading/trailing/center/bottom
|
||||||
|
DynamicIslandExpandedRegion(.leading) {
|
||||||
|
Text("Leading")
|
||||||
|
}
|
||||||
|
DynamicIslandExpandedRegion(.trailing) {
|
||||||
|
Text("Trailing")
|
||||||
|
}
|
||||||
|
DynamicIslandExpandedRegion(.bottom) {
|
||||||
|
Text("Bottom \(context.state.emoji)")
|
||||||
|
// more content
|
||||||
|
}
|
||||||
|
} compactLeading: {
|
||||||
|
Text("L")
|
||||||
|
} compactTrailing: {
|
||||||
|
Text("T \(context.state.emoji)")
|
||||||
|
} minimal: {
|
||||||
|
Text(context.state.emoji)
|
||||||
|
}
|
||||||
|
.widgetURL(URL(string: "http://www.apple.com"))
|
||||||
|
.keylineTint(Color.red)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension NearFutureWidgetsAttributes {
|
||||||
|
fileprivate static var preview: NearFutureWidgetsAttributes {
|
||||||
|
NearFutureWidgetsAttributes(name: "World")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension NearFutureWidgetsAttributes.ContentState {
|
||||||
|
fileprivate static var smiley: NearFutureWidgetsAttributes.ContentState {
|
||||||
|
NearFutureWidgetsAttributes.ContentState(emoji: "😀")
|
||||||
|
}
|
||||||
|
|
||||||
|
fileprivate static var starEyes: NearFutureWidgetsAttributes.ContentState {
|
||||||
|
NearFutureWidgetsAttributes.ContentState(emoji: "🤩")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Preview("Notification", as: .content, using: NearFutureWidgetsAttributes.preview) {
|
||||||
|
NearFutureWidgetsLiveActivity()
|
||||||
|
} contentStates: {
|
||||||
|
NearFutureWidgetsAttributes.ContentState.smiley
|
||||||
|
NearFutureWidgetsAttributes.ContentState.starEyes
|
||||||
|
}
|
||||||
@@ -7,11 +7,11 @@ Near Future is a SwiftUI App to help people to track upcoming events - Holidays,
|
|||||||
- [x] Descriptions
|
- [x] Descriptions
|
||||||
- [x] Icons
|
- [x] Icons
|
||||||
- [x] Event colors
|
- [x] Event colors
|
||||||
- [ ] Recurrence
|
- [x] Recurrence
|
||||||
- [x] Search
|
- [x] Search
|
||||||
- [ ] Notifications
|
- [ ] Notifications
|
||||||
- [ ] Apple Watch App
|
- [ ] Apple Watch App
|
||||||
- [ ] Home Screen Widgets
|
- [x] Home Screen Widgets
|
||||||
- [ ] Lock Screen Widgets
|
- [ ] Lock Screen Widgets
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|||||||
Reference in New Issue
Block a user