Post

Replies

Boosts

Views

Activity

Checking safeAreaInsets in viewWillTransition
Hi. We use the viewWillTransition(to size: CGSize, with coordinator: any UIViewControllerTransitionCoordinator) function to update frames when user rotates / opens / folds an iPhone Duo. However we found that the safeAreaInsets are not always correct in the alongsideTransition block of the animate(alongsideTransition:completion:) funciton. Here's the test code I wrote in a UIViewController: override func viewWillTransition(to size: CGSize, with coordinator: any UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) print(">>> before animate, view.frame: \(view.frame)") print(">>> before animate, view.safeAreaInsets: \(view.safeAreaInsets)") coordinator.animate { [weak self] _ in print(">>> in animate, view.frame: \(self?.view.frame)") print(">>> in animate, view.safeAreaInsets: \(self?.view.safeAreaInsets)") DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { print(">>> after 0.1, view.frame: \(self?.view.frame)") print(">>> after 0.1, view.safeAreaInsets: \(self?.view.safeAreaInsets)") print(">>> -------------") } } } And here's the logs when I rotate an opened iPhone Duo from "portrait" to "landscape" (where the tab bar is placed on the trailing / right side of screen): >>> before animate, view.frame: (0.0, 0.0, 669.0, 951.0) >>> before animate, view.safeAreaInsets: UIEdgeInsets(top: 82.0, left: 0.0, bottom: 83.0, right: 0.0) >>> in animate, view.frame: Optional((0.0, 0.0, 951.0, 669.0)) >>> in animate, view.safeAreaInsets: Optional(__C.UIEdgeInsets(top: 82.0, left: 0.0, bottom: 83.0, right: 0.0)) >>> after 0.1, view.frame: Optional((0.0, 0.0, 951.0, 669.0)) >>> after 0.1, view.safeAreaInsets: Optional(__C.UIEdgeInsets(top: 24.0, left: 0.0, bottom: 34.0, right: 84.0)) >>> ------------- In the alongsideTransition block I can get the correct view's frame, but the safeAreaInsets value is not correct. After a short delay of 0.1 seconds the safeAreaInsets becomes correct. Is getting the wrong safeAreaInsets in the alongsideTransition block a normal behavior? When is the correct timing to detect view's frame and safeAreaInsets when rotation (or view size change) happens?
Topic: UI Frameworks SubTopic: UIKit
0
0
22
10h
Safe area with iPhone Duo in Split View
Hi. When using the brand new iPhone Duo simulator I found a weird thing. When my app is running on the left side in a split view, the tab bar is appearing on the left side. But when I print the safe area of the window, it showed ▿ UIEdgeInsets - top : 0.0 - left : 0.0 - bottom : 34.0 - right : 0.0 But isn't the left inset supposed to be 469-385 = 84? When it's running on the right side, the safe area insets seems to be correct: ▿ UIEdgeInsets - top : 0.0 - left : 0.0 - bottom : 34.0 - right : 84.0 Here's how I get the safe area insets. Please correct me if I'm using a wrong way. extension UIApplication { var currentScene: UIWindowScene? { return connectedScenes.first as? UIWindowScene } } extension UIApplication { var currentKeyWindow: UIWindow? { currentScene?.windows.filter { $0.isKeyWindow }.first } } // Somewhere in my code static var safeAreaInsets: UIEdgeInsets { let window = UIApplication.shared.currentKeyWindow let insets = window?.safeAreaInsets ?? .zero return insets } Thank you guys so much for reading.
Topic: UI Frameworks SubTopic: UIKit
3
0
471
2d
[Xcode 26.2] Weird animation of first-level view controller being pushed on iOS 26 (with hidesBottomBarWhenPushed)
Hi. We discovered this strange behaviour when we're planning to migrate to Xcode 26.2 RC. When our app is running on iOS 26, view controllers thar are pushed from the root of UITabBarController will show with an animation. The views are growing from either the top-left or bottom-right corner. This only happens when the hidesBottomBarWhenPushed variable is set to true. Also it only happens to view controllers that are pushed directly from a UITabBarController; subsequent view controllers that are pushed will not have this weird animation. Since our app design requires hidesBottomBarWhenPushed to be true, we are asking if there is any way to fix this animation. Please refer to the following gif: We have tried methods described in this article but it doesn't work all the time: https://darjeelingsteve.com/articles/Fixing-UINavigationController-Push-Animation-Layout-Issues-on-iOS-26.html. We've tried the following three methods: This does not work at all. First-level view controllers are still showing with animation. override func pushViewController(_ viewController: UIViewController, animated: Bool) { super.pushViewController(viewController, animated: animated) transitionCoordinator?.animate { _ in UIView.performWithoutAnimation { viewController.view.layoutIfNeeded() } } } This does not work as well. override func pushViewController(_ viewController: UIViewController, animated: Bool) { super.pushViewController(viewController, animated: animated) transitionCoordinator?.animate(alongsideTransition: { [weak self] _ in UIView.performWithoutAnimation { self?.navigationBar.layoutIfNeeded() } }, completion: nil) } This works sometimes. However it breaks the push animation for some view controllers. override func pushViewController(_ viewController: UIViewController, animated: Bool) { super.pushViewController(viewController, animated: animated) UIView.performWithoutAnimation { viewController.view.layoutIfNeeded() } } We've created a simple sample project that reproduces this problem. Please run it on a simulator running iOS 26. https://drive.google.com/file/d/1q3pokphh1YDINH69LrHuqJQe8MijHQ2m/view?usp=sharing If anyone has a solution to this please let me know. Thank you for reading.
Topic: UI Frameworks SubTopic: UIKit
0
1
209
Dec ’25
iOS 26.1 UITableView separator style not working
Dear Apple Developer Support, We found that on devices running iOS 26.1 Beta, if we set the separator style of a UITableView to None via xib, the setting will have no effect and the table view cells will show separators. To reproduce this issue, I created a simple project. Please refer to the following screenshots. On iOS 26.0, no separator is showing. However on iOS 26.1, separators are showing. We have already filed a bug report FB20365301. We'd like to know if this is a bug and if it will be fixed before iOS 26.1 is officially released. Thank you.
Topic: UI Frameworks SubTopic: UIKit
10
7
1.4k
Oct ’25
Checking safeAreaInsets in viewWillTransition
Hi. We use the viewWillTransition(to size: CGSize, with coordinator: any UIViewControllerTransitionCoordinator) function to update frames when user rotates / opens / folds an iPhone Duo. However we found that the safeAreaInsets are not always correct in the alongsideTransition block of the animate(alongsideTransition:completion:) funciton. Here's the test code I wrote in a UIViewController: override func viewWillTransition(to size: CGSize, with coordinator: any UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) print(">>> before animate, view.frame: \(view.frame)") print(">>> before animate, view.safeAreaInsets: \(view.safeAreaInsets)") coordinator.animate { [weak self] _ in print(">>> in animate, view.frame: \(self?.view.frame)") print(">>> in animate, view.safeAreaInsets: \(self?.view.safeAreaInsets)") DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { print(">>> after 0.1, view.frame: \(self?.view.frame)") print(">>> after 0.1, view.safeAreaInsets: \(self?.view.safeAreaInsets)") print(">>> -------------") } } } And here's the logs when I rotate an opened iPhone Duo from "portrait" to "landscape" (where the tab bar is placed on the trailing / right side of screen): >>> before animate, view.frame: (0.0, 0.0, 669.0, 951.0) >>> before animate, view.safeAreaInsets: UIEdgeInsets(top: 82.0, left: 0.0, bottom: 83.0, right: 0.0) >>> in animate, view.frame: Optional((0.0, 0.0, 951.0, 669.0)) >>> in animate, view.safeAreaInsets: Optional(__C.UIEdgeInsets(top: 82.0, left: 0.0, bottom: 83.0, right: 0.0)) >>> after 0.1, view.frame: Optional((0.0, 0.0, 951.0, 669.0)) >>> after 0.1, view.safeAreaInsets: Optional(__C.UIEdgeInsets(top: 24.0, left: 0.0, bottom: 34.0, right: 84.0)) >>> ------------- In the alongsideTransition block I can get the correct view's frame, but the safeAreaInsets value is not correct. After a short delay of 0.1 seconds the safeAreaInsets becomes correct. Is getting the wrong safeAreaInsets in the alongsideTransition block a normal behavior? When is the correct timing to detect view's frame and safeAreaInsets when rotation (or view size change) happens?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
22
Activity
10h
Safe area with iPhone Duo in Split View
Hi. When using the brand new iPhone Duo simulator I found a weird thing. When my app is running on the left side in a split view, the tab bar is appearing on the left side. But when I print the safe area of the window, it showed ▿ UIEdgeInsets - top : 0.0 - left : 0.0 - bottom : 34.0 - right : 0.0 But isn't the left inset supposed to be 469-385 = 84? When it's running on the right side, the safe area insets seems to be correct: ▿ UIEdgeInsets - top : 0.0 - left : 0.0 - bottom : 34.0 - right : 84.0 Here's how I get the safe area insets. Please correct me if I'm using a wrong way. extension UIApplication { var currentScene: UIWindowScene? { return connectedScenes.first as? UIWindowScene } } extension UIApplication { var currentKeyWindow: UIWindow? { currentScene?.windows.filter { $0.isKeyWindow }.first } } // Somewhere in my code static var safeAreaInsets: UIEdgeInsets { let window = UIApplication.shared.currentKeyWindow let insets = window?.safeAreaInsets ?? .zero return insets } Thank you guys so much for reading.
Topic: UI Frameworks SubTopic: UIKit
Replies
3
Boosts
0
Views
471
Activity
2d
[Xcode 26.2] Weird animation of first-level view controller being pushed on iOS 26 (with hidesBottomBarWhenPushed)
Hi. We discovered this strange behaviour when we're planning to migrate to Xcode 26.2 RC. When our app is running on iOS 26, view controllers thar are pushed from the root of UITabBarController will show with an animation. The views are growing from either the top-left or bottom-right corner. This only happens when the hidesBottomBarWhenPushed variable is set to true. Also it only happens to view controllers that are pushed directly from a UITabBarController; subsequent view controllers that are pushed will not have this weird animation. Since our app design requires hidesBottomBarWhenPushed to be true, we are asking if there is any way to fix this animation. Please refer to the following gif: We have tried methods described in this article but it doesn't work all the time: https://darjeelingsteve.com/articles/Fixing-UINavigationController-Push-Animation-Layout-Issues-on-iOS-26.html. We've tried the following three methods: This does not work at all. First-level view controllers are still showing with animation. override func pushViewController(_ viewController: UIViewController, animated: Bool) { super.pushViewController(viewController, animated: animated) transitionCoordinator?.animate { _ in UIView.performWithoutAnimation { viewController.view.layoutIfNeeded() } } } This does not work as well. override func pushViewController(_ viewController: UIViewController, animated: Bool) { super.pushViewController(viewController, animated: animated) transitionCoordinator?.animate(alongsideTransition: { [weak self] _ in UIView.performWithoutAnimation { self?.navigationBar.layoutIfNeeded() } }, completion: nil) } This works sometimes. However it breaks the push animation for some view controllers. override func pushViewController(_ viewController: UIViewController, animated: Bool) { super.pushViewController(viewController, animated: animated) UIView.performWithoutAnimation { viewController.view.layoutIfNeeded() } } We've created a simple sample project that reproduces this problem. Please run it on a simulator running iOS 26. https://drive.google.com/file/d/1q3pokphh1YDINH69LrHuqJQe8MijHQ2m/view?usp=sharing If anyone has a solution to this please let me know. Thank you for reading.
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
1
Views
209
Activity
Dec ’25
iOS 26.1 UITableView separator style not working
Dear Apple Developer Support, We found that on devices running iOS 26.1 Beta, if we set the separator style of a UITableView to None via xib, the setting will have no effect and the table view cells will show separators. To reproduce this issue, I created a simple project. Please refer to the following screenshots. On iOS 26.0, no separator is showing. However on iOS 26.1, separators are showing. We have already filed a bug report FB20365301. We'd like to know if this is a bug and if it will be fixed before iOS 26.1 is officially released. Thank you.
Topic: UI Frameworks SubTopic: UIKit
Replies
10
Boosts
7
Views
1.4k
Activity
Oct ’25