PopupCollectionViewController
PopupCollectionViewController copied to clipboard
Fixed bug with disappearing on bounce cell (second from the last one in collection)
In current state viewController's view is being removed in didEndDisplaying
and added only cellForItemAt
. For the cell next to last ones (or to be more correct ones on the edge of the collection: first and last one) on bounce didEndDisplaying
happened, so view was removed, but cell had no need be created, so cell ended up without view in it.
This fix just add view of viewController on willDisplay
, iff it's not already subview of the cell. So even cell loses subview on didEndDisplaying
during bounce, it gets it back before displaying.
Also, @objc
added to didTapGesture
because #selector()
was demanding it.