Skip to content

Crash on PagerTabStripViewController when resizing app on windowed iPadOS 26 #862

@pedrosolisgarcia

Description

@pedrosolisgarcia

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:

  1. Open an app on iPadOS 26 in windowed mode using your library.
  2. Navigate to any screen backed by PagerTabStripViewController (XLPagerTabStrip).
  3. Resize the app window to a very small size (narrow width).
  4. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions