1、使用SDWebImage
btn.sd_setImage(with: URL(fileURLWithPath: imagePath), for: .normal, completed: nil)
2、使用Kingfisher
btn.kf.setImage(with: URL(fileURLWithPath: imagePath), for: .normal, placeholder: nil, options: [.preloadAllAnimationData], progressBlock: nil) { (result) in
}