Post

Replies

Boosts

Views

Activity

Reply to SKTestSession configurations broken?
@Frameworks Engineer This seems to be broken in iOS 27.0 (Beta 2). Refer: https://developer.apple.com/forums/thread/836842 Suggestion: It would be great if Apple could have test cases to ensure it passes for every release so that this doesn't have to be caught by developers.
Topic: StoreKit SubTopic:
StoreKit, In-App Purchase, and App Store Server API Q&A
Jul ’26
Reply to Pass data to an @Observable model
@ChrisDE Questions Should CarDetailViewModel be created in CarDetailView? Or should CarDetailViewModel be created in ContentView and passed to CarDetailView? Code ContentView struct ContentView: View { @State private var selectedCarID: UUID? var body: some View { NavigationSplitView { CarListView(selectedCarID: $selectedCarID) } detail: { if let selectedCarID { CarDetailView(carID: selectedCarID) } } } } CarListViewModel @Observable class CarListViewModel { let cars = [ Car(id: UUID(), name: "aaa"), Car(id: UUID(), name: "bbb") ] } CarListView import SwiftUI struct CarListView: View { @Binding var selectedCarID: UUID? @State var model = CarListViewModel() var body: some View { List(model.cars, selection: $selectedCarID) { car in VStack(alignment: .leading) { Text(car.name) Text("\(car.id)") } } } } CarDetailViewModel @Observable class CarDetailViewModel { let carID: UUID init(carID: UUID) { self.carID = carID } } CarDetailView import SwiftUI struct CarDetailView: View { @State private var model: CarDetailViewModel init(carID: UUID) { let model = CarDetailViewModel(carID: carID) _model = State(wrappedValue: model) } var body: some View { Text("\(model.carID)") } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’26
Reply to Pass data to an @Observable model
@ChrisDE Consider the following model @Observable class Model { let id: Int init(id: Int) { self.id = id } } Should the model be created in the parent view (as @State property in parent view) and passed to the detail view? Or should I create model in the detail view (as @State property in the detail view)? But this id needs to come from the parent view.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’26
Reply to How to manage TestFlight subscriptions on macOS?
If you are using TestFlight, then Sandbox would be used. To clear purchase history in sandbox please follow instructions in https://developer.apple.com/documentation/storekit/testing-in-app-purchases-with-sandbox#Clear-the-purchase-history-for-a-Sandbox-Apple-Account For me personally clearing purchase history didn't work https://developer.apple.com/forums/thread/829459 Please let me know if it works / doesn't work for you, thanks!
Topic: App & System Services SubTopic: StoreKit Tags:
Jul ’26
Reply to SKTestSession configurations broken?
@Frameworks Engineer This seems to be broken in iOS 27.0 (Beta 2). Refer: https://developer.apple.com/forums/thread/836842 Suggestion: It would be great if Apple could have test cases to ensure it passes for every release so that this doesn't have to be caught by developers.
Topic: StoreKit SubTopic:
StoreKit, In-App Purchase, and App Store Server API Q&A
Replies
Boosts
Views
Activity
Jul ’26
Reply to Pass data to an @Observable model
@ChrisDE Questions Should CarDetailViewModel be created in CarDetailView? Or should CarDetailViewModel be created in ContentView and passed to CarDetailView? Code ContentView struct ContentView: View { @State private var selectedCarID: UUID? var body: some View { NavigationSplitView { CarListView(selectedCarID: $selectedCarID) } detail: { if let selectedCarID { CarDetailView(carID: selectedCarID) } } } } CarListViewModel @Observable class CarListViewModel { let cars = [ Car(id: UUID(), name: "aaa"), Car(id: UUID(), name: "bbb") ] } CarListView import SwiftUI struct CarListView: View { @Binding var selectedCarID: UUID? @State var model = CarListViewModel() var body: some View { List(model.cars, selection: $selectedCarID) { car in VStack(alignment: .leading) { Text(car.name) Text("\(car.id)") } } } } CarDetailViewModel @Observable class CarDetailViewModel { let carID: UUID init(carID: UUID) { self.carID = carID } } CarDetailView import SwiftUI struct CarDetailView: View { @State private var model: CarDetailViewModel init(carID: UUID) { let model = CarDetailViewModel(carID: carID) _model = State(wrappedValue: model) } var body: some View { Text("\(model.carID)") } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’26
Reply to Pass data to an @Observable model
@ChrisDE Consider the following model @Observable class Model { let id: Int init(id: Int) { self.id = id } } Should the model be created in the parent view (as @State property in parent view) and passed to the detail view? Or should I create model in the detail view (as @State property in the detail view)? But this id needs to come from the parent view.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’26
Reply to Auto-renewable subscription says “Item already owned” when same Apple ID uses different app accounts
Could you check the following: Transaction.currentEntitlements to get latest status https://developer.apple.com/documentation/storekit/transaction/currententitlements Transaction.updates is a way for you to observe transactions. https://developer.apple.com/documentation/storekit/transaction/updates
Replies
Boosts
Views
Activity
Jul ’26
Reply to How to manage TestFlight subscriptions on macOS?
If you are using TestFlight, then Sandbox would be used. To clear purchase history in sandbox please follow instructions in https://developer.apple.com/documentation/storekit/testing-in-app-purchases-with-sandbox#Clear-the-purchase-history-for-a-Sandbox-Apple-Account For me personally clearing purchase history didn't work https://developer.apple.com/forums/thread/829459 Please let me know if it works / doesn't work for you, thanks!
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
Jul ’26