Post

Replies

Boosts

Views

Activity

Reply to Unable to install iOS & watchOS app to iPhone, because of intents change
It would be extremely helpful if even ONE person who has used intents would respond and try and work through this with me. Maybe one of Apple's developers would like to jump in? Right now, I cannot submit this app to App Store Connect - despite the iOS app, Home Screen widgets, Lock Screen widgets, Watch app and complications all working - because Xcode shows me an error that cannot be fixed. If I have to wait for Apple to get around to looking at my bug report I'll likely have expired. There has to be a very simple solution to this, but it has escaped me for days now, and it's driving me to depression. Thanks a bunch, Xcode.
Oct ’22
Reply to Pass data to a child component in SwiftUI
That's not how you pass something to AnotherScreen(), or any other function. AnotherScreen() has a String var called name. You need to pass in something for that var. Your preview is going to send a name which is a String var into AnotherScreen(), so because it's a preview and you don't have name anywhere in the preview struct you would use something like this: struct AnotherScreen_Previews: PreviewProvider {     static var previews: some View {         AnotherScreen("Dave")     } } // or struct AnotherScreen_Previews: PreviewProvider { let name: String = "Dave"     static var previews: some View {         AnotherScreen(name)     } } For your actual usage, i.e. where you're passing through Eric, that should work fine as it is because you're passing through the name var: AnotherScreen(name: $name).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’22
Reply to Unable to install iOS & watchOS app to iPhone, because of intents change
FB11738182 and FB11741770. Just to clarify the current situation... In the General tab of the project view: Main iOS app has both supported intents listed (WidgetEventIntent and ComplicationEventIntent). Widget target does not have any supported intents because there is no section to add them. WidgetIntentHandler has both intents listed. Watch App has only the ComplicationEventIntent. Complications target does not have any supported intents because there is no section to add them. ComplicationsIntentHandler has only the ComplicationEventIntent. In target membership: ComplicationsEntry.swift which uses the ComplicationEventIntent is only in Complications. ComplicationEventIntent is in Watch App, Complications and ComplicationEventIntent. ComplicationsIntentHandler.swift is in Complications and ComplicationsIntentHandler. WidgetEntry.swift which uses the WidgetEventIntent is only in Widget. WidgetEventIntent is in Widget and WidgetIntentHandler. WidgetIntentHandler.swift is in Widget and WidgetIntentHandler. With this setup I can successfully deploy to the iOS Simulator (iOS 16.1), the watchOS Simulator (watchOS 9.1) and also to a physical iPhone 14 Pro Max (iOS 16.1) and Watch S8 (watchOS 9.1). This works. However, when I attempt to archive the app for sending to App Store Connect I get these errors: Asset validation failed - Intents Extension Issue. The intent "ComplicationEventIntent" is in multiple intents extensions, but it can only be in one. (ID: 83c75017-0631-4903-90c7-8486a0f39285) and Asset validation failed - Intents Extension Issue. The intent "WidgetEventIntent" is in multiple intents extensions, but it can only be in one. (ID: 3860ed6f-41cc-47fd-ab49-28d4fbe6136c) So, even though Xcode lets me deploy to both the Simulator and physical devices, the archive fails App Store Connect validation. It says they can't be in multiple intents extensions, but if I remove ComplicationEventIntent from the WidgetIntentHandler target (in the General tab of the project view) I can't deploy to the Simulator because: Please try again later. Siri Intents in the WatchKit app com.company.appname.watchkitapp are not a subset of the Siri Intents in the companion app com.company.appname And neither can I deploy to physical devices because: This app contains a WatchKit app with one or more Siri Intents app extensions that declare IntentsSupported that are not declared in any of the companion app's Siri Intents app extensions. WatchKit Siri Intents extensions' IntentsSupported values must be a subset of the companion app's Siri Intents extensions' IntentsSupported values. So one of these things is wrong. I've also tried removing the Complications target to simplify things (even though that's just a com.apple.widgetkit-extension and not a com.apple.intents-service) and putting the code files in the main Watch App target, but the complications wouldn't appear on the Watch because you can't have two @mains, and removing the complications one just stopped them working at all. I'd appreciate any help you can give because I've spent months working on this massive upgrade to the app and Watch app and I can't actually release it because of conflicting errors in Xcode (Version 14.1 (14B47b)).
Nov ’22
Reply to Weird behaviour of a NSLayoutConstraint used with Size Class variation when app going background
If your app goes into the background the system can kill it. How long are you leaving it in the background? Put this line in viewDidLoad() and see what happens when you bring the app to the foreground: heightConstraint.constant = 100. Maybe also put a print("viewDidLoad was executed") in there to see that the method is called. You're only setting the constraint's constant when you press a button, so maybe the redraw of the view is setting it back to what the storyboard says to use? (The above isn't a fix, it's a diagnostic to see where the issue lies. You'll have to figure out how to restore the state if the above is proven correct.)
Topic: UI Frameworks SubTopic: UIKit Tags:
Nov ’22
Reply to Unable to install iOS & watchOS app to iPhone, because of intents change
I've just tried removing the Complications extension target and the ComplicationsIntentHandler target, and putting the complications views inside the Widget target. I have a ton of #if os(watchOS) everywhere, and I now don't get complications on the Watch. Going back to the version before I removed the Complications targets, look at this page: https://developer.apple.com/documentation/widgetkit/creating-lock-screen-widgets-and-watch-complications?language=objc It says: "Add Lock Screen Widgets to Your Existing iOS App If your iOS app supports widgets that appear on the Home Screen or in Today View, support Lock Screen widgets by adding the appropriate accessory widget family to the list of supported widgets you declare." I added my Lock Screen widgets to the Widget target, and they worked fine. The Widget target successfully showed Home Screen widgets and used the WidgetIntentHandler. That page also says: "Add WidgetKit Complications to Your Existing watchOS App In case your existing watchOS app doesn’t offer complications, add a watchOS widget extension to your project in Xcode, and create complications with WidgetKit." This suggests to me that both Widgets and Complications should be in their own extension targets, not in the same one. Well, mine did use complications before, but I decided to drop support for the older ClockKit stuff and just go with the new watchOS 9 stuff. That page suggests you add a new target - that's what I did, I added the Complications target. But if I try to use the same intent handler with both the Widget extension and the Complications extension Xcode says I can't use the same intent in more than one extension. So I created a duplicate of the widget intent handler for the Complications, and Xcode doesn't like that either. Basically, I can't use: A Widget extension with its own intent handler, and a Complications extension with its own intent handler. A Widget extension and a Complications extension that share the same intent handler. A Widget extension with its own intent handler and no complications (because complications apparently have to be in their own widget extension). It's a trash bin. Xcode should be better than this. Your documentation should be better than this. Xcode is giving me conflicting errors, and there's no clear way of supporting widgets and complications with the same or indeed different intents. Xcode lets me deploy to the Simulator and physical devices with one configuration, then says it's not valid to go to the App Store. I change it according to what the error messages suggest, and then I can't deploy to the Simulator or devices anymore. How am I supposed to work with this?!
Nov ’22
Reply to SwiftUI beginner question "cannot infer contextual base in reference to member"
Your problem is in the if ... else statement. The dot-notation .foregroundColor.green is used when you're accessing the properties of an object. In this case you want to get the green property of the foregroundColor, but you then want to assign it to something, and if you look at the code in one line you'll see the problem: if <condition> .foregroundColor.green else .foregroundColor.red You're trying to set the foregroundColor of the if statement. you should do it this way: struct ContentView: View { @State private var phoneNumber = " " let fgColor = (okTime > nowTime) ? Color.green : Color.red // Use a ternary operator (`if <condition> ? true : false`) here to set the color before assigning it to the button's label var body: some View { Button { callout(phoneNumber) } label: { Text("Using function to call") .foregroundColor(fgColor) // Use the variable you created above, and assign it to the foregroundColor property of the Text() } } }
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’22
Reply to How to delete business old address on apple map?
These are the Developer Forums, so not really the place for your question, but have you tried actually reporting an issue in the Maps app? Just tap/click the pin for your business and tap "Report an issue". There's an option there to have your issue followed up by email. Alternatively, you can provide feedback here. You can enter your email address on there and they might get back to you.
Topic: Business & Education SubTopic: General Tags:
Nov ’22