@@ -16,7 +16,7 @@ import SharedUI
1616
1717struct TabViewGallery : View {
1818
19- var gallery : [ ImageElement ]
19+ var gallery : [ URL ]
2020 @Binding var showScreenGallery : Bool
2121 @Binding var selectedImageID : Int
2222 @State private var backgroundOpacity : Double = 1.0
@@ -102,7 +102,7 @@ struct TabViewGallery: View {
102102 }
103103
104104 private func saveImage( ) {
105- let request = ImageRequest ( url: gallery [ selectedImageID] . url )
105+ let request = ImageRequest ( url: gallery [ selectedImageID] )
106106
107107 Nuke . ImagePipeline. shared. loadImage ( with: request) { result in
108108 switch result {
@@ -124,10 +124,10 @@ struct TabViewGallery: View {
124124 }
125125 }
126126
127- private func preloadImage( for: [ ImageElement ] ) {
127+ private func preloadImage( for: [ URL ] ) {
128128 DispatchQueue . main. async {
129129 for element in gallery. enumerated ( ) {
130- let imageUrl = gallery [ element. offset] . url
130+ let imageUrl = gallery [ element. offset]
131131 let request = ImageRequest ( url: imageUrl)
132132 Nuke . ImagePipeline. shared. loadImage ( with: request) { result in
133133 switch result {
@@ -227,9 +227,9 @@ struct BackgroundView: ViewModifier {
227227
228228#Preview {
229229 TabViewGallery ( gallery: [
230- . init ( url : URL ( string: " https://i.4pda.ws/static/img/news/63/633610t.jpg " ) !, width : 480 , height : 269 ) ,
231- . init ( url : URL ( string: " https://i.4pda.ws/static/img/news/63/633618t.jpg " ) !, width : 480 , height : 269 ) ,
232- . init ( url : URL ( string: " https://i.4pda.ws/static/img/news/63/633610t.jpg " ) !, width : 480 , height : 269 )
230+ URL ( string: " https://i.4pda.ws/static/img/news/63/633610t.jpg " ) !,
231+ URL ( string: " https://i.4pda.ws/static/img/news/63/633618t.jpg " ) !,
232+ URL ( string: " https://i.4pda.ws/static/img/news/63/633610t.jpg " ) !
233233 ] ,
234234 showScreenGallery: . constant( false ) , selectedImageID: . constant( 0 ) )
235235}
0 commit comments