@@ -112,19 +112,22 @@ extension CafeDetailHeaderView {
112
112
if let imageUrls = viewStore. cafe? . imageUrls,
113
113
imageUrls. isNotEmpty {
114
114
TabView {
115
- ForEach ( imageUrls, id: \. self) { imageUrl in
116
- LinearGradient (
117
- gradient: Gradient ( colors: [ . black. opacity ( 0.06 ) , . black. opacity ( 0.3 ) ] ) ,
118
- startPoint: . top,
119
- endPoint: . bottom
120
- )
121
- . background ( alignment: . center) {
122
- KFImage . url ( URL ( string: imageUrl) )
123
- . placeholder {
124
- imagePlaceholderView
115
+ ForEach ( imageUrls, id: \. self) { imageUrlString in
116
+ Group {
117
+ if let imageUrl = URL ( string: imageUrlString) {
118
+ LinearGradient (
119
+ gradient: Gradient ( colors: [ . black. opacity ( 0.06 ) , . black. opacity ( 0.3 ) ] ) ,
120
+ startPoint: . top,
121
+ endPoint: . bottom
122
+ )
123
+ . background ( alignment: . center) {
124
+ KFImage . url ( imageUrl)
125
+ . resizable ( )
126
+ . scaledToFill ( )
125
127
}
126
- . resizable ( )
127
- . scaledToFill ( )
128
+ } else {
129
+ imagePlaceholderView
130
+ }
128
131
}
129
132
}
130
133
}
@@ -138,15 +141,14 @@ extension CafeDetailHeaderView {
138
141
}
139
142
140
143
private var imagePlaceholderView : some View {
141
- LinearGradient (
142
- gradient: Gradient ( colors: [ . black. opacity ( 0.06 ) , . black. opacity ( 0.3 ) ] ) ,
143
- startPoint: . top,
144
- endPoint: . bottom
145
- )
146
- . background ( alignment: . center) {
147
- CofficeAsset . Asset. icPlaceholder. swiftUIImage
148
- . padding ( . top, UIApplication . keyWindow? . safeAreaInsets. top ?? 0.0 )
149
- }
144
+ CofficeAsset . Colors. grayScale2. swiftUIColor
145
+ . overlay (
146
+ alignment: . center,
147
+ content: {
148
+ CofficeAsset . Asset. icPlaceholder. swiftUIImage
149
+ . padding ( . top, UIApplication . keyWindow? . safeAreaInsets. top ?? 0.0 )
150
+ }
151
+ )
150
152
}
151
153
}
152
154
0 commit comments