Post

Replies

Boosts

Views

Created

About AR Anchor's Orientation (Some Issues and Other Things)
I've been playing around with ARKit and I am interested in the orientation of ARGeoAnchor, ARImageAnchor and ARFaceAnchor. First of all, I notice that Apple says that ARGeoAnchor is based on an East-North-Up orientation, with its x- and z-axes matching the longitude and latitude directions. This should actually be characterized as an East-Up-South orientation (see https://developer.apple.com/documentation/arkit/arconfiguration/worldalignment/gravityandheading). I created an image to illustrate my point. It's the ferry building. Referring to the ARKit 4 presentation (wwdc20-10611), one can see that the 'Ferry Building' label is initially facing south and needs to be rotated by approximately -51.4 degrees about the y axis in order to face in the proper direction. As far as ARImageAnchor is concerned, it appears to me that the coordinate system is as in the below image. This is surprising to me as I would have expected it to be x to the right, y pointing up in the image and z pointing out of the image. It appears that ARPlaneAnchor's orientation is the same as ARImageAnchor. As far as ARFaceAnchor is concerned, its orientation is clearly explained in https://developer.apple.com/documentation/arkit/arfaceanchor and the orientation seems consistent to me. I wish that the other anchors were explained as well. Anyway, feel free to chime in with corrections and comments.
1
0
796
Oct ’22
iCloud Private Relay Messes Up Map Search on macOS
I'm using my Mac and have macOS 13.0. I searched for 'Vinyl Record Shops' and 'Search Nearby' with Private Relay Enabled and the Map moved to Denver, Colorado while I am in Orlando, Florida. When I disable Private Relay, the search did take me to Orlando, Florida, but when I disabled it just now, it took me to Dallas / Ft Worth. I have 'Maintain General Location' selected. I don't have this issue with iOS 16.1 on my iPhone. Anybody else have this problem?
1
0
619
Nov ’22
Please Create a Sendable Version of CKRecord or Make CKRecord Sendable
CKRecord is a class which does not conform to the Sendable protocol. Its fields consist of NSStrings, NSData and others which are not Sendable. I understand that Apple is incrementally modifying objects to be sendable, but I am experiencing and I would assume others are experiencing a very large number of warnings (for now) about CKRecords and Sendable. It may be too much to make CKRecord Sendable and it may be too much to create a Sendable version of CKRecord, but it would be nice if it could at least be investigated. My particular situation is I have created a Protocol named CKMethods which some of my view controllers use to download and upload CKRecords. I suddenly have a large number of warnings about non-sendable types being sent from main actor-isolated context to non-isolated instance method. The CKRecords sent to and from the protocol do not get mutated and I have never had a problem with data races in the years that I have had this protocol. At some point, the warnings will probably become errors and I definitely do not want to get to that point. I am still coming up to speed on Swift Concurrency, so there may be a more simple solution than the one I am working on - creating a Sendable Struct for every CKRecord type that I have in my app and modifying all of the methods to pass the Struct instead of a CKRecord and convert the Struct to a CKRecord for upload and convert the CKRecord to the Struct for download.
3
1
1.9k
Apr ’23
Deleting then Replacing CKRecords of a Certain Type - Mixed Results
I am working on an update to one of my apps. The app uses CloudKit and utilizes the Public and Private databases. The user data is stored in the Private database. I have created methods to convert from CKRecords of the user's type to Codeable Structs and encode in json format and decode the json data into the array of Structs. I also have a method to create a CKRecord of the user's type from the Struct data. I am working on giving the user the option of replacing the CKRecords in the cloud with CKRecords created from a json file. I have a method which deletes all of the CKRecords followed by a method which uploads the CKRecords created from the json data. If I wait a while after this operation without using the app, it works well. But if I try to access the saved CKRecords shortly after the methods are executed, I have mixed results. Sometimes, I get less than what I uploaded and sometimes I get more than what I uploaded. I use try await on both methods and use the return value of the first method (delete) as an input into the second method (upload). Both the delete and upload methods use modifyRecords(saving: saveRecords, deleting: recordIDs, savePolicy: .allKeys, atomically: false) I do not use the modifyRecords method to do both at the same time. I use two modifyRecords methods. In all cases, the results show that the operations completed successfully even when there was an issue. I'd like for the delete method to delete all of the data and for the upload method to upload all of the json data without requiring an excessive delay.. Any advice would be most appreciated.
1
0
459
Apr ’23
Core Data Plus CloudKit - Potential Issue / Question about Binary Data w/ External Storage
I added Core Data to my app. My core data model has an Entity with 3 Binary Data attributes with external storage along with other attributes. I saved an array of data to core data and when I examine the result on CloudKit Dashboard, I see two of the three data record fields are of type Bytes and one is of type CKAsset. Looking at a particular piece of data in the cloud (I added Queryable to recordName), I see the CKAsset data as 'Binary File (645.17KB)' and the Bytes data as '77+9UE5HDQ (660.66KB)'. Will this pose a problem? Why isn't the data all CKAssets in CloudKit? Will the Bytes record field hold enough data? Searching the web, I've see others having problems with Binary Data and Core Data Plus CloudKit in the past, but nobody has mentioned this specific result.
4
1
1.7k
Apr ’23
Xcode Automatically Managing Signing Yet Invalid Profile
I have used Xcode for app signing since its inception. Before that, I managed signing like everybody else did - manually. Today I uploaded the iOS version of my app fine, but when I tried to upload the macOS version, I got the following. Invalid Provisioning Profile Signature. The provisioning profile included in the bundle com.blablabla.BlaBla [com.blablaba.BlaBla.pkg/Payload/BlaBla.app] cannot be used to submit apps to the Mac App Store until it has a valid signature from Apple. For more information, visit the macOS Developer Portal. This is the first time that I've gotten this error. I am probably missing something simple. At least, I hope that I am. Can anybody help me? I am using Xcode 14.3.
3
2
3.2k
Apr ’23
CKAssets Download Even When desiredKeys Excludes Them
I have an app with a CloudKit Public Database in which a CKRecord can contain a CKAsset or two that holds the url of image data. I don't want to always obtain the image data so my desiredKeys excludes the CKAsset key in the CKRecord in that case. I use the following Swift function. var (matchResults, queryCursor) = try await database.records(matching: query, desiredKeys: desiredKeys) The desiredKeys variable could be an array of strings with the keys of CKRecord fields I want to return or nil if I want all of the data including the asset data. After I have the records, I do the following. if let imageAsset = record["ImageAsset"] as? CKAsset, let url = imageAsset.fileURL, let data = try? Data(contentsOf: url) { self.imageData = data } However, when I exclude the "ImageAsset" key from the desiredKeys array, my if let imageAsset contains the asset information. Looking at the received data, I can see that other keys that I exclude are not being downloaded, but the CKAsset url appears to be downloaded. Why? I expected that the if let would have been nil and the code within the if let would not have been executed.
3
0
930
May ’23
SwiftData, CloudKit and UIKit - Updating View When Data Changes
I have SwiftData and CloudKit working on a new version of my UIKit app. The current version uses CoreData/CloudKit I have a question. How does one know when there there is new or deleted data to update a view in a UIKit app with SwiftData? CoreData has NSPersistentStoreRemoteChangeNotificationOptionKey. What does SwiftData have that's equivalent? It's not feasible to redo my whole app to use SwiftUI at this stage.
1
1
1.4k
Jun ’23
SwiftUI MagnifyGesture Suggestion
I am testing out the new MagnifyGesture SwiftUI feature. My suggestion is to bring the view being magnified to the top of all views in the hierarchy while it is being magnified. I've submitted the suggestion in Feedback Assistant. Any comments on this suggestion?
0
0
399
Jul ’23
Xcode Version 15.0 beta 5 (15A5209g), SwiftData Problem - "The given data was not valid JSON."
I have an app that uses Core Data and CloudKit that I am trying to convert into a SwiftData CloudKit app. Things were working very well until this most recent beta (beta 5) of Xcode 15.0. I have image data which the app saves as Data in external storage. I let Xcode convert my Core Data model in to a SwiftData model. As I said, things were working well. I could turn the image data into an Image for SwiftUI. That is, until beta 5. With beta 5, I get the following. SwiftData/BackingData.swift:210: Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: "The given data was not valid JSON." Well the data is NOT JSON, it is image data and yet, I get this fatal error. Does anybody else see this? I have saved data using the app on the beta 5 simulator using SwiftData and I have verified that the data is correct using my core data app. The images are fine.
11
6
2.5k
Jul ’23