Post

Replies

Boosts

Views

Activity

Reply to Guideline 3.1.2 - Business - Payments - Subscriptions
For 3.1.2 Issue Description, you need to include a Terms of Use for apps with Auto Renewable Subscriptions. Either provide your own or you can use the standard Apple Terms of Use EULA. Make sure to put the http link in your description in App Store Connect. As for Resources, make sure your Store Sheet has the mentioned required fields. Also provide a Link in your App binary to the privacy policy and terms of use.
Nov ’25
Reply to Unable to download iOS 26.1 Simulator Runtime - Build 23B80 not available
I have the same issue on both my Macs, unable to download Build 23B86. Looks the build number has been bumped up. Update: For now the only way is to download from terminal using Xcode command line tools xcodebuild -downloadPlatform iOS -exportPath ~/Downloads Then install it using terminal, the guide is at: https://developer.apple.com/documentation/xcode/downloading-and-installing-additional-xcode-components#Download-Xcode-components-from-the-command-line
Nov ’25
Reply to How to use SwiftData with MVVM architecture?
Using @Query allows you to access the model class from your SwiftUI view, it allows you to specify sorting, filtering, etc, by using computed properties. In the ViewModel, you can define (assuming your model is called Todo): var todos: Todo If Todo has some properties like title, isCompleted, etc. declare variables in your view model as: var title: String { todo.title } var isCompleted: Bool { todo.isCompleted } Then you can do your logic in your SwiftUI view that has declared the view model to call viewModel.isCompleted. But if you modify the view model properties, they will not be persisted until you define it back, e.g.: // E.g. todo.isCompleted = true todo.title = viewModel.title try? context.save()
Jun ’25
Reply to Add App Group to Existing SwiftData App
You don't need to define that in your @Model class. Instead, in the main app, you have: let container: ModelContainer init() { let schema = Schema([YourModelName.self]) // Your model name inside let modelConfiguration = ModelConfiguration(schema: schema, allowsSave: true) do { container = try ModelContainer(for: schema, configurations: [modelConfiguration]) print("Model Container created successfully.") } catch { fatalError("Could not create Model Container: \(error.localizedDescription)") } } Then in your widget, in the timeline provider declare the variable for the model container: var container: ModelContainer = { try! ModelContainer(for: YourModelName.self) }() Then you need to just define your getEntries() function that returns an array of entries accordingly var descriptor = FetchDescriptor<YourModelName> let allEntries = try?container.mainContext.fetch(descriptor) return allEntries ?? [] // Empty array if it throws Don't forget to add the App Groups under the Signing & Capabilities tab for both the main app target and widget extension. Make sure it is the same one, e.g. group.com.yourcompany.YourAppName in both. Build it and make sure it is white and not in red for the App Groups.
Jun ’25
Reply to Live Activity fails to start with "unsupportedTarget" error on iOS 18 beta
Hi, the live activity function should look something like: func startLiveActivity() { let attributes = TimerAttributes(/*…*/) let contentState = TimerAttributes.ContentState(/*…*/) Task { @MainActor in do { let activity = try Activity<TimerAttributes>.request( attributes: attributes, content: ActivityContent(state: contentState, staleDate: staleDate), pushType: nil ) self.activity = activity } catch { print("Failed to start Live Activity: \(error)") } } } My TimerAttributes - this is your attributes for Live Activity, defined as: struct TimerAttributes: ActivityAttributes { public struct ContentState: Codable, Hashable { /* content state variables */ } /* other variables here */ } so when ever you call your start, you have to call your Live Activity start function. I place it in a Live Activity Manager.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’25
Reply to Using App Intents in Live Activity to Pause a Timer
The solution is found. To use buttons in LA or Dynamic Island, it shouldn’t be AppIntent, it should be LiveActivityIntent. struct PauseIntent: LiveActivityIntent { // followed by the rest of the code } either load the user defaults data that is linked with App Group or use SwiftData/CoreData, inject model container, and save the updated state there. Then update the live activity, the LA or Dynamic Island will show the updated ContentState. When returning to the app, reload the data from the data store and rebuild the necessary view models.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’25
Reply to Guideline 3.1.2 - Business - Payments - Subscriptions
For 3.1.2 Issue Description, you need to include a Terms of Use for apps with Auto Renewable Subscriptions. Either provide your own or you can use the standard Apple Terms of Use EULA. Make sure to put the http link in your description in App Store Connect. As for Resources, make sure your Store Sheet has the mentioned required fields. Also provide a Link in your App binary to the privacy policy and terms of use.
Replies
Boosts
Views
Activity
Nov ’25
Reply to No simulators on Xcode 26.1
Check your Xcode -> Settings -> Components. iOS should be installed
Replies
Boosts
Views
Activity
Nov ’25
Reply to Unable to download iOS 26.1 Simulator Runtime - Build 23B80 not available
But I noticed it was Build 23B80, it's the older build that had no wallpaper in the Simulator, just black wallpaper. Earlier the failed download message said 23B86.
Replies
Boosts
Views
Activity
Nov ’25
Reply to Unable to download iOS 26.1 Simulator Runtime - Build 23B80 not available
I have the same issue on both my Macs, unable to download Build 23B86. Looks the build number has been bumped up. Update: For now the only way is to download from terminal using Xcode command line tools xcodebuild -downloadPlatform iOS -exportPath ~/Downloads Then install it using terminal, the guide is at: https://developer.apple.com/documentation/xcode/downloading-and-installing-additional-xcode-components#Download-Xcode-components-from-the-command-line
Replies
Boosts
Views
Activity
Nov ’25
Reply to Using Previews causes a system crash on Xcode 26 Beta 4 and MacOS 26 Beta 4
I am getting frequent crashes in Xcode 16.4 that is running on macOS 26 Beta 4 restarting when Previews are active. It happens especially if you change some code in the swift file. The next thing is it freezes, a magenta screen appears for a while, then macOS restarts.
Replies
Boosts
Views
Activity
Jul ’25
Reply to Xcode 26 Beta 4 crashes on closing of project
The other way was to quit by using Command+Q, then it would crash. On the next launch, the screen appearing that shows New Project or select recent would appear. This would prevent opening the previously open project.
Replies
Boosts
Views
Activity
Jul ’25
Reply to Data Race in Widgets?
If it’s UI facing or some SwiftData related, you need to use with @MainActor. but ideally provide more information.
Replies
Boosts
Views
Activity
Jun ’25
Reply to How to use SwiftData with MVVM architecture?
Using @Query allows you to access the model class from your SwiftUI view, it allows you to specify sorting, filtering, etc, by using computed properties. In the ViewModel, you can define (assuming your model is called Todo): var todos: Todo If Todo has some properties like title, isCompleted, etc. declare variables in your view model as: var title: String { todo.title } var isCompleted: Bool { todo.isCompleted } Then you can do your logic in your SwiftUI view that has declared the view model to call viewModel.isCompleted. But if you modify the view model properties, they will not be persisted until you define it back, e.g.: // E.g. todo.isCompleted = true todo.title = viewModel.title try? context.save()
Replies
Boosts
Views
Activity
Jun ’25
Reply to Add App Group to Existing SwiftData App
You don't need to define that in your @Model class. Instead, in the main app, you have: let container: ModelContainer init() { let schema = Schema([YourModelName.self]) // Your model name inside let modelConfiguration = ModelConfiguration(schema: schema, allowsSave: true) do { container = try ModelContainer(for: schema, configurations: [modelConfiguration]) print("Model Container created successfully.") } catch { fatalError("Could not create Model Container: \(error.localizedDescription)") } } Then in your widget, in the timeline provider declare the variable for the model container: var container: ModelContainer = { try! ModelContainer(for: YourModelName.self) }() Then you need to just define your getEntries() function that returns an array of entries accordingly var descriptor = FetchDescriptor<YourModelName> let allEntries = try?container.mainContext.fetch(descriptor) return allEntries ?? [] // Empty array if it throws Don't forget to add the App Groups under the Signing & Capabilities tab for both the main app target and widget extension. Make sure it is the same one, e.g. group.com.yourcompany.YourAppName in both. Build it and make sure it is white and not in red for the App Groups.
Replies
Boosts
Views
Activity
Jun ’25
Reply to AlarmMetadata struct
Thanks! Just tested and that’s likely the fix. Or adding nonisolated to the struct works if the Default Actor Isolation is main actor.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Jun ’25
Reply to Live Activity fails to start with "unsupportedTarget" error on iOS 18 beta
Hi, the live activity function should look something like: func startLiveActivity() { let attributes = TimerAttributes(/*…*/) let contentState = TimerAttributes.ContentState(/*…*/) Task { @MainActor in do { let activity = try Activity<TimerAttributes>.request( attributes: attributes, content: ActivityContent(state: contentState, staleDate: staleDate), pushType: nil ) self.activity = activity } catch { print("Failed to start Live Activity: \(error)") } } } My TimerAttributes - this is your attributes for Live Activity, defined as: struct TimerAttributes: ActivityAttributes { public struct ContentState: Codable, Hashable { /* content state variables */ } /* other variables here */ } so when ever you call your start, you have to call your Live Activity start function. I place it in a Live Activity Manager.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’25
Reply to Using App Intents in Live Activity to Pause a Timer
The solution is found. To use buttons in LA or Dynamic Island, it shouldn’t be AppIntent, it should be LiveActivityIntent. struct PauseIntent: LiveActivityIntent { // followed by the rest of the code } either load the user defaults data that is linked with App Group or use SwiftData/CoreData, inject model container, and save the updated state there. Then update the live activity, the LA or Dynamic Island will show the updated ContentState. When returning to the app, reload the data from the data store and rebuild the necessary view models.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’25