Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on tintColorDidChange #331

Open
guymoreillon opened this issue Mar 3, 2023 · 1 comment
Open

Crash on tintColorDidChange #331

guymoreillon opened this issue Mar 3, 2023 · 1 comment

Comments

@guymoreillon
Copy link

We sometimes get crashes like these:

OS Version: iOS 16.3.1 (20D67)
Report Version: 104

Exception Type: EXC_BREAKPOINT (SIGTRAP)
Crashed Thread: 0

Application Specific Information:
_tintColorDidChange > dyld_v1 arm64e > tintColorDidChange

Thread 0 Crashed:
0 Sporfie 0x2032c5d80 [inlined] value
1 Sporfie 0x2032c5d80 ActionSheetCancelActionView.tintColorDidChange (ActionSheetCancelActionView.swift:25)
2 Sporfie 0x2032c5d9c ActionSheetCancelActionView.tintColorDidChange
3 UIKitCore 0x3219be460 -[UIView _tintColorDidChange]
4 UIKitCore 0x3219be9a8 -[_UIAccessibilityInterfaceStyleVisitor _visitView:]
5 UIKitCore 0x3219be064 _UIViewVisitorRecursivelyEntertainDescendingVisitors
6 UIKitCore 0x3219be10c _UIViewVisitorRecursivelyEntertainDescendingVisitors
7 UIKitCore 0x32197f278 _UIViewVisitorEntertainDescendingTrackingVisitors
8 UIKitCore 0x321a333c8 __45-[UIView _postMovedFromSuperview:]_block_invoke
9 UIKitCore 0x32299fd28 -[UIView _postMovedFromSuperview:]
10 UIKitCore 0x32197dfe8 -[UIView(Internal) _addSubview:positioned:relativeTo:]
11 Sporfie 0x2032c8c3c ActionSheetView.prepareLayout (ActionSheetView.swift:33)
12 Sporfie 0x2032bdfb8 AlertController.configureAlertView (AlertController.swift:327)
13 Sporfie 0x2032be130 [inlined] AlertController.viewDidLoad (AlertController.swift:256)
14 Sporfie 0x2032be130 AlertController.viewDidLoad (:253)

I'm suspecting that it is caused by tintColorDidChange() being called before buildView() is ever called and thus before visualStyle is set, so this line in tintColorDidChange() would cause a crash:
self.cancelLabel.textColor = self.visualStyle.textColor(for: self.action) ?? self.tintColor
because visualStyle is nil.

I unfortunately can't provide a recipe for replicating because it seems to happen randomly.

@sberrevoets
Copy link
Owner

Thanks for reporting. Hard to do anything without repro steps but it's good to keep in mind in case others find the same or if it's related to a specific iOS version that sees more adoption over time.

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

No branches or pull requests

2 participants