Skip to content

fix(ios): weak-capture tab bar item and screen view in async image callbacks#4111

Draft
cortinico wants to merge 1 commit into
software-mansion:mainfrom
cortinico:nc/ios-26-patch
Draft

fix(ios): weak-capture tab bar item and screen view in async image callbacks#4111
cortinico wants to merge 1 commit into
software-mansion:mainfrom
cortinico:nc/ios-26-patch

Conversation

@cortinico
Copy link
Copy Markdown
Contributor

Description

Avoid updating a tab bar item whose internal view hierarchy has been
torn down. This works around an iOS 26 UIKit regression where unowned
refs inside UITabBarItem._updateViewAndPositionItems: cause crashes.

Both the normal icon and selected icon completion blocks now:

  1. Weak-capture tabBarItem and screenView before the block
  2. Promote to strong refs inside the block and bail if either is nil
  3. Guard that the screen's controller is still parented by a UITabBarController

Before & after - visual documentation

TBA

Test plan

Discussed offline

Checklist

  • Included code example that can be used to test this change.
  • For visual changes, included screenshots / GIFs / recordings documenting the change.
  • For API changes, updated relevant public types.
  • Ensured that CI passes

…llbacks

Avoid updating a tab bar item whose internal view hierarchy has been
torn down. This works around an iOS 26 UIKit regression where unowned
refs inside UITabBarItem._updateViewAndPositionItems: cause crashes.

Both the normal icon and selected icon completion blocks now:
1. Weak-capture tabBarItem and screenView before the block
2. Promote to strong refs inside the block and bail if either is nil
3. Guard that the screen's controller is still parented by a UITabBarController
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant