歡迎加入QQ討論群258996829

Swift 刷新控件 JxbRefresh

發(fā)布時間:2017-01-16 17:27  回復(fù):0  查看:5413  感興趣:59  贊:0   最后回復(fù):2017-01-16 17:27  

Swift 刷新控件 JxbRefresh 。

頂部刷新:

self.taleView.addPullRefresh({ [weak self] in 
    dispatch_after(afterTime(3), dispatch_get_global_queue(0, 0), {
        self?.taleView.stopPullRefresh()
    })
})
Swift 刷新控件 JxbRefresh


自定義刷新動畫(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()
            })
        })
Swift 刷新控件 JxbRefresh


底部刷新:

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



相關(guān)開源代碼

您還未登錄,請先登錄

熱門帖子

最新帖子

?