End of Step 7: Initial Add of Three Widgets

xcode15-and-vision
Alan Francis 2 years ago
parent bde24c4bfd
commit 57e2ec151e
  1. 510
      JustOneThing.xcodeproj/project.pbxproj
  2. 19
      JustOneThing.xcodeproj/xcuserdata/acf.xcuserdatad/xcschemes/xcschememanagement.plist
  3. 11
      MacWidget/Assets.xcassets/AccentColor.colorset/Contents.json
  4. 58
      MacWidget/Assets.xcassets/AppIcon.appiconset/Contents.json
  5. 6
      MacWidget/Assets.xcassets/Contents.json
  6. 11
      MacWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json
  7. 11
      MacWidget/Info.plist
  8. 8
      MacWidget/MacWidget.entitlements
  9. 59
      MacWidget/MacWidget.intentdefinition
  10. 69
      MacWidget/MacWidget.swift
  11. 11
      PhoneWidget/Assets.xcassets/AccentColor.colorset/Contents.json
  12. 13
      PhoneWidget/Assets.xcassets/AppIcon.appiconset/Contents.json
  13. 6
      PhoneWidget/Assets.xcassets/Contents.json
  14. 11
      PhoneWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json
  15. 11
      PhoneWidget/Info.plist
  16. 59
      PhoneWidget/PhoneWidget.intentdefinition
  17. 68
      PhoneWidget/PhoneWidget.swift
  18. 16
      PhoneWidget/PhoneWidgetBundle.swift
  19. 11
      WatchWidget/Assets.xcassets/AccentColor.colorset/Contents.json
  20. 13
      WatchWidget/Assets.xcassets/AppIcon.appiconset/Contents.json
  21. 6
      WatchWidget/Assets.xcassets/Contents.json
  22. 11
      WatchWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json
  23. 11
      WatchWidget/Info.plist
  24. 59
      WatchWidget/WatchWidget.intentdefinition
  25. 75
      WatchWidget/WatchWidget.swift

@ -14,6 +14,28 @@
5483903B2A2A773900BF5624 /* JustOneThingApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5483903A2A2A773900BF5624 /* JustOneThingApp.swift */; };
5483903D2A2A773900BF5624 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5483903C2A2A773900BF5624 /* ContentView.swift */; };
5483903F2A2A773A00BF5624 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5483903E2A2A773A00BF5624 /* Assets.xcassets */; };
54928C162A35F89900095445 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54928C152A35F89900095445 /* WidgetKit.framework */; };
54928C182A35F89900095445 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54928C172A35F89900095445 /* SwiftUI.framework */; };
54928C1B2A35F89900095445 /* MacWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54928C1A2A35F89900095445 /* MacWidget.swift */; };
54928C1E2A35F89A00095445 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 54928C1D2A35F89A00095445 /* Assets.xcassets */; };
54928C212A35F89A00095445 /* MacWidget.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 54928C1C2A35F89900095445 /* MacWidget.intentdefinition */; };
54928C222A35F89A00095445 /* MacWidget.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 54928C1C2A35F89900095445 /* MacWidget.intentdefinition */; };
54928C252A35F89A00095445 /* MacWidgetExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 54928C132A35F89900095445 /* MacWidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
54928C2F2A35F8B800095445 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54928C152A35F89900095445 /* WidgetKit.framework */; };
54928C302A35F8B800095445 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54928C172A35F89900095445 /* SwiftUI.framework */; };
54928C332A35F8B800095445 /* PhoneWidgetBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54928C322A35F8B800095445 /* PhoneWidgetBundle.swift */; };
54928C352A35F8B800095445 /* PhoneWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54928C342A35F8B800095445 /* PhoneWidget.swift */; };
54928C382A35F8B800095445 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 54928C372A35F8B800095445 /* Assets.xcassets */; };
54928C3A2A35F8B800095445 /* PhoneWidget.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 54928C362A35F8B800095445 /* PhoneWidget.intentdefinition */; };
54928C3B2A35F8B800095445 /* PhoneWidget.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 54928C362A35F8B800095445 /* PhoneWidget.intentdefinition */; };
54928C3E2A35F8B800095445 /* PhoneWidgetExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 54928C2E2A35F8B800095445 /* PhoneWidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
54928C472A35F8CB00095445 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54928C152A35F89900095445 /* WidgetKit.framework */; };
54928C482A35F8CB00095445 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54928C172A35F89900095445 /* SwiftUI.framework */; };
54928C4B2A35F8CB00095445 /* WatchWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54928C4A2A35F8CB00095445 /* WatchWidget.swift */; };
54928C4E2A35F8CC00095445 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 54928C4D2A35F8CC00095445 /* Assets.xcassets */; };
54928C502A35F8CC00095445 /* WatchWidget.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 54928C4C2A35F8CB00095445 /* WatchWidget.intentdefinition */; };
54928C512A35F8CC00095445 /* WatchWidget.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 54928C4C2A35F8CB00095445 /* WatchWidget.intentdefinition */; };
54928C542A35F8CC00095445 /* WatchWidgetExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 54928C462A35F8CB00095445 /* WatchWidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -24,6 +46,27 @@
remoteGlobalIDString = 5431ED6C2A2A77C900515680;
remoteInfo = "JustOneThingWatch Watch App";
};
54928C232A35F89A00095445 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 5483902F2A2A773900BF5624 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 54928C122A35F89900095445;
remoteInfo = MacWidgetExtension;
};
54928C3C2A35F8B800095445 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 5483902F2A2A773900BF5624 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 54928C2D2A35F8B800095445;
remoteInfo = PhoneWidgetExtension;
};
54928C522A35F8CC00095445 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 5483902F2A2A773900BF5624 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 54928C452A35F8CB00095445;
remoteInfo = WatchWidgetExtension;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
@ -38,6 +81,29 @@
name = "Embed Watch Content";
runOnlyForDeploymentPostprocessing = 0;
};
54928C262A35F89A00095445 /* Embed Foundation Extensions */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 13;
files = (
54928C252A35F89A00095445 /* MacWidgetExtension.appex in Embed Foundation Extensions */,
54928C3E2A35F8B800095445 /* PhoneWidgetExtension.appex in Embed Foundation Extensions */,
);
name = "Embed Foundation Extensions";
runOnlyForDeploymentPostprocessing = 0;
};
54928C582A35F8CC00095445 /* Embed Foundation Extensions */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 13;
files = (
54928C542A35F8CC00095445 /* WatchWidgetExtension.appex in Embed Foundation Extensions */,
);
name = "Embed Foundation Extensions";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
@ -48,6 +114,25 @@
5483903C2A2A773900BF5624 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
5483903E2A2A773A00BF5624 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
548390402A2A773A00BF5624 /* JustOneThing.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = JustOneThing.entitlements; sourceTree = "<group>"; };
54928C132A35F89900095445 /* MacWidgetExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = MacWidgetExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
54928C152A35F89900095445 /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; };
54928C172A35F89900095445 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; };
54928C1A2A35F89900095445 /* MacWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacWidget.swift; sourceTree = "<group>"; };
54928C1C2A35F89900095445 /* MacWidget.intentdefinition */ = {isa = PBXFileReference; lastKnownFileType = file.intentdefinition; path = MacWidget.intentdefinition; sourceTree = "<group>"; };
54928C1D2A35F89A00095445 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
54928C1F2A35F89A00095445 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
54928C202A35F89A00095445 /* MacWidget.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MacWidget.entitlements; sourceTree = "<group>"; };
54928C2E2A35F8B800095445 /* PhoneWidgetExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = PhoneWidgetExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
54928C322A35F8B800095445 /* PhoneWidgetBundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhoneWidgetBundle.swift; sourceTree = "<group>"; };
54928C342A35F8B800095445 /* PhoneWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhoneWidget.swift; sourceTree = "<group>"; };
54928C362A35F8B800095445 /* PhoneWidget.intentdefinition */ = {isa = PBXFileReference; lastKnownFileType = file.intentdefinition; path = PhoneWidget.intentdefinition; sourceTree = "<group>"; };
54928C372A35F8B800095445 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
54928C392A35F8B800095445 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
54928C462A35F8CB00095445 /* WatchWidgetExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = WatchWidgetExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
54928C4A2A35F8CB00095445 /* WatchWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WatchWidget.swift; sourceTree = "<group>"; };
54928C4C2A35F8CB00095445 /* WatchWidget.intentdefinition */ = {isa = PBXFileReference; lastKnownFileType = file.intentdefinition; path = WatchWidget.intentdefinition; sourceTree = "<group>"; };
54928C4D2A35F8CC00095445 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
54928C4F2A35F8CC00095445 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -65,6 +150,33 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
54928C102A35F89900095445 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
54928C182A35F89900095445 /* SwiftUI.framework in Frameworks */,
54928C162A35F89900095445 /* WidgetKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
54928C2B2A35F8B800095445 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
54928C302A35F8B800095445 /* SwiftUI.framework in Frameworks */,
54928C2F2A35F8B800095445 /* WidgetKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
54928C432A35F8CB00095445 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
54928C482A35F8CB00095445 /* SwiftUI.framework in Frameworks */,
54928C472A35F8CB00095445 /* WidgetKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
@ -92,6 +204,10 @@
5407E5012A2A8A5100EF00B8 /* AppShared */,
548390392A2A773900BF5624 /* JustOneThing */,
5431ED6E2A2A77C900515680 /* JustOneThingWatch Watch App */,
54928C192A35F89900095445 /* MacWidget */,
54928C312A35F8B800095445 /* PhoneWidget */,
54928C492A35F8CB00095445 /* WatchWidget */,
54928C142A35F89900095445 /* Frameworks */,
548390382A2A773900BF5624 /* Products */,
);
sourceTree = "<group>";
@ -101,6 +217,9 @@
children = (
548390372A2A773900BF5624 /* JustOneThing.app */,
5431ED6D2A2A77C900515680 /* JustOneThingWatch Watch App.app */,
54928C132A35F89900095445 /* MacWidgetExtension.appex */,
54928C2E2A35F8B800095445 /* PhoneWidgetExtension.appex */,
54928C462A35F8CB00095445 /* WatchWidgetExtension.appex */,
);
name = Products;
sourceTree = "<group>";
@ -113,6 +232,50 @@
path = JustOneThing;
sourceTree = "<group>";
};
54928C142A35F89900095445 /* Frameworks */ = {
isa = PBXGroup;
children = (
54928C152A35F89900095445 /* WidgetKit.framework */,
54928C172A35F89900095445 /* SwiftUI.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
54928C192A35F89900095445 /* MacWidget */ = {
isa = PBXGroup;
children = (
54928C1A2A35F89900095445 /* MacWidget.swift */,
54928C1C2A35F89900095445 /* MacWidget.intentdefinition */,
54928C1D2A35F89A00095445 /* Assets.xcassets */,
54928C1F2A35F89A00095445 /* Info.plist */,
54928C202A35F89A00095445 /* MacWidget.entitlements */,
);
path = MacWidget;
sourceTree = "<group>";
};
54928C312A35F8B800095445 /* PhoneWidget */ = {
isa = PBXGroup;
children = (
54928C322A35F8B800095445 /* PhoneWidgetBundle.swift */,
54928C342A35F8B800095445 /* PhoneWidget.swift */,
54928C362A35F8B800095445 /* PhoneWidget.intentdefinition */,
54928C372A35F8B800095445 /* Assets.xcassets */,
54928C392A35F8B800095445 /* Info.plist */,
);
path = PhoneWidget;
sourceTree = "<group>";
};
54928C492A35F8CB00095445 /* WatchWidget */ = {
isa = PBXGroup;
children = (
54928C4A2A35F8CB00095445 /* WatchWidget.swift */,
54928C4C2A35F8CB00095445 /* WatchWidget.intentdefinition */,
54928C4D2A35F8CC00095445 /* Assets.xcassets */,
54928C4F2A35F8CC00095445 /* Info.plist */,
);
path = WatchWidget;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@ -123,10 +286,12 @@
5431ED692A2A77C900515680 /* Sources */,
5431ED6A2A2A77C900515680 /* Frameworks */,
5431ED6B2A2A77C900515680 /* Resources */,
54928C582A35F8CC00095445 /* Embed Foundation Extensions */,
);
buildRules = (
);
dependencies = (
54928C532A35F8CC00095445 /* PBXTargetDependency */,
);
name = "JustOneThingWatch Watch App";
productName = "JustOneThingWatch Watch App";
@ -141,17 +306,71 @@
548390342A2A773900BF5624 /* Frameworks */,
548390352A2A773900BF5624 /* Resources */,
5431ED7B2A2A77CA00515680 /* Embed Watch Content */,
54928C262A35F89A00095445 /* Embed Foundation Extensions */,
);
buildRules = (
);
dependencies = (
5431ED792A2A77CA00515680 /* PBXTargetDependency */,
54928C242A35F89A00095445 /* PBXTargetDependency */,
54928C3D2A35F8B800095445 /* PBXTargetDependency */,
);
name = JustOneThing;
productName = JustOneThing;
productReference = 548390372A2A773900BF5624 /* JustOneThing.app */;
productType = "com.apple.product-type.application";
};
54928C122A35F89900095445 /* MacWidgetExtension */ = {
isa = PBXNativeTarget;
buildConfigurationList = 54928C292A35F89A00095445 /* Build configuration list for PBXNativeTarget "MacWidgetExtension" */;
buildPhases = (
54928C0F2A35F89900095445 /* Sources */,
54928C102A35F89900095445 /* Frameworks */,
54928C112A35F89900095445 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = MacWidgetExtension;
productName = MacWidgetExtension;
productReference = 54928C132A35F89900095445 /* MacWidgetExtension.appex */;
productType = "com.apple.product-type.app-extension";
};
54928C2D2A35F8B800095445 /* PhoneWidgetExtension */ = {
isa = PBXNativeTarget;
buildConfigurationList = 54928C3F2A35F8B800095445 /* Build configuration list for PBXNativeTarget "PhoneWidgetExtension" */;
buildPhases = (
54928C2A2A35F8B800095445 /* Sources */,
54928C2B2A35F8B800095445 /* Frameworks */,
54928C2C2A35F8B800095445 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = PhoneWidgetExtension;
productName = PhoneWidgetExtension;
productReference = 54928C2E2A35F8B800095445 /* PhoneWidgetExtension.appex */;
productType = "com.apple.product-type.app-extension";
};
54928C452A35F8CB00095445 /* WatchWidgetExtension */ = {
isa = PBXNativeTarget;
buildConfigurationList = 54928C552A35F8CC00095445 /* Build configuration list for PBXNativeTarget "WatchWidgetExtension" */;
buildPhases = (
54928C422A35F8CB00095445 /* Sources */,
54928C432A35F8CB00095445 /* Frameworks */,
54928C442A35F8CB00095445 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = WatchWidgetExtension;
productName = WatchWidgetExtension;
productReference = 54928C462A35F8CB00095445 /* WatchWidgetExtension.appex */;
productType = "com.apple.product-type.app-extension";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@ -168,6 +387,15 @@
548390362A2A773900BF5624 = {
CreatedOnToolsVersion = 14.3.1;
};
54928C122A35F89900095445 = {
CreatedOnToolsVersion = 14.3.1;
};
54928C2D2A35F8B800095445 = {
CreatedOnToolsVersion = 14.3.1;
};
54928C452A35F8CB00095445 = {
CreatedOnToolsVersion = 14.3.1;
};
};
};
buildConfigurationList = 548390322A2A773900BF5624 /* Build configuration list for PBXProject "JustOneThing" */;
@ -185,6 +413,9 @@
targets = (
548390362A2A773900BF5624 /* JustOneThing */,
5431ED6C2A2A77C900515680 /* JustOneThingWatch Watch App */,
54928C122A35F89900095445 /* MacWidgetExtension */,
54928C2D2A35F8B800095445 /* PhoneWidgetExtension */,
54928C452A35F8CB00095445 /* WatchWidgetExtension */,
);
};
/* End PBXProject section */
@ -206,6 +437,30 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
54928C112A35F89900095445 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
54928C1E2A35F89A00095445 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
54928C2C2A35F8B800095445 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
54928C382A35F8B800095445 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
54928C442A35F8CB00095445 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
54928C4E2A35F8CC00095445 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@ -214,6 +469,7 @@
buildActionMask = 2147483647;
files = (
5407E5032A2A8AE700EF00B8 /* ContentView.swift in Sources */,
54928C512A35F8CC00095445 /* WatchWidget.intentdefinition in Sources */,
5407E5022A2A8AE200EF00B8 /* JustOneThingApp.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -224,6 +480,36 @@
files = (
5483903D2A2A773900BF5624 /* ContentView.swift in Sources */,
5483903B2A2A773900BF5624 /* JustOneThingApp.swift in Sources */,
54928C222A35F89A00095445 /* MacWidget.intentdefinition in Sources */,
54928C3B2A35F8B800095445 /* PhoneWidget.intentdefinition in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
54928C0F2A35F89900095445 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
54928C212A35F89A00095445 /* MacWidget.intentdefinition in Sources */,
54928C1B2A35F89900095445 /* MacWidget.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
54928C2A2A35F8B800095445 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
54928C352A35F8B800095445 /* PhoneWidget.swift in Sources */,
54928C3A2A35F8B800095445 /* PhoneWidget.intentdefinition in Sources */,
54928C332A35F8B800095445 /* PhoneWidgetBundle.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
54928C422A35F8CB00095445 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
54928C502A35F8CC00095445 /* WatchWidget.intentdefinition in Sources */,
54928C4B2A35F8CB00095445 /* WatchWidget.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -236,12 +522,28 @@
target = 5431ED6C2A2A77C900515680 /* JustOneThingWatch Watch App */;
targetProxy = 5431ED782A2A77CA00515680 /* PBXContainerItemProxy */;
};
54928C242A35F89A00095445 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 54928C122A35F89900095445 /* MacWidgetExtension */;
targetProxy = 54928C232A35F89A00095445 /* PBXContainerItemProxy */;
};
54928C3D2A35F8B800095445 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 54928C2D2A35F8B800095445 /* PhoneWidgetExtension */;
targetProxy = 54928C3C2A35F8B800095445 /* PBXContainerItemProxy */;
};
54928C532A35F8CC00095445 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 54928C452A35F8CB00095445 /* WatchWidgetExtension */;
targetProxy = 54928C522A35F8CC00095445 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
5431ED7C2A2A77CA00515680 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "JustOneThingWatch Watch App/JustOneThingWatch Watch App.entitlements";
@ -273,6 +575,7 @@
5431ED7D2A2A77CA00515680 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "JustOneThingWatch Watch App/JustOneThingWatch Watch App.entitlements";
@ -493,6 +796,186 @@
};
name = Release;
};
54928C272A35F89A00095445 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_ENTITLEMENTS = MacWidget/MacWidget.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 37UC5MW6PT;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = MacWidget/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = MacWidget;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.3;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.alancfrancis.apps.JustOneThing.MacWidget;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
54928C282A35F89A00095445 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_ENTITLEMENTS = MacWidget/MacWidget.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 37UC5MW6PT;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = MacWidget/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = MacWidget;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.3;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.alancfrancis.apps.JustOneThing.MacWidget;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Release;
};
54928C402A35F8B800095445 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 37UC5MW6PT;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = PhoneWidget/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = PhoneWidget;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
IPHONEOS_DEPLOYMENT_TARGET = 16.4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.alancfrancis.apps.JustOneThing.PhoneWidget;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
54928C412A35F8B800095445 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 37UC5MW6PT;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = PhoneWidget/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = PhoneWidget;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
IPHONEOS_DEPLOYMENT_TARGET = 16.4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.alancfrancis.apps.JustOneThing.PhoneWidget;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
54928C562A35F8CC00095445 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 37UC5MW6PT;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = WatchWidget/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = WatchWidget;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
"@executable_path/../../../../Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.alancfrancis.apps.JustOneThing.watchkitapp.WatchWidget;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 9.4;
};
name = Debug;
};
54928C572A35F8CC00095445 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 37UC5MW6PT;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = WatchWidget/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = WatchWidget;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
"@executable_path/../../../../Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.alancfrancis.apps.JustOneThing.watchkitapp.WatchWidget;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 4;
VALIDATE_PRODUCT = YES;
WATCHOS_DEPLOYMENT_TARGET = 9.4;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@ -523,6 +1006,33 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
54928C292A35F89A00095445 /* Build configuration list for PBXNativeTarget "MacWidgetExtension" */ = {
isa = XCConfigurationList;
buildConfigurations = (
54928C272A35F89A00095445 /* Debug */,
54928C282A35F89A00095445 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
54928C3F2A35F8B800095445 /* Build configuration list for PBXNativeTarget "PhoneWidgetExtension" */ = {
isa = XCConfigurationList;
buildConfigurations = (
54928C402A35F8B800095445 /* Debug */,
54928C412A35F8B800095445 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
54928C552A35F8CC00095445 /* Build configuration list for PBXNativeTarget "WatchWidgetExtension" */ = {
isa = XCConfigurationList;
buildConfigurations = (
54928C562A35F8CC00095445 /* Debug */,
54928C572A35F8CC00095445 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 5483902F2A2A773900BF5624 /* Project object */;

@ -7,12 +7,27 @@
<key>JustOneThing.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
<key>JustOneThingWatch Watch App.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
<key>MacWidgetExtension.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>PhoneWidgetExtension.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>3</integer>
</dict>
<key>WatchWidgetExtension.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>4</integer>
</dict>
</dict>
</dict>

@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -0,0 +1,58 @@
{
"images" : [
{
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"
}
],
"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
}
}

@ -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,8 @@
<?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.app-sandbox</key>
<true/>
</dict>
</plist>

@ -0,0 +1,59 @@
<?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>INEnums</key>
<array/>
<key>INIntentDefinitionModelVersion</key>
<string>1.2</string>
<key>INIntentDefinitionNamespace</key>
<string>88xZPY</string>
<key>INIntentDefinitionSystemVersion</key>
<string>20A294</string>
<key>INIntentDefinitionToolsBuildVersion</key>
<string>12A6144</string>
<key>INIntentDefinitionToolsVersion</key>
<string>12.0</string>
<key>INIntents</key>
<array>
<dict>
<key>INIntentCategory</key>
<string>information</string>
<key>INIntentDescriptionID</key>
<string>tVvJ9c</string>
<key>INIntentEligibleForWidgets</key>
<true/>
<key>INIntentIneligibleForSuggestions</key>
<true/>
<key>INIntentName</key>
<string>Configuration</string>
<key>INIntentResponse</key>
<dict>
<key>INIntentResponseCodes</key>
<array>
<dict>
<key>INIntentResponseCodeName</key>
<string>success</string>
<key>INIntentResponseCodeSuccess</key>
<true/>
</dict>
<dict>
<key>INIntentResponseCodeName</key>
<string>failure</string>
</dict>
</array>
</dict>
<key>INIntentTitle</key>
<string>Configuration</string>
<key>INIntentTitleID</key>
<string>gpCwrM</string>
<key>INIntentType</key>
<string>Custom</string>
<key>INIntentVerb</key>
<string>View</string>
</dict>
</array>
<key>INTypes</key>
<array/>
</dict>
</plist>

@ -0,0 +1,69 @@
//
// MacWidget.swift
// MacWidget
//
// Created by Alan Francis on 11/06/2023.
//
import WidgetKit
import SwiftUI
import Intents
struct Provider: IntentTimelineProvider {
func placeholder(in context: Context) -> SimpleEntry {
SimpleEntry(date: Date(), configuration: ConfigurationIntent())
}
func getSnapshot(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (SimpleEntry) -> ()) {
let entry = SimpleEntry(date: Date(), configuration: configuration)
completion(entry)
}
func getTimeline(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (Timeline<Entry>) -> ()) {
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)
}
let timeline = Timeline(entries: entries, policy: .atEnd)
completion(timeline)
}
}
struct SimpleEntry: TimelineEntry {
let date: Date
let configuration: ConfigurationIntent
}
struct MacWidgetEntryView : View {
var entry: Provider.Entry
var body: some View {
Text(entry.date, style: .time)
}
}
@main
struct MacWidget: Widget {
let kind: String = "MacWidget"
var body: some WidgetConfiguration {
IntentConfiguration(kind: kind, intent: ConfigurationIntent.self, provider: Provider()) { entry in
MacWidgetEntryView(entry: entry)
}
.configurationDisplayName("My Widget")
.description("This is an example widget.")
}
}
struct MacWidget_Previews: PreviewProvider {
static var previews: some View {
MacWidgetEntryView(entry: SimpleEntry(date: Date(), configuration: ConfigurationIntent()))
.previewContext(WidgetPreviewContext(family: .systemSmall))
}
}

@ -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
}
}

@ -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,59 @@
<?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>INEnums</key>
<array/>
<key>INIntentDefinitionModelVersion</key>
<string>1.2</string>
<key>INIntentDefinitionNamespace</key>
<string>88xZPY</string>
<key>INIntentDefinitionSystemVersion</key>
<string>20A294</string>
<key>INIntentDefinitionToolsBuildVersion</key>
<string>12A6144</string>
<key>INIntentDefinitionToolsVersion</key>
<string>12.0</string>
<key>INIntents</key>
<array>
<dict>
<key>INIntentCategory</key>
<string>information</string>
<key>INIntentDescriptionID</key>
<string>tVvJ9c</string>
<key>INIntentEligibleForWidgets</key>
<true/>
<key>INIntentIneligibleForSuggestions</key>
<true/>
<key>INIntentName</key>
<string>Configuration</string>
<key>INIntentResponse</key>
<dict>
<key>INIntentResponseCodes</key>
<array>
<dict>
<key>INIntentResponseCodeName</key>
<string>success</string>
<key>INIntentResponseCodeSuccess</key>
<true/>
</dict>
<dict>
<key>INIntentResponseCodeName</key>
<string>failure</string>
</dict>
</array>
</dict>
<key>INIntentTitle</key>
<string>Configuration</string>
<key>INIntentTitleID</key>
<string>gpCwrM</string>
<key>INIntentType</key>
<string>Custom</string>
<key>INIntentVerb</key>
<string>View</string>
</dict>
</array>
<key>INTypes</key>
<array/>
</dict>
</plist>

@ -0,0 +1,68 @@
//
// PhoneWidget.swift
// PhoneWidget
//
// Created by Alan Francis on 11/06/2023.
//
import WidgetKit
import SwiftUI
import Intents
struct Provider: IntentTimelineProvider {
func placeholder(in context: Context) -> SimpleEntry {
SimpleEntry(date: Date(), configuration: ConfigurationIntent())
}
func getSnapshot(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (SimpleEntry) -> ()) {
let entry = SimpleEntry(date: Date(), configuration: configuration)
completion(entry)
}
func getTimeline(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (Timeline<Entry>) -> ()) {
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)
}
let timeline = Timeline(entries: entries, policy: .atEnd)
completion(timeline)
}
}
struct SimpleEntry: TimelineEntry {
let date: Date
let configuration: ConfigurationIntent
}
struct PhoneWidgetEntryView : View {
var entry: Provider.Entry
var body: some View {
Text(entry.date, style: .time)
}
}
struct PhoneWidget: Widget {
let kind: String = "PhoneWidget"
var body: some WidgetConfiguration {
IntentConfiguration(kind: kind, intent: ConfigurationIntent.self, provider: Provider()) { entry in
PhoneWidgetEntryView(entry: entry)
}
.configurationDisplayName("My Widget")
.description("This is an example widget.")
}
}
struct PhoneWidget_Previews: PreviewProvider {
static var previews: some View {
PhoneWidgetEntryView(entry: SimpleEntry(date: Date(), configuration: ConfigurationIntent()))
.previewContext(WidgetPreviewContext(family: .systemSmall))
}
}

@ -0,0 +1,16 @@
//
// PhoneWidgetBundle.swift
// PhoneWidget
//
// Created by Alan Francis on 11/06/2023.
//
import WidgetKit
import SwiftUI
@main
struct PhoneWidgetBundle: WidgetBundle {
var body: some Widget {
PhoneWidget()
}
}

@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"platform" : "watchos",
"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
}
}

@ -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,59 @@
<?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>INEnums</key>
<array/>
<key>INIntentDefinitionModelVersion</key>
<string>1.2</string>
<key>INIntentDefinitionNamespace</key>
<string>88xZPY</string>
<key>INIntentDefinitionSystemVersion</key>
<string>20A294</string>
<key>INIntentDefinitionToolsBuildVersion</key>
<string>12A6144</string>
<key>INIntentDefinitionToolsVersion</key>
<string>12.0</string>
<key>INIntents</key>
<array>
<dict>
<key>INIntentCategory</key>
<string>information</string>
<key>INIntentDescriptionID</key>
<string>tVvJ9c</string>
<key>INIntentEligibleForWidgets</key>
<true/>
<key>INIntentIneligibleForSuggestions</key>
<true/>
<key>INIntentName</key>
<string>Configuration</string>
<key>INIntentResponse</key>
<dict>
<key>INIntentResponseCodes</key>
<array>
<dict>
<key>INIntentResponseCodeName</key>
<string>success</string>
<key>INIntentResponseCodeSuccess</key>
<true/>
</dict>
<dict>
<key>INIntentResponseCodeName</key>
<string>failure</string>
</dict>
</array>
</dict>
<key>INIntentTitle</key>
<string>Configuration</string>
<key>INIntentTitleID</key>
<string>gpCwrM</string>
<key>INIntentType</key>
<string>Custom</string>
<key>INIntentVerb</key>
<string>View</string>
</dict>
</array>
<key>INTypes</key>
<array/>
</dict>
</plist>

@ -0,0 +1,75 @@
//
// WatchWidget.swift
// WatchWidget
//
// Created by Alan Francis on 11/06/2023.
//
import WidgetKit
import SwiftUI
import Intents
struct Provider: IntentTimelineProvider {
func placeholder(in context: Context) -> SimpleEntry {
SimpleEntry(date: Date(), configuration: ConfigurationIntent())
}
func getSnapshot(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (SimpleEntry) -> ()) {
let entry = SimpleEntry(date: Date(), configuration: configuration)
completion(entry)
}
func getTimeline(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (Timeline<Entry>) -> ()) {
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)
}
let timeline = Timeline(entries: entries, policy: .atEnd)
completion(timeline)
}
func recommendations() -> [IntentRecommendation<ConfigurationIntent>] {
return [
IntentRecommendation(intent: ConfigurationIntent(), description: "My Intent Widget")
]
}
}
struct SimpleEntry: TimelineEntry {
let date: Date
let configuration: ConfigurationIntent
}
struct WatchWidgetEntryView : View {
var entry: Provider.Entry
var body: some View {
Text(entry.date, style: .time)
}
}
@main
struct WatchWidget: Widget {
let kind: String = "WatchWidget"
var body: some WidgetConfiguration {
IntentConfiguration(kind: kind, intent: ConfigurationIntent.self, provider: Provider()) { entry in
WatchWidgetEntryView(entry: entry)
}
.configurationDisplayName("My Widget")
.description("This is an example widget.")
}
}
struct WatchWidget_Previews: PreviewProvider {
static var previews: some View {
WatchWidgetEntryView(entry: SimpleEntry(date: Date(), configuration: ConfigurationIntent()))
.previewContext(WidgetPreviewContext(family: .accessoryRectangular))
}
}
Loading…
Cancel
Save