Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Fixed Mac Catalyst refresh control guard to use process-level `UIDevice.current.userInterfaceIdiom` instead of `UIView.behavioralStyle`, which does not resolve correctly before the view is in a window hierarchy

## [0.6.4] - 2026-02-20

### Fixed
Expand Down
7 changes: 4 additions & 3 deletions Sources/Lists/Extensions/RefreshControlConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ func configureRefreshControl(
action: Selector
) {
// UIRefreshControl is unsupported on Mac Catalyst in the Mac idiom; assigning one crashes.
// behavioralStyle respects the app's preferredBehavioralStyle, so iPad-idiom apps still get refresh.
// UIDevice.current.userInterfaceIdiom is process-level and returns .mac for Mac idiom,
// unlike behavioralStyle which requires the view to be in a window to resolve correctly.
#if targetEnvironment(macCatalyst)
guard collectionView.behavioralStyle != .mac else { return }
guard UIDevice.current.userInterfaceIdiom != .mac else { return }
#endif

if onRefresh != nil, collectionView.refreshControl == nil {
Expand Down Expand Up @@ -74,7 +75,7 @@ final class RefreshControlManager {
private func configureIfNeeded() {
guard let collectionView else { return }
#if targetEnvironment(macCatalyst)
guard collectionView.behavioralStyle != .mac else { return }
guard UIDevice.current.userInterfaceIdiom != .mac else { return }
#endif
if onRefresh != nil, collectionView.refreshControl == nil {
let refreshControl = UIRefreshControl()
Expand Down