Post

Replies

Boosts

Views

Activity

Reply to UITableView row reordering no longer works under macOS 27 with Mac Catalyst
I found a hacky workaround that allows row reordering to work again in a table view controller that is shown in a form or page sheet under Mac Catalyst with macOS 27. The following code, called from an affected table view controller's viewDidAppear method, solves the issue. It's in Objective-C but should be easy enough to translate to Swift. #if TARGET_OS_MACCATALYST if (@available(iOS 27.0, *)) { // TODO: Update if/when Apple fixes FB25038883 UITextField *tf = [[UITextField alloc] init]; tf.frame = CGRectMake(0, -200, 100, 44); // Off screen [self.view addSubview:tf]; [tf becomeFirstResponder]; [tf resignFirstResponder]; tf.enabled = NO; tf.hidden = YES; } #endifOf course if you need this in multiple places, add this code to a method in a class extension to UITableViewController then call the method from each relevant viewDidAppear as needed.
Topic: UI Frameworks SubTopic: UIKit Tags:
4d
Reply to UITableView row reordering no longer works under macOS 27 with Mac Catalyst
I've been trying to find a workaround for this macOS 27 bug with row reordering. I've found some interesting results. If the table view has a row with a UITextField and the UITextField is made first responder then row reorder works. Even if the UITextField resigns first responder, row reordering continues to work. If the table view has a row that presents a popover when selected, then simply dismissing the popover by tapping outside of the popover then allows row reordering to work. However, if clicking on a row results in another view controller being presented as a form sheet or page sheet, then when that view controller is dismissed, row reordering on the original view controller does NOT begin to work. I've been trying to determine what difference there is in the view controller's state before and after dismissing a popover. If I can find a relevant difference then maybe I can force that state under macOS 27 so row reordering works again. But I haven't had any luck yet. Does anyone have any ideas here? I've checked and after dismissing a popover there is no view that is first responder. I've also checked preferredFocusEnvironments for the view controller and it is simply the view controller's view. Forcing that has no effect under macOS 27. What other possible properties could be relevant? In cases where my view controller has a text field in a cell, I can make row reordering work under macOS 27 by having the text field become first responder then resign first responder. But I have a few cases of view controllers that need row reordering but none of the rows have text fields. I've tried just making the first visible row in the table view the first responder but that din't help.
Topic: UI Frameworks SubTopic: UIKit Tags:
6d
Reply to How does a view controller know when the reserved regions change?
@Frameworks Engineer Thanks. I'm actually working on a long-standing Objective-C app and the documentation for the Objective-C side of these things makes no mention of the observation tracking nor does it have any of the sample code shown in the Swift version of the documentation. But I've done some tests and reading the current reserved regions is working great inside updateViewConstraints in my Objective-C code.
Topic: UI Frameworks SubTopic: UIKit Tags:
1w
Reply to How does a view controller know when the reserved regions change?
@Pokpong Thanks, using updateViewConstraints is just what I needed. I had seen that other forum message you mention but the answer from the Apple engineer never actually said how to observe changes in UIKit, only how to get the current reserved regions. I've also been looking at the documentation in Xcode. That documentation does not have nearly the same info for UIView.ReservedRegion that is ahown at https://developer.apple.com/documentation/uikit/uiview/reservedregion. If I had seen the online documentation I would have known the answer already. So strange the developer documentation in Xcode is so much less thorough than the online documentation. Note that the very helpful sample code shown online for UIView.ReservedRegion only appears when selecting Swift. It does not appear when selecting Objective-C.
Topic: UI Frameworks SubTopic: UIKit Tags:
1w
Reply to iPhone Duo bug: Popovers presented with their arrow restricted to left/right appear partially offscreen
It turns out this issue also affects iPads but in fewer cases. It also has been an issue since iPadOS 26. If you run the same app against any iPad running iOS 26.x or 27.x, the issue appears under the following conditions: When the iPad is portrait or landscape and the app is not horizontally compact: A row near the bottom of the root view controller is selected. There is no issue showing a popover from a form sheet or other popover.
Topic: UI Frameworks SubTopic: UIKit Tags:
2w
Reply to iPhone Duo: Sidebar toolbar item becomes unreachable after rotating to portrait
I suggest two possible workarounds: Set the minimumPrimaryColumnWidth to a value large enough to always show all 5 button items. Group your buttons together more. Don't put a flexible space between all 5 (at least on iOS 26.0 and up). Maybe just have one between the 3rd and 4th buttons. That will take less width and better follow the HIG for iOS 26 and later.
Topic: UI Frameworks SubTopic: UIKit
Replies
Boosts
Views
Activity
2d
Reply to UITableView row reordering no longer works under macOS 27 with Mac Catalyst
I found a hacky workaround that allows row reordering to work again in a table view controller that is shown in a form or page sheet under Mac Catalyst with macOS 27. The following code, called from an affected table view controller's viewDidAppear method, solves the issue. It's in Objective-C but should be easy enough to translate to Swift. #if TARGET_OS_MACCATALYST if (@available(iOS 27.0, *)) { // TODO: Update if/when Apple fixes FB25038883 UITextField *tf = [[UITextField alloc] init]; tf.frame = CGRectMake(0, -200, 100, 44); // Off screen [self.view addSubview:tf]; [tf becomeFirstResponder]; [tf resignFirstResponder]; tf.enabled = NO; tf.hidden = YES; } #endifOf course if you need this in multiple places, add this code to a method in a class extension to UITableViewController then call the method from each relevant viewDidAppear as needed.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
4d
Reply to UITableView row reordering no longer works under macOS 27 with Mac Catalyst
I've been trying to find a workaround for this macOS 27 bug with row reordering. I've found some interesting results. If the table view has a row with a UITextField and the UITextField is made first responder then row reorder works. Even if the UITextField resigns first responder, row reordering continues to work. If the table view has a row that presents a popover when selected, then simply dismissing the popover by tapping outside of the popover then allows row reordering to work. However, if clicking on a row results in another view controller being presented as a form sheet or page sheet, then when that view controller is dismissed, row reordering on the original view controller does NOT begin to work. I've been trying to determine what difference there is in the view controller's state before and after dismissing a popover. If I can find a relevant difference then maybe I can force that state under macOS 27 so row reordering works again. But I haven't had any luck yet. Does anyone have any ideas here? I've checked and after dismissing a popover there is no view that is first responder. I've also checked preferredFocusEnvironments for the view controller and it is simply the view controller's view. Forcing that has no effect under macOS 27. What other possible properties could be relevant? In cases where my view controller has a text field in a cell, I can make row reordering work under macOS 27 by having the text field become first responder then resign first responder. But I have a few cases of view controllers that need row reordering but none of the rows have text fields. I've tried just making the first visible row in the table view the first responder but that din't help.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
6d
Reply to How does a view controller know when the reserved regions change?
@Frameworks Engineer Thanks. I'm actually working on a long-standing Objective-C app and the documentation for the Objective-C side of these things makes no mention of the observation tracking nor does it have any of the sample code shown in the Swift version of the documentation. But I've done some tests and reading the current reserved regions is working great inside updateViewConstraints in my Objective-C code.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
1w
Reply to How does a view controller know when the reserved regions change?
@Pokpong Thanks, using updateViewConstraints is just what I needed. I had seen that other forum message you mention but the answer from the Apple engineer never actually said how to observe changes in UIKit, only how to get the current reserved regions. I've also been looking at the documentation in Xcode. That documentation does not have nearly the same info for UIView.ReservedRegion that is ahown at https://developer.apple.com/documentation/uikit/uiview/reservedregion. If I had seen the online documentation I would have known the answer already. So strange the developer documentation in Xcode is so much less thorough than the online documentation. Note that the very helpful sample code shown online for UIView.ReservedRegion only appears when selecting Swift. It does not appear when selecting Objective-C.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
1w
Reply to iPhone Duo bug: Popovers presented with their arrow restricted to left/right appear partially offscreen
It turns out this issue also affects iPads but in fewer cases. It also has been an issue since iPadOS 26. If you run the same app against any iPad running iOS 26.x or 27.x, the issue appears under the following conditions: When the iPad is portrait or landscape and the app is not horizontally compact: A row near the bottom of the root view controller is selected. There is no issue showing a popover from a form sheet or other popover.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
2w