I would like to change the content of a UIButton to an ActivityIndicator after it is pressed.
I know buttons have an imageView and a titleLabel, but I don\'t know how to
Excellent @Steve,
Can use below implementation instead of line,
var activityIndicator: UIActivityIndicatorView!
use this, so that if we configure the activity indicator before calling showLoading(), the app wont crash.
private var _activityIndicator:UIActivityIndicatorView! = nil
var activityIndicator: UIActivityIndicatorView{
set{
_activityIndicator = newValue
}
get{
if _activityIndicator == nil{
_activityIndicator = createActivityIndicator()
}
return _activityIndicator
}
}