This is my first post and I was unsure of what was needed exactly.
Here is my code:
import StoreKit
import SwiftData
import SwiftUI
struct AddItemView: View {
@Environment(\.requestReview) var requestReview`
var body: some View {
NavigationStack {
VStack {
Form {
...
}
}
}
}
@MainActor
func showReview() {
itemsCreated += 1
if itemsCreated == 10 {
requestReview()
}
}
}
If anything else is needed, please let me know and I will do my best to include it.