when start in viewdidload,button image will not show
yeziahehe opened this issue · 5 comments
yeziahehe commented
when start in viewdidload,button image will not show
class ViewController: UIViewController {
var tempTimer1 : Timer?
@IBOutlet var fillingView : LoadyButton!
override func viewDidLoad() {
super.viewDidLoad()
// start and stop animating on user touch
self.fillingView.setAnimation(LoadyAnimationType.backgroundHighlighter())
self.fillingView.startLoading()
var percent : CGFloat = 100
if #available(iOS 10.0, *) {
self.tempTimer1 = Timer.scheduledTimer(withTimeInterval: 1, repeats: true) { (t) in
percent -= 10
self.fillingView.update(percent: percent)
if percent <= 0 {
percent = 0
self.tempTimer1?.invalidate()
}
}
}
self.tempTimer1?.fire()
}
@IBAction func animateView(_ sender : UIButton){
guard let button = sender as? LoadyButton else {
return
}
if button.loadingIsShowing() {
button.stopLoading()
return
}
}
}
valentinjahanmanesh commented
hello i will investigate it soon
valentinjahanmanesh commented
yeziahehe commented
Yes, button is created by storyboard
valentinjahanmanesh commented
thank you for reporting this bug, It was some weird issue that new layer covers the button's image view. I don't know if it is a swift bug or it is as intended to be, but I have fixed it in 1.0.5, you can do a pod update.
and I apologize for my delay, we are in the middle of a release and we are working hard to meet the deadline, so I couldn't put enough effort to solve this sooner.
yeziahehe commented
You solve it in time and thank for your contribution to open source.