Skip to content

Fix Mac Catalyst refresh control regression with process-level idiom check - #63

Merged
Iron-Ham merged 1 commit into
mainfrom
Iron-Ham/fix-catalyst-refresh-idiom-check
Feb 20, 2026
Merged

Fix Mac Catalyst refresh control regression with process-level idiom check#63
Iron-Ham merged 1 commit into
mainfrom
Iron-Ham/fix-catalyst-refresh-idiom-check

Conversation

@Iron-Ham

Copy link
Copy Markdown
Owner

Summary

  • The behavioralStyle guard from Fix Mac Catalyst crash when onRefresh is set #60 doesn't work because UIView.behavioralStyle requires the view to be in a window hierarchy to resolve correctly — configureIfNeeded() fires from onRefresh's didSet before the collection view has a window, so behavioralStyle returns .pad instead of .mac, bypassing the guard
  • Switches to UIDevice.current.userInterfaceIdiom != .mac, which is a process-level property that correctly returns .mac for Mac Catalyst Mac idiom regardless of view hierarchy state
  • iPad-idiom Catalyst apps (userInterfaceIdiom == .pad) continue to get pull-to-refresh

Closes #62

Test plan

  • make build succeeds
  • make test — all 301 tests pass
  • make lint passes
  • Run on Mac Catalyst (Mac idiom) with onRefresh set — no crash, refresh silently skipped
  • Run on Mac Catalyst (iPad idiom) — pull-to-refresh works
  • Run on iOS simulator/device — pull-to-refresh works

behavioralStyle on UIView requires the view to be in a window to
resolve correctly. configureIfNeeded() fires from onRefresh didSet
before the collection view is in a hierarchy, so behavioralStyle
returns .pad instead of .mac, bypassing the guard and crashing.

Switch to UIDevice.current.userInterfaceIdiom which is process-level
and returns .mac for Mac Catalyst Mac idiom regardless of view state.

Closes #62
@Iron-Ham
Iron-Ham merged commit 4a6ea81 into main Feb 20, 2026
1 check passed
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.

Bug: UIRefreshControl crash on Mac Catalyst (Mac idiom) regression

1 participant