Post

Replies

Boosts

Views

Activity

Reply to Increased number of CKErrorServerRejectedRequest
I can actually able to occasionally reproduce the problem in the Development environment as well, running my app in the simulator with Xcode. I can inspect the error given, and it seems to contain a couple of interesting things in the userInfo dictionary: [0] (null) @"ContainerID" : @"BXXXXXXX.com.mycontainer.identifier" [1] (null) @"NSUnderlyingError" : domain: @"CKInternalErrorDomain" - code: 2000 [2] (null) @"CKHTTPStatus" : (long)500 [3] (null) @"NSDebugDescription" : @"CKInternalErrorDomain: 2000" [4] (null) @"RequestUUID" : @"2DCA0896-557A-4F0C-A331-4F58BC6EB86D" [5] (null) @"OperationID" : @"19F0BF027F05095D" Just recreating the same operation and sending to CloudKit seems to work ... but will continue testing.
Oct ’23
Reply to VisionOS app with UIKit : error with window visibility
Thanks. The firstScene object isn't nil, until it's windows or keyWindow properties are both nil. Could that be the problem? This is what the object looks like in the debugger: <UIWindowScene: 0x106b0ef40; role: UIWindowSceneSessionRoleApplication; activationState: UISceneActivationStateForegroundActive> { session = <UISceneSession: 0x600001793200; persistentIdentifier: com.myapp.name> { configuration = <UISceneConfiguration: 0x600001794c40; name: 0x0>; }; delegate = (nil); screen = <UIScreen: 0x10711b1a0; bounds: {{0, 0}, {1366, 1024}}; mode: <UIScreenMode: 0x600000268bc0; size = 2732.000000 x 2048.000000>>; } I never adopted the UIScenes and UIWindowsScene APIs from iOS13+, and I run my iOS app as a single-window app. Would I have to change that to be able to run my app as a native VisionOS app?
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’23
Reply to Delay in CKRecord uploads
After more research, it seems like the issue with 'CKQueryOperations' specifically, whether from the device or from web dashboard. If I fetch using CKFetchOperations, either from the device or from dashboard, with fixed RecordIDs, it works soon after the update is done. So it seems like some issue with indexing on the CloudKit side. How do we that fixed? I have mentioned the containerID in the feedback report that is linked above
Jan ’24
Reply to EntityPropertyQuery with property from related entity
Hi, Yes I get the same results on a new project. I have created an example project and attached it here. It's based on a basic Core Data app, with an "Item" entity, that has a one-to-many relationship with a "Tag" entity. When I convert these into "App Entities", I can create a query for the properties of the "Item" entity, and another query for the "Tags" entity, but I can't figure out how to create a query in "Item" that would also look for associated 'tags'. I can't seem to attach a zip file containing the app project to this post for some reason. But the code is fairly simple. This is the Item AppEntity: import Foundation import AppIntents struct ItemsAppEntity: AppEntity { static var defaultQuery = ItemsAppEntityQuery() var id: String @Property(title: "Timestamp") var timestamp: Date @Property(title: "Tags") var tags: [CJTagItemsAppEntity] static var typeDisplayRepresentation = TypeDisplayRepresentation(name: "Test Item") var displayRepresentation: DisplayRepresentation { DisplayRepresentation(title: "\(timestamp.formatted())") } struct ItemsAppEntityQuery: EntityPropertyQuery { static var sortingOptions = SortingOptions { SortableBy(\ItemsAppEntity.$timestamp) } typealias ComparatorMappingType = NSPredicate static var properties = QueryProperties { Property(\ItemsAppEntity.$timestamp) { LessThanComparator { NSPredicate(format: "timestamp < %@", $0 as NSDate) } GreaterThanComparator { NSPredicate(format: "timestamp > %@", $0 as NSDate) } } // HOW TO ADD SEARCH-BY-TAGNAME ... this does't work Property(\CJTagItemsAppEntity.$tagName, entityProvider: { item in return item.tags.first! }) { EqualToComparator {name in let predicateFormat = "tagName == '\(name)'" return NSPredicate(format: predicateFormat) } } } func entities(for identifiers: [ItemsAppEntity.ID]) async throws -> [ItemsAppEntity] { return [] } func entities(matching comparators: [NSPredicate], mode: ComparatorMode, sortedBy: [EntityQuerySort<ItemsAppEntity>], limit: Int?) async throws -> [ItemsAppEntity] { return [] } } } This is the Tags AppEnttiy: struct CJTagItemsAppEntity: AppEntity { static var defaultQuery = CJTagItemsAppEntityQuery() var id: String @Property(title: "Name") var tagName: String static var typeDisplayRepresentation = TypeDisplayRepresentation(name: "Test Tag") var displayRepresentation: DisplayRepresentation { DisplayRepresentation(title: "\(tagName)") } struct CJTagItemsAppEntityQuery: EntityPropertyQuery { static var sortingOptions = SortingOptions { SortableBy(\CJTagItemsAppEntity.$tagName) } typealias ComparatorMappingType = NSPredicate static var properties = QueryProperties { Property(\CJTagItemsAppEntity.$tagName) { EqualToComparator {name in let predicateFormat = "tagName == '\(name)'" return NSPredicate(format: predicateFormat) } } } func entities(for identifiers: [CJTagItemsAppEntity.ID]) async throws -> [CJTagItemsAppEntity] { return [] } func entities(matching comparators: [NSPredicate], mode: ComparatorMode, sortedBy: [EntityQuerySort<CJTagItemsAppEntity>], limit: Int?) async throws -> [CJTagItemsAppEntity] { return [] } } } I haven't implemented any methods properly ... I'm just trying to get the syntax right for this. Thanks.
Topic: Machine Learning & AI SubTopic: General Tags:
Jul ’24
Reply to Disable new tab bar look
FWIW, I recently got a response through Feedback assistant saying that the new UITabBarController behavior is "functioning as intended" and suggests that the best option would be to hide the UITabBarController and create a custom control to get the old functionality again. I personally find it very unreasonable to change the behavior of something that's been working fine for 17 years and replace it with something that's a confusing ill-thought-out mess, and not offer an opt-in / opt-out. But there you go. At least we have a few weeks to come up with alternatives.
Topic: UI Frameworks SubTopic: General Tags:
Aug ’24
Reply to CLLocationManager: getting kCLErrorDenied in widget
I fixed it by resetting the "Location and Privacy" settings on my iPhone!
Replies
Boosts
Views
Activity
Sep ’23
Reply to Increased number of CKErrorServerRejectedRequest
I can actually able to occasionally reproduce the problem in the Development environment as well, running my app in the simulator with Xcode. I can inspect the error given, and it seems to contain a couple of interesting things in the userInfo dictionary: [0] (null) @"ContainerID" : @"BXXXXXXX.com.mycontainer.identifier" [1] (null) @"NSUnderlyingError" : domain: @"CKInternalErrorDomain" - code: 2000 [2] (null) @"CKHTTPStatus" : (long)500 [3] (null) @"NSDebugDescription" : @"CKInternalErrorDomain: 2000" [4] (null) @"RequestUUID" : @"2DCA0896-557A-4F0C-A331-4F58BC6EB86D" [5] (null) @"OperationID" : @"19F0BF027F05095D" Just recreating the same operation and sending to CloudKit seems to work ... but will continue testing.
Replies
Boosts
Views
Activity
Oct ’23
Reply to VisionOS app with UIKit : error with window visibility
Thanks. The firstScene object isn't nil, until it's windows or keyWindow properties are both nil. Could that be the problem? This is what the object looks like in the debugger: <UIWindowScene: 0x106b0ef40; role: UIWindowSceneSessionRoleApplication; activationState: UISceneActivationStateForegroundActive> { session = <UISceneSession: 0x600001793200; persistentIdentifier: com.myapp.name> { configuration = <UISceneConfiguration: 0x600001794c40; name: 0x0>; }; delegate = (nil); screen = <UIScreen: 0x10711b1a0; bounds: {{0, 0}, {1366, 1024}}; mode: <UIScreenMode: 0x600000268bc0; size = 2732.000000 x 2048.000000>>; } I never adopted the UIScenes and UIWindowsScene APIs from iOS13+, and I run my iOS app as a single-window app. Would I have to change that to be able to run my app as a native VisionOS app?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’23
Reply to VisionOS app with UIKit : error with window visibility
This is still not resolved with Xcode 15.1 Beta3. I created a I created FB13325773 with a sample project, so it's a problem for 'new' projects as well.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to VisionOS app with UIKit : error with window visibility
The issue still persists with Xcode 15.2 Beta 1. Just to reiterate: I created FB13325773 with a sample project
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to Delay in CKRecord uploads
After more research, it seems like the issue with 'CKQueryOperations' specifically, whether from the device or from web dashboard. If I fetch using CKFetchOperations, either from the device or from dashboard, with fixed RecordIDs, it works soon after the update is done. So it seems like some issue with indexing on the CloudKit side. How do we that fixed? I have mentioned the containerID in the feedback report that is linked above
Replies
Boosts
Views
Activity
Jan ’24
Reply to VisionOS app with UIKit : error with window visibility
After much time wastage, it turns out that the problem is caused by setting the window's backgroundColor (for some reason). So it works fine after commenting out this line: self.mainWindow.backgroundColor = [UIColor systemBackgroundColor];
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jan ’24
Reply to Is there a limit for CKFetchRecordsOperation?
I discovered that the limit is 400 records at a time (just like CKModifyRecordsOperation).
Replies
Boosts
Views
Activity
Jan ’24
Reply to SwiftUI List crash with @FetchRequest and @ObservedObject
I managed to avert the problem by adding DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { ... before deleting the object and saving the context. I guess that gives the underlying view time to coalesce all the updates properly. Still feels like a little hacky, so would be great if there was a better solution to this.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’24
Reply to SwiftUI crash only in iOS16.0 and iOS16.1
Just for reference: Apple DTS acknowledged a crash issue with SwiftUI Lists (specifically with section headers) that was fixed in iOS16.2. Ideally, this would have been documented or mentioned somewhere so I could've set the minimum deployment target to 16.2.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Jul ’24
Reply to Disable new tab bar look
Has anyone checked out if there's something in iOS18 Beta4 that can help out with this issue?
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’24
Reply to EntityPropertyQuery with property from related entity
Hi, Yes I get the same results on a new project. I have created an example project and attached it here. It's based on a basic Core Data app, with an "Item" entity, that has a one-to-many relationship with a "Tag" entity. When I convert these into "App Entities", I can create a query for the properties of the "Item" entity, and another query for the "Tags" entity, but I can't figure out how to create a query in "Item" that would also look for associated 'tags'. I can't seem to attach a zip file containing the app project to this post for some reason. But the code is fairly simple. This is the Item AppEntity: import Foundation import AppIntents struct ItemsAppEntity: AppEntity { static var defaultQuery = ItemsAppEntityQuery() var id: String @Property(title: "Timestamp") var timestamp: Date @Property(title: "Tags") var tags: [CJTagItemsAppEntity] static var typeDisplayRepresentation = TypeDisplayRepresentation(name: "Test Item") var displayRepresentation: DisplayRepresentation { DisplayRepresentation(title: "\(timestamp.formatted())") } struct ItemsAppEntityQuery: EntityPropertyQuery { static var sortingOptions = SortingOptions { SortableBy(\ItemsAppEntity.$timestamp) } typealias ComparatorMappingType = NSPredicate static var properties = QueryProperties { Property(\ItemsAppEntity.$timestamp) { LessThanComparator { NSPredicate(format: "timestamp < %@", $0 as NSDate) } GreaterThanComparator { NSPredicate(format: "timestamp > %@", $0 as NSDate) } } // HOW TO ADD SEARCH-BY-TAGNAME ... this does't work Property(\CJTagItemsAppEntity.$tagName, entityProvider: { item in return item.tags.first! }) { EqualToComparator {name in let predicateFormat = "tagName == '\(name)'" return NSPredicate(format: predicateFormat) } } } func entities(for identifiers: [ItemsAppEntity.ID]) async throws -> [ItemsAppEntity] { return [] } func entities(matching comparators: [NSPredicate], mode: ComparatorMode, sortedBy: [EntityQuerySort<ItemsAppEntity>], limit: Int?) async throws -> [ItemsAppEntity] { return [] } } } This is the Tags AppEnttiy: struct CJTagItemsAppEntity: AppEntity { static var defaultQuery = CJTagItemsAppEntityQuery() var id: String @Property(title: "Name") var tagName: String static var typeDisplayRepresentation = TypeDisplayRepresentation(name: "Test Tag") var displayRepresentation: DisplayRepresentation { DisplayRepresentation(title: "\(tagName)") } struct CJTagItemsAppEntityQuery: EntityPropertyQuery { static var sortingOptions = SortingOptions { SortableBy(\CJTagItemsAppEntity.$tagName) } typealias ComparatorMappingType = NSPredicate static var properties = QueryProperties { Property(\CJTagItemsAppEntity.$tagName) { EqualToComparator {name in let predicateFormat = "tagName == '\(name)'" return NSPredicate(format: predicateFormat) } } } func entities(for identifiers: [CJTagItemsAppEntity.ID]) async throws -> [CJTagItemsAppEntity] { return [] } func entities(matching comparators: [NSPredicate], mode: ComparatorMode, sortedBy: [EntityQuerySort<CJTagItemsAppEntity>], limit: Int?) async throws -> [CJTagItemsAppEntity] { return [] } } } I haven't implemented any methods properly ... I'm just trying to get the syntax right for this. Thanks.
Topic: Machine Learning & AI SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’24
Reply to Disable new tab bar look
FWIW, I recently got a response through Feedback assistant saying that the new UITabBarController behavior is "functioning as intended" and suggests that the best option would be to hide the UITabBarController and create a custom control to get the old functionality again. I personally find it very unreasonable to change the behavior of something that's been working fine for 17 years and replace it with something that's a confusing ill-thought-out mess, and not offer an opt-in / opt-out. But there you go. At least we have a few weeks to come up with alternatives.
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to Disable new tab bar look
Is there anyone on this thread who is running iOS18.1 Beta 3 on their device that has noted any changes to the iPad tab bar behavior?
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to SwiftUI: listSectionSeparator not working on macOS
It would be great if anyone can chime in to confirm / suggest a workaround. I filed FB14190656 a few months ago, with a reproducible example. Still haven't heard back.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’24