FFJLoadButton 0.2.0

FFJLoadButton 0.2.0

测试测试
语言语言 SwiftSwift
许可证 MIT
发布}最近发布2016年4月
SPM支持 SPM

Vito 维护。



  • 作者:
  • Vito

FFJLoadButton

FFJLoadButton 是一个使用 Swift 编写的 UIButton 子类,它提供了一个简单的 UI 加载动画功能。

使用方法

FFJLoadButton 主要提供两种方法

startLoad()
endLoad(_:)

示例

self.loadButton.startLoad()

let imageURL = NSURL.init(string: "https://fakeurl.com")
NSURLSession.sharedSession().dataTaskWithURL(imageURL!) { (imageData, response, error) -> Void in
    dispatch_async(dispatch_get_main_queue(), { () -> Void in
        if let _ = error {
            self.imageView.image = nil
            self.loadButton.endLoad(false)
            return
        }
        self.imageView.image = UIImage.init(data: imageData!)
        self.loadButton.endLoad(true)
    })
}.resume()

查看演示了解更多详情。

安装

手动安装

只需将 FFJLoadButton.swift 拖动到你的项目中

要求

iOS 8.0+

作者

[email protected]

许可证

FFJLoadButton 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。