Skip to content

SwiftUI collection replacement leaves the pager scroll delegate attached to the previous collection #1110

Description

@OskarEichler

At master 7926b28, PagerView installs its proxy only when originalDelegate is nil. Changing the children count recreates the TabView; if the previous original delegate remains alive, the new collection never receives the proxy, and forwarding still targets the previous original. An actual UIKit Simulator harness reproduces four replacement/forwarding failures plus two separate proxy contract failures: responds(to:) omits NSObject selectors when no original exists, and zero-sized scroll callbacks are not forwarded. Proposed focused fix: restore the previous collection delegate when replacing it, install based on current delegate identity, always preserve original forwarding, and include superclass selector support. This concerns the current SwiftUI implementation, not the legacy UIPageViewController cleanup in PR #1040. This source audit is AI-assisted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions