SDWebImage / SDWebImageSwiftUI

SwiftUI Image loading and Animation framework powered by SDWebImage
https://sdwebimage.github.io/SDWebImageSwiftUI
MIT License
2.18k stars 225 forks source link

V2.2.0 iOS 16.0 cpu up to 100% #234

Closed wapony closed 2 years ago

wapony commented 2 years ago

I update to v2.2.0, iPhone 11pro iOS 16.0, the cpu up to 101%, when I delete the WebImage code, the cpu down to 0%

dreampiggy commented 2 years ago

Reproduce demo ? Provide the code snippet of your view structure

wapony commented 2 years ago

Reproduce demo ? Provide the code snippet of your view structure

WebImage(url: getHeaderImageURL())
.resizable()
.placeholder(Image("ic_placeholder_tws_headset_big"))
.indicator(.activity)
.transition(.fade(duration: 0.5))
.scaledToFit()
.frame(width: headImageWidth, height: headImageWidth, alignment: .center)
.frame(width: cardWidth, height: cardWidth)
.opacity(earbudDetail.isConnected == .connected ? 1 : 0.2)

if getHeaderImageURL() return nil, the cpu will up to 101%

dreampiggy commented 2 years ago

Seems talk about the nil URL case, which always produce a new error and cause the load logic infinity running