Post

Replies

Boosts

Views

Activity

Reply to Do I need to have the full app built, submitted and approved to launch pre-order?
Not really, no. You can't buy an app that isn't available, and I doubt Apple want to act as an Escrow account until you finally release your app. You could take orders on your own website, and provide customers with a promo code that lets them download the app for free, but there'a a limit on the number, so I wouldn't even contemplate that. Just market your service/app beforehand, and let people know a release date when it's confirmed. (Also, don't be building stuff right up to the last minute; you need to test things properly.)
Sep ’22
Reply to Cannot find the Watchkit Extension folder
At the top of your project view (on the left) is the "heart" item. That's your project. Click on that and you should see the project plus an app as a target. Here's what I have listed: PROJECTS: "MyApp" TARGETS: "MyApp", "MyApp Watch App" Previously, iOS apps with a companion watchOS app would look like this: PROJECTS: "MyApp" TARGETS: "MyApp", "MyApp WatchKit", "MyApp WatchKit Extension" "MyApp WatchKit" would contain the storyboard that laid out how the app would look on the Watch, and "MyApp WatchKit Extension" held the code that dealt with data and updated the interface. If you're writing a watchOS app you no longer need a WatchKit Extension because the interface and code are all in the same place. You may find it easier to work from some sample code from Apple, such as this: Adding widgets to the Lock Screen and watch faces
Sep ’22
Reply to How to handle this situation with data that changes while it's on-screen
D'you know? If you just go to bed and sleep for ten hours, the answer comes to you. Here's how to do it: var newMode: Int = modelData.mode // Get the initial value from the model struct SettingsView: View { @EnvironmentObject var modelData: ModelData // Get access to the model data @State private var mode = newMode // Create a @State var with the initial value var body: some View { ScrollView { SettingsView_Display(mode: $mode) // Send the value to the subview .onChange(of: modelData.mode) { value in // When the value in the modelData changes, update mode and newMode. Because mode is a @State var it updates the subview, which redraws it. mode = value newMode = value } } } } } struct SettingsView_Display: View { @Binding var mode: Int // Here's the bound value var body: some View { Picker("Mode", selection: $mode) { // Create a picker with the bound value Text("0").tag(0) Text("1").tag(1) Text("2").tag(2) .pickerStyle(.navigationLink) .onChange(of: mode) { value in // When the mode is changed by the user using the picker, update the newMode value newMode = value } .onChange(of: modelData.mode) { value in // When the mode is changed here, update the mode and newMode values mode = value newMode = value } // Not gonna lie, some of that might seem overkill, but it works } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’22
Reply to To determine If user have not added any fingerprints or faceID using Local authentication.
If the user hasn't enrolled their face or fingerprints, or biometric authentication on their device is broken, or they've turned it off, then you will be told that authentication isn't available - and that's exactly what you want. You shouldn't need to be told that they've not added any fingerprints; you just need to know whether or not they can authenticate with it. Leave the minute of its setup to the user and the operating system.
Topic: Privacy & Security SubTopic: General Tags:
Oct ’22
Reply to Is it possible to create a custom data protection view on a Lock Screen widget?
You can detect whether the state is privacy sensitive and show a different view, rather than letting the modifier do the work. Get the redaction reasons from the environment, and do something else: struct MyView: View { @Environment(\.redactionReasons) var redactionReasons var body: some View { if(redactionReasons.contains(.privacy) || redactionReasons.contains(.placeholder)) { Text("I'm redacted") } else { Text("I'm unredacted") } } }
Topic: App & System Services SubTopic: Core OS Tags:
Oct ’22
Reply to Images not rendering in new iOS 16 Widgets?
Can you give us a screenshot to show what it looks like? Have you tried removing .widgetAccentable()? Try adding this: .renderingMode(.template). Might do something, might not. I had an issue with a standard SF Symbol. It would render as a block instead of the actual image, which might be what's happening to you.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’22