The solution was lifting out navigationTitle and toolbar. I got lucky guessing.. can't imagine it's supposed to work like this.
someView
.sheet(isPresented: $isShowingViewer, content: {
imageViewer
.navigationTitle("Image viewer")
.toolbar(content: {
ToolbarItem(placement: .confirmationAction, content: {
imageViewerToolbar
})
})
})
Post
Replies
Boosts
Views
Activity
I figured it out. Just wish I had looked into the build log in the first place... I guess it didn't have much to do the with Watch target, just the code I copy pasted. Anyways, it seems appintentsmetadataprocessor failed because of a custom type I had created.
2023-04-12 17:07:44.429 appintentsmetadataprocessor[74428:4172175] warning: At least one halting error produced during export. No AppIntents metadata have been exported and this target is not usable with AppIntents until errors are resolved.
2023-04-12 17:07:44.429 appintentsmetadataprocessor[74428:4172175] warning: 'typeDisplayRepresentation' must directly instantiate a 'TypeDisplayRepresentation'
This works:
static var typeDisplayRepresentation = TypeDisplayRepresentation(name: "Prüfung")
This doesn't:
static var typeDisplayRepresentation : TypeDisplayRepresentation = .init(name: "Prüfung")
Yeah
I tried again yesterday and it wouldn't even turn up in the simulator anymore.
Later I managed to check out a much earlier version, implement a simple test intent there and have it show up in the Shortcuts app (slightly earlier commits had the same problem). Going back to my current working state and pasting the same test intent there, it suddenly worked as expected again. Now I tried figuring out, what made the behavior occur in the first place and replicated my steps from the first time around:
It happens right after trying to add AppIntents on the WatchOS target. They won't show up there and those on the iOS side will stick around for a while, even if all AppIntents code is completely removed. New intents added on the iOS side won't show up at all. A while later the zombified intents disappear as well, leaving the state I described in my initial post (intents I saw on the simulator there, were from before I had tried adding some on WatchOS). All subsequent builds have this problem. I tried deleting DerivedData, Caches, switching around Xcode versions. Nothing works. Now even going to my early commit and back again does nothing. Guess I'll just have to wait?
Somebody, please help :(
You can't directly call a function like that. Both apps, WatchOS and iOS, are seperate from each other. You'd need to set up a Watch Connectivity Session, send a message from your iOS app and have the Watch app react to it by vibrating.
I've found some posts saying I'd have to enable logging first by installing the sysdiagnose profile on Watch. Is that still the case? Ofc that would be pretty impractical for the end user and I'd have to look for a different solution.
Instead of abusing one of the mentioned APIs, I simply set up the Watch app to send messages non-stop at a short interval. I can lock the phone and use my connected device just fine, no inconsistencies or anything. Would this approach make it through app review?