Post

Replies

Boosts

Views

Activity

New async await CloudKit Methods - What do you think?
Anybody converting from CKQueryOperation to the new CloudKit async await methods? If so, what do you think? I'm currently playing with func records(matching query: CKQuery, inZoneWith zoneID: CKRecordZone.ID? = nil, desiredKeys: [CKRecord.FieldKey]? = nil, resultsLimit: Int = CKQueryOperation.maximumResults) async throws -> (matchResults: [(CKRecord.ID, Result<CKRecord, Error>)], queryCursor: CKQueryOperation.Cursor?) and func records(continuingMatchFrom queryCursor: CKQueryOperation.Cursor, desiredKeys: [CKRecord.FieldKey]? = nil, resultsLimit: Int = CKQueryOperation.maximumResults) async throws -> (matchResults: [(CKRecord.ID, Result<CKRecord, Error>)], queryCursor: CKQueryOperation.Cursor?) They seem to work fine and eliminate completion handlers.
0
0
1.6k
Nov ’21
Reality Kit - Move Function Not Working.
I want to move an Entity in from the right programmatically, but the move function is not working. I am using image tracking. I can place the entity statically, so I know I'm detecting the image. Here is my function. func placeMyPictureEntity(imageAnchor: ARImageAnchor) {         if let entity = try? Experience.loadMyScene() {             entity.scale = SIMD3(0, 0, 0)             let imageAnchorEntity = AnchorEntity(anchor: imageAnchor)             imageAnchorEntity.name = imageAnchor.name!             // Position the entity to the side             let anchorWidth = Float(imageAnchor.referenceImage.physicalSize.width)             entity.setPosition(SIMD3<Float>(x: 20.0*anchorWidth , y: 0.0, z: 0.0), relativeTo: imageAnchorEntity)             let newTransform = Transform(scale: SIMD3(20.0, 20.0, 20.0), rotation: simd_quaternion(0, 0, 0, 1), translation: SIMD3(x: anchorWidth, y: 0.0, z: 0.0))             entity.move(to: newTransform, relativeTo: imageAnchorEntity, duration: 2.0, timingFunction: .easeIn)             imageAnchorEntity.addChild(entity)             // Add anchor to scene             arView.scene.addAnchor(imageAnchorEntity)         }     } Any help would be most appreciated. Thanks.
0
0
627
Mar ’22
Frame Rotation versus Object Rotation
Anybody else come from an Aerospace background? In aerospace, the vector is stationary and the frame is rotated, for the most part, whereas here, the frame is stationary and the vector is rotated. Opposite rotations. It would be nice to have one document which discusses all of the reference frames with cartoons showing the axes. The Ferry Building example helped me a great deal when I looked at a map of the Ferry Building area and realized that the cardinal axis that location anchors are pretended is South (along the z axis). Makes sense. That's why it needed to be rotated by -51.4 degrees.
0
0
519
Mar ’22
Attributed Text Missing Tint Color on Image after Creating From CloudKit Bytes
I've created a simple project which uses CloudKit to store an attributed text as Bytes (Data) The attributed text includes an image with an orange tint color. In my simple project, I have two labels, one for the attributed text which I am loading into CloudKit (putLabel) and one for the attributed text created from the CloudKit data record (getLabel). The putLabel shows the orange image correctly, but the getLabel with attributed text downloaded from the iCloud data shows it as a black image. No tint color. Anybody have any ideas on how to get an attributed text with tint color from CloudKit? Here's the archive code \\ Convert into Data data = try? NSKeyedArchiver.archivedData(withRootObject: mainString, requiringSecureCoding: false) and here's the unarchiver code newStr = try? NSKeyedUnarchiver.unarchivedObject(ofClass: NSMutableAttributedString.self, from: data) The code snippets are missing some things, but they work.
0
0
888
Jul ’22
AttributeGraph: cycle detected through attribute - ScrollView The Cause
I have a number of 'AttributeGraph: cycle detected through attribute' console messages. On a whim, I commented out the two ScrollViews which I have in the app and the messages stopped. I set a symbolic breakpoint at 'print_cycle' to break when the attribute graph cycle is detected. Sure enough, the ScrollView has become the first responder. #5 0x0000000184488a1c in ___lldb_unnamed_symbol120650 () #6 0x00000001849efd94 in ___lldb_unnamed_symbol168748 () #7 0x00000001849ed128 in ___lldb_unnamed_symbol168728 () #8 0x00000001849ec26c in ___lldb_unnamed_symbol168655 () #9 0x00000001849ec400 in ___lldb_unnamed_symbol168660 () #10 0x0000000184baa210 in ___lldb_unnamed_symbol185453 () #11 0x0000000184baa260 in ___lldb_unnamed_symbol185454 () #12 0x00000001a277ed60 in -[UIResponder _setFirstResponder:] () #13 0x00000001a2b29d38 in -[UIView _setFirstResponder:] () #14 0x00000001a277ed50 in -[UIResponder _setFirstResponder:] () #15 0x00000001a2b29d38 in -[UIView _setFirstResponder:] () #16 0x00000001a2ad55ac in -[UIScrollView _becomeFirstResponder] () I can't remove the ScrollViews, so I wonder if there is anything I can do about this.
0
1
1.2k
Jul ’22
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
UICalendarView on Mac Catalyst - Command Key for Multiple Date Selection
A good while back, I created a Mac Catalyst version of an app. The app uses UICalendarView for both iOS and Mac. I have multiple date selection enabled. In the past, I thought I could select multiple dates on the Mac without needing to use the Command key modifier. And now I can't. Is this a change or am I dreaming? How can I go back to being able to select multiple dates without using the command key modifier?
0
0
511
Aug ’23
Xcode 15 RC - CKError: Account temporarily unavailable due to bad or missing auth token
I have two apps which uses the CloudKit public folder so that my users can access data. There's also a private database for them to save data. One is supposed to be able to access the public database without being logged into an iCloud account. And it was working fine. But now, with the simulator, I get the titled error message. It's fine on a device. But, if I log into the simulator with my iCloud account, I can access the public data.
0
0
625
Sep ’23
Text Above List w/ VStack Appears as View's Title
I am curious about the fact that the Text above the VStack is shown as a title to the view. I didn't know one could place Text above a VStack without another VStack. Here's the partial code showing the situation. @State private var results = [Result]() var body: some View { Text("Songs of Al Di Meola on iTunes") .font(.title3) .fontWeight(.bold) List(results, id: \.trackId) { item in VStack(alignment: .leading) { Text(item.trackName) .font(.headline) Text(item.collectionName) } } .task { await loadData() } } See picture for details.
0
0
461
Jul ’24
Apple CloudKit async function Doesn't Look Right
The function in question is the following. func records(for ids: [CKRecord.ID], desiredKeys: [CKRecord.FieldKey]? = nil) async throws -> [CKRecord.ID : Result<CKRecord, Error>] Note that the returned value looks like a dictionary of the form [CKRecord.ID : Result<CKRecord, Error>], but the input is an array of CKRecord.IDs. There are similar functions, but they return a tuple. Like the below example. func records(matching query: CKQuery, inZoneWith zoneID: CKRecordZone.ID? = nil, desiredKeys: [CKRecord.FieldKey]? = nil, resultsLimit: Int = CKQueryOperation.maximumResults) async throws -> (matchResults: [(CKRecord.ID, Result<CKRecord, Error>)], queryCursor: CKQueryOperation.Cursor?) Note that matchedResults is an array of tuples consisting of [(CKRecord.ID, Result<CKRecord, Error>)]. I would have thought that the return type in the first function would also be of the form [(CKRecord.ID, Result<CKRecord, Error>)]. What am I missing?
1
0
1.4k
Jan ’22