-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
The app crashes inside XLPagerTabStrip’s paging math when the app window is resized to a very small size on iPadOS 26. The crash happens converting a Double to Int because the value is inf or NaN, most likely due to pageWidth == 0 (or near-zero) after layout during the resize.
Steps to Reproduce:
- Open an app on iPadOS 26 in windowed mode using your library.
- Navigate to any screen backed by PagerTabStripViewController (XLPagerTabStrip).
- Resize the app window to a very small size (narrow width).
- Observe crash.
Reproducibility: Frequent (≥80%) when shrinking to very small window sizes.
Crash Message & Location
Thread 1: Swift runtime failure:
Double value cannot be converted to Int because it is either infinite or NaN
Code shown in the stack/screenshot (XLPagerTabStrip):
open func virtualPageFor(contentOffset: CGFloat) -> Int {
return Int(((contentOffset + 1.5 * pageWidth) / pageWidth) - 1)
}
Likely cause: pageWidth becomes 0 (or extremely small) during/after window resize, so the division yields inf/NaN, making the Int(...) conversion fail.
Metadata
Metadata
Assignees
Labels
No labels