Compare commits

..

1 Commits

Author SHA1 Message Date
Alan Francis dd213aeff4 Part 8b: visionOS 2 years ago
  1. 13
      AppShared/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Contents.json
  2. BIN
      AppShared/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/visionos_icon_back@2x.png
  3. 6
      AppShared/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Contents.json
  4. 17
      AppShared/Assets.xcassets/AppIcon.solidimagestack/Contents.json
  5. 13
      AppShared/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Contents.json
  6. BIN
      AppShared/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/visionos_icon_front@2x.png
  7. 6
      AppShared/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Contents.json
  8. 12
      AppShared/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/Contents.json
  9. 6
      AppShared/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Contents.json
  10. 2
      AppShared/ContentView.swift
  11. 2
      AppShared/JustOneThingApp.swift
  12. 24
      JustOneThing.xcodeproj/project.pbxproj
  13. 23
      Model/PersistentThingExtension.swift
  14. 21
      WidgetShared/JustOneThingProvider.swift

@ -0,0 +1,13 @@
{
"images" : [
{
"filename" : "visionos_icon_back@2x.png",
"idiom" : "reality",
"scale" : "2x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -0,0 +1,17 @@
{
"info" : {
"author" : "xcode",
"version" : 1
},
"layers" : [
{
"filename" : "Front.solidimagestacklayer"
},
{
"filename" : "Middle.solidimagestacklayer"
},
{
"filename" : "Back.solidimagestacklayer"
}
]
}

@ -0,0 +1,13 @@
{
"images" : [
{
"filename" : "visionos_icon_front@2x.png",
"idiom" : "reality",
"scale" : "2x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "reality",
"scale" : "2x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -11,7 +11,7 @@ struct ContentView: View {
var body: some View { var body: some View {
#if os(iOS) // iOS can add and remove #if os(iOS) // iOS can add and remove
ListOfThingsView() ListOfThingsView()
#elseif os(tvOS) || os(watchOS) || os(macOS) // macOS and tvOS and watchOS just show a readonly list #else // macOS and tvOS and watchOS (and visionOS) just show a readonly list
SimpleListOfThingsView() SimpleListOfThingsView()
#endif #endif
} }

@ -9,7 +9,7 @@ import SwiftUI
@main @main
struct JustOneThingApp: App { struct JustOneThingApp: App {
let persistenceController = PersistenceController.shared let persistenceController = PersistenceController.preview // or PersistenceController.shared
var body: some Scene { var body: some Scene {
WindowGroup { WindowGroup {
ContentView() ContentView()

@ -17,9 +17,6 @@
5416C7392A56A867002196EE /* InterfaceExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5416C7372A56A867002196EE /* InterfaceExtensions.swift */; }; 5416C7392A56A867002196EE /* InterfaceExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5416C7372A56A867002196EE /* InterfaceExtensions.swift */; };
5416C73A2A56A867002196EE /* InterfaceExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5416C7372A56A867002196EE /* InterfaceExtensions.swift */; }; 5416C73A2A56A867002196EE /* InterfaceExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5416C7372A56A867002196EE /* InterfaceExtensions.swift */; };
5431ED7A2A2A77CA00515680 /* JustOneThingWatch.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = 5431ED6D2A2A77C900515680 /* JustOneThingWatch.app */; platformFilter = ios; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 5431ED7A2A2A77CA00515680 /* JustOneThingWatch.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = 5431ED6D2A2A77C900515680 /* JustOneThingWatch.app */; platformFilter = ios; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
545A50F32A6335D400CD3924 /* PersistentThingExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 545A50F02A6335D400CD3924 /* PersistentThingExtension.swift */; };
545A50F42A6335D400CD3924 /* PersistentThingExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 545A50F02A6335D400CD3924 /* PersistentThingExtension.swift */; };
545A50F52A6335D400CD3924 /* PersistentThingExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 545A50F02A6335D400CD3924 /* PersistentThingExtension.swift */; };
5472018C2A36563A005B2FCC /* WidgetAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 54928C372A35F8B800095445 /* WidgetAssets.xcassets */; }; 5472018C2A36563A005B2FCC /* WidgetAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 54928C372A35F8B800095445 /* WidgetAssets.xcassets */; };
5472018E2A36563B005B2FCC /* Widget.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 54928C1C2A35F89900095445 /* Widget.intentdefinition */; }; 5472018E2A36563B005B2FCC /* Widget.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 54928C1C2A35F89900095445 /* Widget.intentdefinition */; };
547201902A36563C005B2FCC /* Widget.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 54928C1C2A35F89900095445 /* Widget.intentdefinition */; }; 547201902A36563C005B2FCC /* Widget.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 54928C1C2A35F89900095445 /* Widget.intentdefinition */; };
@ -144,7 +141,6 @@
5431ED6D2A2A77C900515680 /* JustOneThingWatch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JustOneThingWatch.app; sourceTree = BUILT_PRODUCTS_DIR; }; 5431ED6D2A2A77C900515680 /* JustOneThingWatch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JustOneThingWatch.app; sourceTree = BUILT_PRODUCTS_DIR; };
5432A6032A582D5D00FE2351 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 5432A6032A582D5D00FE2351 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
5432A6042A582D6D00FE2351 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 5432A6042A582D6D00FE2351 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
545A50F02A6335D400CD3924 /* PersistentThingExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersistentThingExtension.swift; sourceTree = "<group>"; };
547201942A461554005B2FCC /* PhoneWidget.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = PhoneWidget.entitlements; sourceTree = "<group>"; }; 547201942A461554005B2FCC /* PhoneWidget.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = PhoneWidget.entitlements; sourceTree = "<group>"; };
547201952A461558005B2FCC /* WatchWidget.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WatchWidget.entitlements; sourceTree = "<group>"; }; 547201952A461558005B2FCC /* WatchWidget.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WatchWidget.entitlements; sourceTree = "<group>"; };
548390372A2A773900BF5624 /* JustOneThing.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JustOneThing.app; sourceTree = BUILT_PRODUCTS_DIR; }; 548390372A2A773900BF5624 /* JustOneThing.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JustOneThing.app; sourceTree = BUILT_PRODUCTS_DIR; };
@ -345,7 +341,6 @@
children = ( children = (
54AE283F2A5823D900719A56 /* JustOneThingCloudModel.xcdatamodeld */, 54AE283F2A5823D900719A56 /* JustOneThingCloudModel.xcdatamodeld */,
54AE28462A58245700719A56 /* PersistenceController.swift */, 54AE28462A58245700719A56 /* PersistenceController.swift */,
545A50F02A6335D400CD3924 /* PersistentThingExtension.swift */,
); );
path = Model; path = Model;
sourceTree = "<group>"; sourceTree = "<group>";
@ -572,7 +567,6 @@
54AE28492A58245700719A56 /* PersistenceController.swift in Sources */, 54AE28492A58245700719A56 /* PersistenceController.swift in Sources */,
54EB3C1F2A5434A30082B059 /* Thing.swift in Sources */, 54EB3C1F2A5434A30082B059 /* Thing.swift in Sources */,
54928C212A35F89A00095445 /* Widget.intentdefinition in Sources */, 54928C212A35F89A00095445 /* Widget.intentdefinition in Sources */,
545A50F32A6335D400CD3924 /* PersistentThingExtension.swift in Sources */,
5493A81B2A471E37001EBA08 /* JustOneThingProvider.swift in Sources */, 5493A81B2A471E37001EBA08 /* JustOneThingProvider.swift in Sources */,
54BD36092A5700480022D6BE /* ThingView.swift in Sources */, 54BD36092A5700480022D6BE /* ThingView.swift in Sources */,
54BD360D2A57020E0022D6BE /* WidgetBundle.swift in Sources */, 54BD360D2A57020E0022D6BE /* WidgetBundle.swift in Sources */,
@ -596,7 +590,6 @@
5416C7392A56A867002196EE /* InterfaceExtensions.swift in Sources */, 5416C7392A56A867002196EE /* InterfaceExtensions.swift in Sources */,
5472018E2A36563B005B2FCC /* Widget.intentdefinition in Sources */, 5472018E2A36563B005B2FCC /* Widget.intentdefinition in Sources */,
54AE284A2A58245700719A56 /* PersistenceController.swift in Sources */, 54AE284A2A58245700719A56 /* PersistenceController.swift in Sources */,
545A50F42A6335D400CD3924 /* PersistentThingExtension.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -607,7 +600,6 @@
54AE284B2A58245700719A56 /* PersistenceController.swift in Sources */, 54AE284B2A58245700719A56 /* PersistenceController.swift in Sources */,
54BD36132A57021E0022D6BE /* AccessoryWidget.swift in Sources */, 54BD36132A57021E0022D6BE /* AccessoryWidget.swift in Sources */,
54EB3C212A5434A30082B059 /* Thing.swift in Sources */, 54EB3C212A5434A30082B059 /* Thing.swift in Sources */,
545A50F52A6335D400CD3924 /* PersistentThingExtension.swift in Sources */,
547201902A36563C005B2FCC /* Widget.intentdefinition in Sources */, 547201902A36563C005B2FCC /* Widget.intentdefinition in Sources */,
5493A81D2A471E37001EBA08 /* JustOneThingProvider.swift in Sources */, 5493A81D2A471E37001EBA08 /* JustOneThingProvider.swift in Sources */,
54BD360B2A5700480022D6BE /* ThingView.swift in Sources */, 54BD360B2A5700480022D6BE /* ThingView.swift in Sources */,
@ -857,12 +849,12 @@
PRODUCT_BUNDLE_IDENTIFIER = com.alancfrancis.apps.JustOneThing; PRODUCT_BUNDLE_IDENTIFIER = com.alancfrancis.apps.JustOneThing;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto; SDKROOT = auto;
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx"; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx xros xrsimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3"; TARGETED_DEVICE_FAMILY = "1,2,3,7";
}; };
name = Debug; name = Debug;
}; };
@ -899,12 +891,12 @@
PRODUCT_BUNDLE_IDENTIFIER = com.alancfrancis.apps.JustOneThing; PRODUCT_BUNDLE_IDENTIFIER = com.alancfrancis.apps.JustOneThing;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto; SDKROOT = auto;
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx"; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx xros xrsimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3"; TARGETED_DEVICE_FAMILY = "1,2,3,7";
}; };
name = Release; name = Release;
}; };
@ -996,6 +988,10 @@
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos; SDKROOT = iphoneos;
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
@ -1026,6 +1022,10 @@
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos; SDKROOT = iphoneos;
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";

@ -1,23 +0,0 @@
//
// PersistentThingExtension.swift
// JustOneThing
//
// Created by Alan Francis on 15/07/2023.
//
import CoreData
extension PersistentThing {
var asThing: Thing {
get {
Thing(text: self.text ?? "[no text]",
createdAt: self.createdAt ?? Date.distantPast)
}
}
static var request: NSFetchRequest<PersistentThing> {
get {
return NSFetchRequest<PersistentThing>(entityName: PersistentThing.entity().name!)
}
}
}

@ -9,25 +9,6 @@ import WidgetKit
import SwiftUI import SwiftUI
import Intents import Intents
class ThingCoreDataStore {
let managedObjectContext = PersistenceController.shared.viewContext
public var things:[Thing] {
do {
return try managedObjectContext.fetch(PersistentThing.request).map { persistentThing in
persistentThing.asThing
}
}
catch {
return []
}
}
public var shuffledThings:[Thing] {
return self.things.shuffled()
}
}
struct ThingDataStore { struct ThingDataStore {
public var things:[Thing] = [ public var things:[Thing] = [
Thing(text: "Eat", createdAt: Date()), Thing(text: "Eat", createdAt: Date()),
@ -51,7 +32,7 @@ extension Date {
} }
struct ThingProvider: IntentTimelineProvider { struct ThingProvider: IntentTimelineProvider {
var thingStore = ThingCoreDataStore() var thingStore:ThingDataStore = ThingDataStore()
func placeholder(in context: Context) -> ThingEntry { func placeholder(in context: Context) -> ThingEntry {
ThingEntry(thing: .placeholder) ThingEntry(thing: .placeholder)

Loading…
Cancel
Save