Post

Replies

Boosts

Views

Activity

Cannot use instance member within property initializer
I've been trying to use the example from this session to tweak the default SwiftData template, allowing for syncing of the data across devices. When I added the following code, I get the above error: @main struct ItemApp: App { let items = ModelConfiguration(schema: Schema([Item.self]), url: URL(filePath: "/path/to/item.store"), cloudKitContainerIdentifier: "iCloud.com.app.Item") let container = try ModelContainer(for: items). // ERROR HERE var body: some Scene { WindowGroup { ContentView() } .modelContainer(container) } } Cannot use instance member 'items' within property initializer; property initializers run before 'self' is available Any pointers would be helpful.
3
1
1.6k
Jun ’23
Cannot use instance member within property initializer
I've been trying to use the example from this session to tweak the default SwiftData template, allowing for syncing of the data across devices. When I added the following code, I get the above error: @main struct ItemApp: App { let items = ModelConfiguration(schema: Schema([Item.self]), url: URL(filePath: "/path/to/item.store"), cloudKitContainerIdentifier: "iCloud.com.app.Item") let container = try ModelContainer(for: items). // ERROR HERE var body: some Scene { WindowGroup { ContentView() } .modelContainer(container) } } Cannot use instance member 'items' within property initializer; property initializers run before 'self' is available Any pointers would be helpful.
Replies
3
Boosts
1
Views
1.6k
Activity
Jun ’23
Developer app won't let me view videos in full screen
I noticed that this year the Developer App is not allowing me to run the videos in full screen mode. I have confirmed this on a 2019 16inch MBP and 2021 11 Inch iPad Pro. Is anyone else seeing this issue?
Replies
4
Boosts
2
Views
1.6k
Activity
Jun ’22