|
@@ -32,6 +32,7 @@ struct SingleViewDemo : View {
|
|
|
|
|
|
|
|
@State private var index = 1
|
|
@State private var index = 1
|
|
|
@State private var blackWhite = false
|
|
@State private var blackWhite = false
|
|
|
|
|
+ @State private var forceTransition = true
|
|
|
|
|
|
|
|
var url: URL {
|
|
var url: URL {
|
|
|
URL(string: "https://raw.githubusercontent.com/onevcat/Kingfisher-TestImages/master/DemoAppImage/Loading/kingfisher-\(self.index).jpg")!
|
|
URL(string: "https://raw.githubusercontent.com/onevcat/Kingfisher-TestImages/master/DemoAppImage/Loading/kingfisher-\(self.index).jpg")!
|
|
@@ -52,7 +53,7 @@ struct SingleViewDemo : View {
|
|
|
ProgressView(progress)
|
|
ProgressView(progress)
|
|
|
}
|
|
}
|
|
|
.fade(duration: index == 1 ? 0 : 1) // Do not animate for the first image. Otherwise it causes an unwanted animation when the page is shown.
|
|
.fade(duration: index == 1 ? 0 : 1) // Do not animate for the first image. Otherwise it causes an unwanted animation when the page is shown.
|
|
|
- .forceTransition()
|
|
|
|
|
|
|
+ .forceTransition(forceTransition)
|
|
|
.resizable()
|
|
.resizable()
|
|
|
.frame(width: 300, height: 300)
|
|
.frame(width: 300, height: 300)
|
|
|
.cornerRadius(20)
|
|
.cornerRadius(20)
|
|
@@ -65,6 +66,8 @@ struct SingleViewDemo : View {
|
|
|
Button(action: {
|
|
Button(action: {
|
|
|
self.blackWhite.toggle()
|
|
self.blackWhite.toggle()
|
|
|
}) { Text("Black & White") }
|
|
}) { Text("Black & White") }
|
|
|
|
|
+ Toggle("Force Transition?", isOn: $forceTransition)
|
|
|
|
|
+ .frame(width: 300)
|
|
|
|
|
|
|
|
}.navigationBarTitle(Text("Basic Image"), displayMode: .inline)
|
|
}.navigationBarTitle(Text("Basic Image"), displayMode: .inline)
|
|
|
}
|
|
}
|