takuoka / PullToBounce

Animated "Pull To Refresh" Library for UIScrollView. Inspired by https://dribbble.com/shots/1797373-Pull-Down-To-Refresh
MIT License
1.86k stars 166 forks source link

What is the connection between `Screen size` and `bendDistance` on different devices? #11

Open 2sui opened 8 years ago

2sui commented 8 years ago

There is my code :

let ballSize = self.view.bounds.size.width / 12
        _pullToBounce = PullToBounceWrapper(scrollView: _collectionView,
            bounceDuration: 0.8,  /
            ballSize: ballSize,  
            ballMoveTimingFunc: CAMediaTimingFunction(controlPoints:0.49,0.13,0.29,1.61),
            moveUpDuration: 0.25, 
            pullDistance: ballSize * 2, 
            bendDistance: ballSize * 1.8, 
            didPullToRefresh: {  
                // test
                NSTimer.schedule(delay: 6) {
                    [unowned self] timer in
                    self._pullToBounce?.stopLoadingAnimation()
                }
            })

The ballSize is related to Screen bound, when i set bendDistance as benDistance * 1.8, the code works well on iPhone 6s but crashes on iPhone 5s, and then i set bendDistance as benDistance * 1.9 it crashes on iPhone 6s but works well on iPhone 5s.

What is the connection between Screen size and bendDistance on different devices?

2sui commented 8 years ago

When bendDistance equal to pullDistance, it works well on all devices...