Giter Club home page Giter Club logo

pulltobounce's Issues

Swift3

it'd be cool to have a swift 3 version, if you have any interest to create a branch i would like to help with that.

Can't implement this on Swift 4.2 xCode 10

I have tried to get this working in my project in Swift 4 but when i add the control, my scrollview content doesn't load and it just loads with a white view in the scrollview.

MY view hierarchy is as follows:
UIViewController -> View -> ScrollView -> 3x UIViews & 3x UICollectionViews

The scrollview is implemented via the storyboard with the layout constraints that is is aligned top, leading, trailing, bottom to the main view controller view.

I want to add the pull to refresh to my scrollview

I have done the following code, and tried variations but it doesn't work:

// Please wrap your scroll view
scrollView.frame = self.view.frame
let tableViewWrapper = PullToBounceWrapper(scrollView: scrollView)
// Please add wrapper view to your view instead of your scroll view.
self.view.addSubview(tableViewWrapper)

I've also tried creating a new UIview bodyview per your tutorial:
let bodyView = UIView()
bodyView.frame = scrollView.frame
let tableViewWrapper = PullToBounceWrapper(scrollView: scrollView)
bodyView.add(tableViewWrapper)
self.view.addSubview(bodyView)

I'm either missing something very simple, or something isn't working and would appreciate some guidance if you're able to!

Problem integration to UITableViewController

Tried to apply this to a UITableViewController. Here are the codes:

override func viewDidLoad() {
super.viewDidLoad()

let bodyView = UIView()
bodyView.frame = self.view.frame
bodyView.frame.y += 20 + 44
self.view.addSubview(bodyView)

// pull to refresh usage
let tableViewWrapper = PullToBounceWrapper(scrollView: tableView)
bodyView.addSubview(tableViewWrapper)

tableViewWrapper.didPullToRefresh = {
  NSTimer.schedule(delay: 2) { timer in
    tableViewWrapper.stopLoadingAnimation()
  }
}

// createHeader()

}

Terminating app due to uncaught exception 'CALayerInvalid', reason: 'layer <CALayer: 0x7fd501f5dc60> is a part of cycle in its layer tree'. Anyone else have this issue?

autoLayout

when i used snp layout llike
`
func createTableview() -> Void {
let changeCityTableView = ChangeCityTableView()
self.view.addSubview(changeCityTableView)
changeCityTableView.snp.makeConstraints { (make) in
make.edges.equalToSuperview()
}

    let tableViewWrapper = PullToBounceWrapper(scrollView: changeCityTableView)
    self.view.addSubview(tableViewWrapper)

    tableViewWrapper.didPullToRefresh = {
        Timer.schedule(delay: 2) { timer in
            tableViewWrapper.stopLoadingAnimation()
        }
    }
}

`
a crash open
assert(false, "Wow, scrollView.frame is CGRectZero. Please set frame size.")

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

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?

Update CocoaPod

I saw that you updated the repo to swift 3 however cocoa pods still has the swift 2 version. Could you please update the cocoa pod?

Swift 2.0 syntax error

It seems that swift 2 does not accept the '#' syntax for the function arguments.

This can cause compiling error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.