Skip to content

A control of pull to refresh. Writen by swift

License

Notifications You must be signed in to change notification settings

e-reifer/JxbRefresh

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JxbRefresh

A control of pull to refresh. Writen by swift


##CocoaPods `pod 'JxbRefresh'


##Example Code

###Style1: pull refresh for normal

self.taleView.addPullRefresh({ [weak self] in 
    dispatch_after(afterTime(3), dispatch_get_global_queue(0, 0), {
        self?.taleView.stopPullRefresh()
    })
})

###Style2: pull refresh for gif

        let arrIdle: NSMutableArray = NSMutableArray.init(capacity: 0)
        for i in 1...60 {
            let name = String.init(format: "dropdown_anim__000%zd", i)
            let image = UIImage.init(named: name)
            arrIdle.addObject(image!)
        }
        
        let arrRefresh: NSMutableArray = NSMutableArray.init(capacity: 0)
        for i in 1...3 {
            let name = String.init(format: "dropdown_loading_0%zd", i)
            let image = UIImage.init(named: name)
            arrRefresh.addObject(image!)
        }
        
        self.taleView.addGifPullRefresh(idleImages: arrIdle, refreshImages: arrRefresh, closure: { [weak self] in
            dispatch_after(afterTime(3), dispatch_get_global_queue(0, 0), {
                self?.taleView.stopPullRefresh()
            })
        })

###Style3: pull refresh for load more data

        self.taleView.addFooterRefresh(closure: {[weak self] in
            dispatch_after(afterTime(3), dispatch_get_global_queue(0, 0), {
                self?.taleView.stopPullRefresh()
//                self?.taleView.setFooterEnable(false)
            })
        })

About

A control of pull to refresh. Writen by swift

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 97.0%
  • Ruby 3.0%