Post

Replies

Boosts

Views

Activity

unable to mutate struct var
I am not having any luck mutating a var in a structure, and yes, the method is defined as 'mutating' here's the struct definition: struct OnboardingSwipeableView: View{ static var shared = OnboardingSwipeableView() @State var currentPage = 0 var lock = NSLock() <snip> here's the method: mutating func goToNextPage(){ currentPage = self.currentPage+1 print("OBM->goToNestPage: currentPage=\(self.currentPage)") } however currentPage is not being updated. What gives?
1
0
195
Sep ’24
Getting rid of Siri's "Something went wrong" message
I am working on an app that links into Siri with Appintents. The user gives a command, the app is launched, does some magic and returns, via Siri ,custom success or fail messages. Most of the time. However, sometimes Siri kicks in its own "Something went wrong, please try again message". But something hasn't gone wrong. How can I stop those and ensure our own messages dependably make it through, regardless. The only thing is that there might be timeout issue, but usually our operation is completed after only a couple of seconds. Doesn't look good during investor demos.
0
0
244
Aug ’24
Contents of Swift dictionaries and arrays being lost
Just when I think I am finally starting to understand Swift I come across a gotcha like the following: I have two object, a swiftui display and one of data to be displayed. Ok, sounds easy. The data is read out of a JSON file so I have a set of arrays and dictionaries. The data is valid when read, it is definitely there, but when I go to display it, its gone. Just vanished. Wasted about a day on this so far, and I’ve seen it before, the inability to pass out of an object an array or dictionary with contents intact. If I create an array var, and not let the system do it, contents are preserved. So, in the data object I’ll have something like this: struct DataObject{ var item: [String:Any] item=JSONData serialized out of memory, and may have say, 12 fields } In my SwiftUI module I have: var item=dataObject.item dataObject.item now has 0 fields. I can allocate and initialize a dictionary in DataObject and those elements come through fine. So it seems like the stuff being serialized from JSON is being deleted out from under me.
3
0
437
Jul ’24
muting SIRI via AppIntents
We're using App Intents to launch are control our app via Siri. Siri's responses have been fairly random, some with a "Done" popup, others with a verbal confirmation, others saying "I'm sorry, there's been a problem". The latter is bogus and doesn't look good to potential investors when the app is actually working fine. There appears to be no way in code that I've been able to find so far that would have been tell Siri to STFU. Let us handle our own errors. Otherwise is there a means to supply Siri with a dictionary of restored messages that could be triggered inside the app?
1
0
583
Jul ’24
App Intents vs. Lock Screen
I've been working on a project with App Intents and have hit a complete wall. The desire is to have an app that allows a person to place an order of something and have that order processed while in lock screen without any intervention. Is that workflow possible without having to unlock the screen? Under what circumstances can a task be handled without unlocking the device. Going over some of the documentation about older custom intents strongly implies that this was possible under certain circumstances.
1
0
616
May ’24
staged files not really being staged
I am in a weird twilight-zone of a git problem in xcode. I specify some files to be staged and it fails to do with no warning of any sort. So I cannot commit them or apply stashed changes to them. I can do it one.file.at.a.time. I have over 11k intermediate files that .gitignore won't ignore, nor stage nor commit to do anything so I could stop tracking them.
0
0
288
May ’24
VisionOS Destination question
I've been pouring over the code for Apple's visionOS demo: "Destination" trying to figure out something about its skybox. (not really a box, there, Apple). The skybox contains a 360deg panorama, but only one half shows with the other half fades out to nothing. I cannot find anywhere there is an alpha channel being set, a lighting or material effect causing that. But "alpha" doesn't show up and the only gradients are use to make controls standout a little more in its window. I need a full panorama that shows., no fading.
1
0
643
Jan ’24
xcode not completely removing a build from the device when pushing a new build
This started a couple of months ago. Every new build I send from Xcode over to my iPad appears to leave data from the previous build, which seems like it's cached somewhere and never used after that. Considering I am losing about 500M per session I get the device "out of memory" error often. Deleting my app completely erases everything so I can recover. More of an annoyance than critical bug, except when running my iPad mini. I have a 16G mini and normally only have about 2G free. Naturally that gets eaten up about every 3 or 4 runs. When I clear out things I have to reset a bunch of preferences to my test set. Waste of time. It doesn't do this when I launch from the device, only when Xcode is doing it. This is with iOS14 and Xcode 12.2B2. But seems to go back to the final days of Xcode 11 on my mac. Anyone else see this?
0
0
667
Oct ’20