Post

Replies

Boosts

Views

Activity

Reply to How to determine point on phone screen where a user is looking at, by using data from ARKit FaceAnchor
 but haven't been able to get it to work correctly. Could you explain: what you get how far it is from what you expect in which use case ? (e.g., when user is not looking straight ahead) the code where you compute from lookAtPoint to point on screen I would try to : 1. get the device coordinates in world coordinates (using ARConfiguration.WorldAlignment.gravity) 2. find the face coordinates in the world coordinates (with ARFaceAnchor.transform property) you have lookAtPoint which gives the direction in face coordinates transforming with 1 and 2, you should get the point looked at in device coordinates. This threads links to some useful resources https://developer.apple.com/forums/thread/118048
Topic: App & System Services SubTopic: Core OS Tags:
Mar ’21
Reply to enumeratingSubviewsCount error
Could you show the code that crashes ? I found a reference to the same issu (that's in french)e: https ://forum.macbidouille. com/index.php?showtopic=418944&st=0&p=4357981&#entry4357981 It seems to be linked to /System/Library/PreferencePanes/Dock.prefPane Note: Why would you have to add so many levels of subviews ? 2 to the 6th power is 64.
Topic: UI Frameworks SubTopic: AppKit Tags:
Mar ’21
Reply to How to read property list (binary format) if the iOS fails to load it via NSPropertyListSerialization
I hope you will find useful information here. It notably details Binary plist structure. https ://medium. com/@karaiskc/understanding-apples-binary-property-list-format-281e6da00dbd Have you tried to read the binary in a text editor ? Note: the article dates 2018, so not iOS 14. So there may have been some changes, but I assume (hope) it has remained essentially the same. Good luck. Thanks to feedback.
Topic: App & System Services SubTopic: General Tags:
Mar ’21
Reply to IOS 14.4.1 not working w/BMWX32020
That's not a question for the forum (no one here has the power to change iOS or your BMW software). Note: did you test in another car ? You'd better either: wait for a new iOS release contact Apple Support file a bug report. Good luck. And don't forget to close the thread once done.
Topic: App & System Services SubTopic: Core OS Tags:
Mar ’21
Reply to Index Out of Range
In my previous answer I told you: But the real point is to check if voti2.count is ever more than zero. If not, that confirms there is a design flaw. This is what must be corrected. You did not answer to this. Did you check how voti2 is initialised ? I changed it to this, but when I press Add, the simulator freezes Normal. Before the change, you crashed at first pass in the loop, before infinite loop ! You don't crash anymore, but you enter an infinite while loop. BTW: that means that at start, mediaEffettivaInt mediaFloatInt is true. In addition, looks like this code is flawed: while(mediaEffettivaInt mediaFloatInt){ for j in nVoti..nVoti + testInt - 2{ voti[j] = voti2[j - nVoti]; } mediaEffettiva = mediaEffFunzione(dim: nVoti + testInt) if mediaEffettiva mediaFloat && voti2.isValidIndex(con) { voti2[con] += 0.5 } con = con + 1 if con = testInt { con = 0 } } mediaEffettivaInt and mediaFloatInt do not change in the loop: so either you never enter the loop or you loop indefinitely. You do need to analyse and correct your code. Note: you should select names that are more meaningful: mediaEffettivaInt and mediaEffettiva : difficult to understand at first glance what is what (both are Int)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to Xcode User Interface Builder: Do correctly configured XIB examples exist?
I don't know of such material. It looks like Apple is no more focusing on this and counts on the forum(s) (this one and other) for "community education". So the best is to ask questions on the forum when you have design doubts or want to be challenged on one of your xib designs (but forum does not accepts images, which make things even harder to explain, unless you can provide a link on imgur or other).
Mar ’21
Reply to List row stay selected after back
May have a look here on how to select an item. https://stackoverflow.com/questions/60139184/swiftui-navigationlink-macos-default-selected-state Similar principle should allow to deselect all as well. See also this other thread: https://developer.apple.com/forums/thread/663562
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to IOS 14.4.1 not working w/BMWX32020
When I said "not a question for the forum", it is just because forum is about development, not use of products; even though someone may have experienced the same issue and provide some help, this forum is not the right place : there would be a risk to saturate forum with questions on products at the detriment of real developers needs. So we should all refrain from this. So...how do you file a bug report? Go to Feedback Assistant: https://feedbackassistant.apple.com The link is at the very bottom of this page, in Support section Feedback & Bug Reporting You have also a link for contact. Have a good day.
Topic: App & System Services SubTopic: Core OS Tags:
Mar ’21
Reply to swift code optimization and replaceSubrange issue
I understand you want to keep the same number of elements in array u ? So this writing is a bit risky (even though correct). It would probably be safer to write for i in Int(0.5/dx)...Int(1/dx+1) { u[i] = 2.0 } Otherwise I do not see problem, except that some var could have more explicit names (dx, dt, quite explicit, but nx and nt or u could be more explicit).
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to Newbie: how to talk to USB serial device from my app?
Could you show the code you tried so far ? If that can help, here is an example to retrieve information of an USB disk. import Foundation func findRemovableVolumes() - [URL] { var allMountedURL = [URL]() let keys: [URLResourceKey] = [.volumeNameKey, .volumeIsRemovableKey, .volumeIsEjectableKey] let paths = FileManager().mountedVolumeURLs(includingResourceValuesForKeys: keys, options: []) if let urls = paths { for url in urls { let components = url.pathComponents if components.count 1 && components[1] == "Volumes" { allMountedURL.append(url) } } } return allMountedURL } func buildFileURL(driveUrl: URL) - URL { let fileName = "My file" let fileURL = driveUrl.appendingPathComponent(fileName).appendingPathExtension("txt") return fileURL } func getSerialAndSize(_ url: URL) - (String, Int, Bool) { var officialVendor = false if let session = DASessionCreate(nil) { if let disk : DADisk = DADiskCreateFromVolumePath(nil, session, url as CFURL) { // We found a mount point... let ioService : io_service_t = DADiskCopyIOMedia(disk) let key = "USB Serial Number" let options : IOOptionBits = IOOptionBits(kIORegistryIterateParents) | IOOptionBits(kIORegistryIterateRecursively) if let sSerial : CFTypeRef = IORegistryEntrySearchCFProperty(ioService, kIOServicePlane, key as CFString, nil, options) { let dico: CFDictionary = DADiskCopyDescription(disk)! let vendor = (dico as NSDictionary)["DADeviceVendor"] as? String ?? "--" officialVendor = vendor == "VendorCo" let driveCapacity = (dico as NSDictionary)["DAMediaSize"] as? Int ?? 0 return (String(describing: sSerial), driveCapacity, officialVendor) } else { return ("", 0, false) } } } return ("", 0, false) }
Topic: App & System Services SubTopic: Core OS Tags:
Mar ’21