Post

Replies

Boosts

Views

Activity

Reply to NSCollectionLayoutBoundarySupplementaryItem background blur covering the entire layout section
There's certainly some issues with the sticky headers. I was seeing crashes in my analytics and now also locally that appear to be related with the headers (_updatePinnedSectionSupplementaryItemsForCurrentVisibleBounds is in the stack trace): ObjCRuntime.ObjCException: Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Frame {{inf, inf}, {0, 0}} does not intersect {{0, 0}, {654, 4779}} Native stack trace: 0 CoreFoundation 0x00000001888b18dc __exceptionPreprocess + 176 1 libobjc.A.dylib 0x000000018838a418 objc_exception_throw + 88 2 Foundation 0x000000018a9f53cc -[NSMutableDictionary(NSMutableDictionary) initWithContentsOfFile:] + 0 3 AppKit 0x000000018dc6d91c _NSPinnedFrameForFrameWithContainerFrameVisibleFrame + 1288 4 AppKit 0x000000018dc734dc _NSPinnedNonOverlappingFramesForContentFrameVisibleFrame + 284 5 AppKit 0x000000018d55655c -[_NSCollectionLayoutAuxiliaryItemSolver _solveForPinning:visibleRect:] + 1604 6 AppKit 0x000000018d62c2ac -[_NSCollectionCompositionalLayoutSolver updatePinnedSectionSupplementaryItemsForVisibleBounds:] + 432 7 AppKit 0x000000018d9d9d10 -[NSCollectionViewCompositionalLayout _updatePinnedSectionSupplementaryItemsForCurrentVisibleBounds] + 112 8 AppKit 0x000000018d9d73a4 -[NSCollectionViewCompositionalLayout invalidateLayoutWithContext:] + 504 9 AppKit 0x000000018d7880e0 -[NSCollectionViewLayout invalidateLayout] + 68 10 AppKit 0x000000018d78bd90 -[NSCollectionViewLayout _invalidateLayoutUsingContext:] + 60 11 AppKit 0x000000018d8f622c -[_NSCollectionViewCore setBounds:] + 572 12 AppKit 0x000000018daa0114 -[NSCollectionView _clipViewFrameChanged:] + 396 13 CoreFoundation 0x000000018885b484 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148 14 CoreFoundation 0x00000001888bff34 ___CFXRegistrationPost_block_invoke + 92 15 CoreFoundation 0x00000001888bfe78 _CFXRegistrationPost + 436 16 CoreFoundation 0x0000000188839f9c _CFXNotificationPost + 740 17 AppKit 0x000000018cc8635c -[NSView _postFrameChangeNotification] + 240 18 AppKit 0x000000018d92628c -[NSView setFrameSize:] + 1472 19 AppKit 0x000000018d27f6f4 -[NSClipView setFrameSize:] + 176 20 AppKit 0x000000018d9265c8 -[NSView setFrame:] + 300 21 AppKit 0x000000018da86034 -[NSScrollView _setContentViewFrame:] + 248 22 AppKit 0x000000018da86314 -[NSScrollView _applyContentAreaLayout:] + 444 23 AppKit 0x000000018cca79e4 -[NSScrollView tile] + 480 24 AppKit 0x000000018cca77d8 -[NSScrollView _tileWithoutRecursing] + 52 25 AppKit 0x000000018ccdb868 -[NSScrollView _update] + 24 26 AppKit 0x000000018d926080 -[NSView setFrameSize:] + 948 27 AppKit 0x000000018da88574 -[NSScrollView setFrameSize:] + 200 28 AppKit 0x000000018d9265c8 -[NSView setFrame:] + 300 29 AppKit 0x000000018d925714 -[NSView resizeWithOldSuperviewSize:] + 488 30 AppKit 0x000000018d925304 -[NSView resizeSubviewsWithOldSize:] + 360 31 AppKit 0x000000018d926080 -[NSView setFrameSize:] + 948 32 AppKit 0x000000018d757014 -[NSTabView setFrameSize:] + 88 33 AppKit 0x000000018d9265c8 -[NSView setFrame:] + 300 34 AppKit 0x000000018d925714 -[NSView resizeWithOldSuperviewSize:] + 488 35 AppKit 0x000000018d925304 -[NSView resizeSubviewsWithOldSize:] + 360 36 AppKit 0x000000018d926080 -[NSView setFrameSize:] + 948 37 AppKit 0x000000018d9265c8 -[NSView setFrame:] + 300 38 AppKit 0x000000018dcdee60 -[NSPageController _setupTransitionHierarchyWithSourceView:frame:destinationView:frame:forDirection:destinationValid:] + 1256 39 AppKit 0x000000018dcdb2b4 -[NSPageController _animateView:frame:toView:frame:direction:] + 248 40 AppKit 0x000000018dcdbd38 -[NSPageController _navigateToIndex:animated:] + 944 41 AppKit 0x000000018da606f0 +[NSAnimationContext runAnimationGroup:] + 56 42 AppKit 0x000000018da607a4 +[NSAnimationContext runAnimationGroup:completionHandler:] + 100 43 AppKit 0x000000018dcdbe70 -[NSPageController navigateBack:] + 260
Topic: UI Frameworks SubTopic: AppKit Tags:
4w
Reply to NSCollectionLayoutBoundarySupplementaryItem background blur covering the entire layout section
My supplementary view is a simple NSView with a centered NSTextField - I don't do custom drawing in drawRect: and setting clipsToBounds to true didn't help. The blur and shade is coming from the NSCollectionView. One this that seems to mitigate the artifact a bit is to call invalidateLayout on the collectionViewLayout with a 100ms delay in the pageController:prepareViewController:withObject: delegate method of NSPageController - but it's a hacky workaround
Topic: UI Frameworks SubTopic: AppKit Tags:
Oct ’25
Reply to UIMenuElementAttributesKeepsMenuPresented not working when Glass Grouping changes
Thanks for your response. You can find an example project here (https://1drv.ms/u/c/9ff2ada21b6e758d/EchgHRMV9CpPhDWa5H3qQI8Bca72rFWsDCXVrTLnVAKEGw?e=HMiScu) or see the example code below. As you can see, the menu collapses when clicking the "Only favorites" menu action, even though .keepsMenuPresented is provided final class FiltersVC: UIViewController { lazy var barItem = UIBarButtonItem(image: UIImage(systemName: "line.3.horizontal.decrease"), menu: makeFilterMenu()) private var isFilterActive = false override func viewDidLoad() { super.viewDidLoad() let other = UIBarButtonItem(systemItem: .add, primaryAction: UIAction { _ in }) navigationItem.leftBarButtonItems = [barItem, other] // if we only had one bar button item, the menu would not collapse after clicking "Only favorites" } private func makeFilterMenu() -> UIMenu { let a1 = UIAction(title: "Only favorites", attributes: [.keepsMenuPresented], state: isFilterActive ? .on : .off) { [weak self] action in guard let self = self else { return } isFilterActive = !isFilterActive; barItem.style = isFilterActive ? .prominent : .plain // this causes the menu to collapse despite .keepsMenuPresented barItem.menu = makeFilterMenu() } let a2 = UIAction(title: "Some other action") { _ in } return UIMenu(title: "Filter", options: [.displayInline], children: [a1, a2]) } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’25
Reply to Issue with geolocation without using maps
I am also experiencing unreliable geofence entry & exit events since iOS 18. With iOS 17, I didn't need to use a CLServiceSession at all, now even when using one, it's unreliable. I also see the same behavior of the events timestamp to be the current time, and not the time of actual geofence entry. I made sure the app has the "Always" permission but I did not set the new NSLocationRequireExplicitServiceSession key in the Info.plist (I tested it, but couldn't see any change in the reliability) What I am confused about is whether to start a CLServiceSession if the app is restarted in the background. Apple is not clear about it. In the WWDC session they say: ... So your job, ..., is to make sure that your process launch logic knows what features it has been tasked with pursuing, and re-takes session objects... https://developer.apple.com/videos/play/wwdc2024/10212?time=758 But on the other hand it's also said that: you can only start holding one (a CLServiceSession) when your app is in the foreground https://developer.apple.com/videos/play/wwdc2024/10212?time=522 and also ... CLMonitor.events won’t yield results when it is not in use, unless a session which was started in the foreground, .... https://developer.apple.com/videos/play/wwdc2024/10212?time=663 It is also not clear if we need to use CLLocationManager.allowsBackgroundLocationUpdates (which is documented as "Apps that receive location updates when running in the background must include the UIBackgroundModes key (with the location value) in their app’s Info.plist file"). However, in my tests, doing so didn't yield any improvement (and as I said, in iOS 17 it wasn't required either). @Engineer what makes me doubt this being the cause for the unreliability of the geofencing is that it worked perfectly with iOS 17.
Nov ’24
Reply to CLMonitor does not always trigger on entry
I am also experiencing unreliable geofence entry & exit events since iOS 18. With iOS 17, I didn't need to use a CLServiceSession at all, now even when using one, it's unreliable. I also see the same behavior of the events timestamp to be the current time, and not the time of actual geofence entry. I made sure the app has the "Always" permission but I did not set the new NSLocationRequireExplicitServiceSession key in the Info.plist (I tested it, but couldn't see any change in the reliability) What I am confused about is whether to start a CLServiceSession if the app is restarted in the background. Apple is not clear about it. In the WWDC session they say: ... So your job, ..., is to make sure that your process launch logic knows what features it has been tasked with pursuing, and re-takes session objects... https://developer.apple.com/videos/play/wwdc2024/10212?time=758 But on the other hand it's also said that: you can only start holding one (a CLServiceSession) when your app is in the foreground https://developer.apple.com/videos/play/wwdc2024/10212?time=522 and also ... CLMonitor.events won’t yield results when it is not in use, unless a session which was started in the foreground, .... https://developer.apple.com/videos/play/wwdc2024/10212?time=663 It is also not clear if we need to use CLLocationManager.allowsBackgroundLocationUpdates (which is documented as "Apps that receive location updates when running in the background must include the UIBackgroundModes key (with the location value) in their app’s Info.plist file"). However, in my tests, doing so didn't yield any improvement (and as I said, in iOS 17 it wasn't required either).
Nov ’24
Reply to Clarification on the correct use for CLServiceSession
@joey_needs_sleep I am struggling with the same problem after the iOS 18 update. Is the feature working reliably for you again now? Adding location to UIBackgroundModes is not needed, is it? Also, allowsBackgroundLocationUpdates doesn't need to be set to true in order to monitor geofences in the background? I am using CLMonitor.events and haven't found a way to query the minimal horizontalAccuracy for the geofencing to work Do you also start your CLServiceSession in the background, when the app is relaunched? According to the WWDC session, you can only start holding one (a CLServiceSession) when your app is in the foreground https://developer.apple.com/videos/play/wwdc2024/10212?time=522 and also ... CLMonitor.events won’t yield results when it is not in use, unless a session which was started in the foreground, .... https://developer.apple.com/videos/play/wwdc2024/10212?time=663
Nov ’24
Reply to UIDocumentPickerViewController: Cannot access file from OneDrive
You can force the OneDrive app to download the file first by settings "asCopy" to true: https://developer.apple.com/documentation/uikit/uidocumentpickerviewcontroller/3566731-initforexportingurls However, this can cause a hang, especially when the file is large and OneDrive doesn't show a progress indicator. I am also on the search for a way to download the file asynchronously and be able to show a progress indicator in my app
Topic: App & System Services SubTopic: Core OS Tags:
Oct ’24
Reply to UITabBarController render glitch since iOS18 beta 1 & 2 when activating tabs.
@BMS have you filed a bug report and received any response to it? I am hitting the same issue and feel like there shouldn't be a workaround needed. But it seems like Apple really wants us to have only UINavigationController as children for the UITabBarController - the new "tab bar" on iPad also only seems to share the space with the navigation bar of child view controllers - it doesn't work if the Tab bar controller itself is nested in a UINavigationController
Topic: UI Frameworks SubTopic: UIKit Tags:
Sep ’24
Reply to NSTextList not rendering on MacOS
I'm not sure if it's regression - the NSTextList never worked in the first place (or, they only work when you manually add the bullets into the text content itself - which user could select and delete). On iOS, the bullets are non-selectable and added automatically, just by setting the ParagraphStyle. I submitted a feedback report: FB15162186
Topic: UI Frameworks SubTopic: AppKit Tags:
Sep ’24
Reply to [AppKit] CNPropertyNotFetchedException when using CNContactFormatter on CNContact retrieved from CNContactPicker
Sorry for the late response, for some reason I wasn't notified via mail about your response. Here's there information you were asking for: Code reproducing your issue: #import "ViewController.h" @import Contacts; @import ContactsUI; @implementation ViewController CNContactPicker *contactPicker; -(IBAction)buttonPressed:(id)sender { contactPicker = [[CNContactPicker alloc] init]; contactPicker.delegate = self; contactPicker.displayedKeys = @[CNContactPostalAddressesKey]; [contactPicker showRelativeToRect:NSZeroRect ofView:sender preferredEdge:NSRectEdgeMinY]; } - (void)contactPicker:(CNContactViewController *)picker didSelectContactProperty:(CNContactProperty *)contactProperty { CNPostalAddressFormatter *formatter = [[CNPostalAddressFormatter alloc] init]; NSString *formattedAddress = [formatter stringFromPostalAddress:contactProperty.value]; NSLog(@"Formatted Address:\n%@", formattedAddress); @try { CNContactFormatter *contactFormatter = [[CNContactFormatter alloc] init]; NSString *formattedContact = [contactFormatter stringFromContact:contactProperty.contact]; NSLog(@"Formatted Contact:\n%@", formattedContact); } @catch(id anException) { NSLog(@"Exception:\n%@", anException); } } @end iOS version reproducing your issue: This is not an iOS issue. It happens in AppKit on macOS Sonoma 14.6.1. Does the issue also occur when using Xcode 16 beta 2? I didn't test Xcode 16 Beta 2 but it also happens with the (more recent) Xcode 16.1 Beta
Topic: App & System Services SubTopic: General Tags:
Aug ’24