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
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
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
SwiftUI Gobbling Up CPU
I have beel fiddling with SwiftUI and it has taken up a huge amount of CPU %. Has anybody else experienced this? It it takes forever to build. I think I have it confused.My Xcode is shut down, but I still have two swift processes running at 98%.Something wrong here....
9
0
7.9k
Mar ’22
Apple Watch App - Invalid Swift entry point data
For iOS 14 and watchOS 7.0, I completely recoded and modernized my app using Swift (was Objective C). I am almost done and am most proud of the job, but I have this issue that I need to fix on the Apple Watch app. I am not able to transfer data to the Apple Watch from the iPhone and get the following console messages. (The [xxx:xxxxxx] are my modification of the console messages.). I am guessing that the first 2 messages are the thing I need to fix and I need to fix this issue before I submit the app. 2020-09-24 08:29:02.873423-0400 WatchApp Extension[xxx:xxxxxx] [default] lookupMainFuncAddressInMachHeader:71: Invalid Swift entry point data 2020-09-24 08:29:02.874413-0400 WatchApp Extension[xxx:xxxxxx] [default] lookupMainFuncAddressInMachHeader:77: Swift entry point addres could not be determined. 2020-09-24 08:29:04.001368-0400 WatchApp Extension[xxx:xxxxxx] [WC] denying activation due to missing delegate ExtensionDelegate: your iphone is Reachable ExtensionDelegate: Session activated 2020-09-24 08:29:10.884500-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated 2020-09-24 08:29:15.046379-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate 2020-09-24 08:29:15.047176-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate 2020-09-24 08:29:15.047860-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate 2020-09-24 08:29:15.782075-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated 2020-09-24 08:29:24.390293-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated 2020-09-24 08:31:57.059417-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated 2020-09-24 08:32:00.055282-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated InterfaceController: your iphone is Reachable 2020-09-24 08:32:00.058230-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated 2020-09-24 08:32:08.427192-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated 2020-09-24 08:32:13.374677-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate 2020-09-24 08:32:13.375717-0400 WatchApp Extension[xxx:xxxxxx]] [WC] WCSession is missing its delegate 2020-09-24 08:32:13.376426-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate 2020-09-24 08:32:51.861915-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated
20
0
8.0k
May ’22
UIBarButtonItem With Image Breaks Constraints
I have a UIViewController wherein I set nav items, basically the title and the rightBarButtonItem. I use a SF Symbol for the image. The code is extremely simple. Here it is. func setupNavItem() {         self.navigationItem.title = "Problem in This View"                  let helpImage = UIImage(systemName: "questionmark.circle")         let rightBarItem = UIBarButtonItem(image: helpImage, style: .plain, target: self, action: #selector(showHideHelp))         navigationItem.rightBarButtonItem = rightBarItem     } When I navigate into this view, all heck breaks loose with the constraints. What gives? I'm using Xcode Version 14.0 beta 3 (14A5270f). See the constraint info below. 2022-07-18 16:58:59.998394-0400 NavBarItemExample[28793:996095] [LayoutConstraints] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want.  Try this:  (1) look at each constraint and try to figure out which you don't expect;  (2) find the code that added the unwanted constraint or constraints and fix it.      "<NSLayoutConstraint:0x600000a79810 UIImageView:0x136d28790.width <= _UIModernBarButton:0x136d274b0.width   (active)>",     "<NSLayoutConstraint:0x600000a7af80 '_UITemporaryLayoutWidth' _UIButtonBarButton:0x136d27280.width == 0   (active)>",     "<NSLayoutConstraint:0x600000a793b0 'IB_Leading_Leading' H:|-(>=11)-[_UIModernBarButton:0x136d274b0]   (active, names: '|':_UIButtonBarButton:0x136d27280 )>",     "<NSLayoutConstraint:0x600000a79400 'IB_Trailing_Trailing' H:[_UIModernBarButton:0x136d274b0]-(8)-|   (active, names: '|':_UIButtonBarButton:0x136d27280 )>" ) Will attempt to recover by breaking constraint  <NSLayoutConstraint:0x600000a79810 UIImageView:0x136d28790.width <= _UIModernBarButton:0x136d274b0.width   (active)> Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
3
0
1.1k
Jul ’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
NavigationStack - No Back Button
I created a very simple project with a NavigationStack and a NavigationLink as follows. Code 1. NavigationLink("Go To Next View", value: "TheView")          .navigationDestination(for: String.self) { val in Text("Value = \(val)")          } This code works fine in the simple project. But when I put this simple code into my existing app's project using a NavigationStack, it navigates to the next view fine, but there is no back button. I am updating my Apple Watch target to use SwiftUI and I want to use NavigationStack. My app does use @ObservedObject and my important data is using @Publish in a singleton class which conforms to ObservableObject. But this NavigationLink code, Code 1, is extremely simple and should work fine, but it does not. The same problem happens with the following code. Code 2 NavigationLink { NextView() } label: {     MainRowView(rowText: "Saved") } When I switch to NavigationView, Code 1 is grayed out, but Code 2 works fine and has a back button. However, as you know, NavigationView is being deprecated, so I really need to fix this or have it fixed. I can't see how this could be a problem with my code as the code snippet is so simple and worked in the simple project.
4
0
2.6k
Aug ’22