Open chrysb opened 3 years ago
still same issue
@erenlk Can you provide an demo to trigger this issue ? SwiftUI's code is easy for creating demo.
And, make sure you use the latest SDWebImageSwiftUI (current 2.1.0)
@dreampiggy
there is my code
ScrollView{
VStack {
TabView(selection: $selection){
ForEach(service.productSecondImageArray.indices , id: \.self) { index in
WebImage(url: URL(string: "https://aviled.com.tr/image/\(service.productSecondImageArray[index].image)"))
.resizable()
.indicator(.activity)
.frame(width: screen.width - 30, height: 400)
.aspectRatio(contentMode: .fit)
.cornerRadius(25)
.onTapGesture {
self.zoomImageShow.toggle()
}
.sheet(isPresented: $zoomImageShow, content: {
ZoomView(
imageURL: "https://aviled.com.tr/image/\(service.productSecondImageArray[index].image)",
thumbURL: "https://aviled.com.tr/image/\(service.productSecondImageArray[index].image)" ,
productID: productID,
array: $service.productSecondImageArray
)
})
.shadow(color: colorScheme == .dark ? .secondarySystemBackground : Color(#colorLiteral(red: 0.8039215803, green: 0.8039215803, blue: 0.8039215803, alpha: 1)), radius: 5, x: 7, y: 7)
.padding()
.padding(.top,18)
}
}
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))
.frame(width: screen.width, height: 420, alignment: .center)
HStack {
ForEach(service.productSecondImageArray.indices , id: \.self){ index in
Circle()
.frame(width: index == selection ? 10 : 5, height: index == selection ? 15 : 10)
.foregroundColor(index == selection ? .primary : .secondary)
.animation(.spring())
}
}
.opacity(service.productSecondImageArray.count == 1 ? 0 : 1)
}
}
I checked my version 2.0.2 but I get still same issue
and , get this error Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
Any Solutions ?
Busying in daily work. Will try to debug in this weekend :)
Thanks for working on this @dreampiggy !
XCode Version 12.4 (12D4e) SDWebImageSwiftUI 2.0.1
We have a scenario where a view loads due to a cached auth state, and then after a server callback, if the user is unauth'd, it will remove that view from the hierarchy.
In that case,
WebImage
is also removed from the hierarchy, and it crashes. This is a blocking issue for us. We switched over fromKFImage
and that introduced this bug for us.I can confirm that the crash stops happening when we comment out the
WebImage
from our view.This is the codepath highlighted by XCode:
ImageManager.swift: 106
WebImage.swift: 113
And here's the callstack: