Skip to content

crash after dismissing a presented UICollectionViewController where InfiniteCarousel is the controller's collection view #16

@klundberg

Description

@klundberg

If you create a collection view controller where the InfiniteCarousel is set to be the collection view of said controller, and you then present/scroll/dismiss that view controller, the next time you try to focus something new, the app will crash at this line:

https://github.com/willowtreeapps/ouroboros/blob/develop/Ouroboros/InfiniteCarousel.swift#L92

The problem is that the focus engine seems to keep a reference to the Infinite carousel, and when you refocus, that reference is removed. UIScrollView's dealloc method manually sets datasource and delegate to nil, and that set here causes the overridden property for delegate to trigger the set, which tries to re-set super.delegate. Doing this causes a trap, since the view is being deallocated it is not allowed to be set to a weak reference which it is doing by setting super.delegate to self.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions