SDWebImageSwiftUI icon indicating copy to clipboard operation
SDWebImageSwiftUI copied to clipboard

V2.2.0 iOS 16.0 cpu up to 100%

Open wapony opened this issue 3 years ago • 1 comments

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%

wapony avatar Sep 22 '22 14:09 wapony

Reproduce demo ? Provide the code snippet of your view structure

dreampiggy avatar Sep 22 '22 14:09 dreampiggy

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%

wapony avatar Sep 23 '22 01:09 wapony

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

dreampiggy avatar Sep 23 '22 04:09 dreampiggy