gontovnik / DGElasticPullToRefresh

Elastic pull to refresh for iOS developed in Swift
https://medium.com/@gontovnik/elastic-view-animation-or-how-i-built-dgelasticpulltorefresh-269a3ba8636e#.9dioekqv6
MIT License
3.77k stars 443 forks source link

Don't work if CollectionView is empty #37

Closed SpectralDragon closed 6 years ago

SpectralDragon commented 8 years ago

I'm create my collectionView in loadView() method, and if my collection is empty i can't refresh him. What happened? :)

rottajuliano commented 7 years ago

Are you using DZNEmptyDataSet? It wasn't working for me as well. I found out it was a conflict with DZNEmptyDataSet, which disables scroll. You should add this to the bottom of your view controller to make it work.

extension NameOfTheCollectionViewController: DZNEmptyDataSetSource, DZNEmptyDataSetDelegate
{
    func emptyDataSetShouldAllowScroll(scrollView: UIScrollView!) -> Bool {
        return true
    }
}

Hope it helps. Cheers

Omeesh commented 6 years ago

This worked for me...

self.collectionView.alwaysBounceVertical = true

SpectralDragon commented 6 years ago

@Omeesh thanks you!)

tounaobun commented 6 years ago

Aha... good job.

MuseerAnsari commented 5 years ago

@Omeesh thank you :)

rejsiperpalaj commented 5 years ago

@Omeesh ;) thanks bro