Thanks for considering to open an issue. Before you submit your issue, please confirm these boxes are checked.
After upgrading from 4.x to 5.x, it's no longer possible to set the 'indicatorType' inside of a class extension.
Cannot assign to property: 'self' is immutable
Create a UIImageView extension and try to set the indicatorType inside a function.
extension UIImageView {
func doSomething() {
self.kf.indicatorType = .activity // Error
}
}
It's still possible to call functions such as 'setImage'.
Yes, now the kf returns a struct instead of class. This change is for performance, and for your case, try:
extension UIImageView {
func doSomething() {
var kf = self.kf
kf.indicatorType = .activity
}
}
Yes, this fixes the compilation error.
I was worried that the changes would not be reflected, but it seems to work.
Thanks for the help.
Most helpful comment
Yes, now the
kfreturns a struct instead of class. This change is for performance, and for your case, try: