refactor: AsyncImage -> KFImage 로 변경
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
import Kingfisher
|
||||||
|
|
||||||
struct CharacterDetailGalleryView: View {
|
struct CharacterDetailGalleryView: View {
|
||||||
@StateObject var viewModel = CharacterDetailGalleryViewModel()
|
@StateObject var viewModel = CharacterDetailGalleryViewModel()
|
||||||
@@ -146,16 +147,17 @@ struct CharacterDetailGalleryView: View {
|
|||||||
|
|
||||||
ZStack {
|
ZStack {
|
||||||
// 이미지
|
// 이미지
|
||||||
AsyncImage(url: URL(string: item.imageUrl)) { image in
|
KFImage(URL(string: item.imageUrl))
|
||||||
image
|
.placeholder {
|
||||||
.resizable()
|
Rectangle()
|
||||||
.scaledToFill()
|
.fill(Color.gray.opacity(0.3))
|
||||||
.frame(width: width, height: height)
|
}
|
||||||
.clipped()
|
.cancelOnDisappear(true)
|
||||||
} placeholder: {
|
.downsampling(size: CGSize(width: width, height: height))
|
||||||
Rectangle()
|
.resizable()
|
||||||
.fill(Color.gray.opacity(0.3))
|
.scaledToFill()
|
||||||
}
|
.frame(width: width, height: height)
|
||||||
|
.clipped()
|
||||||
|
|
||||||
// 미소유 이미지 오버레이
|
// 미소유 이미지 오버레이
|
||||||
if !item.isOwned {
|
if !item.isOwned {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
import Kingfisher
|
||||||
|
|
||||||
struct ImageViewerView: View {
|
struct ImageViewerView: View {
|
||||||
let images: [String]
|
let images: [String]
|
||||||
@@ -18,14 +19,15 @@ struct ImageViewerView: View {
|
|||||||
|
|
||||||
TabView(selection: $selectedIndex) {
|
TabView(selection: $selectedIndex) {
|
||||||
ForEach(Array(images.enumerated()), id: \.offset) { index, imageUrl in
|
ForEach(Array(images.enumerated()), id: \.offset) { index, imageUrl in
|
||||||
AsyncImage(url: URL(string: imageUrl)) { image in
|
KFImage(URL(string: imageUrl))
|
||||||
image
|
.placeholder {
|
||||||
.resizable()
|
ProgressView()
|
||||||
.aspectRatio(contentMode: .fit)
|
.tint(.white)
|
||||||
} placeholder: {
|
}
|
||||||
ProgressView()
|
.cancelOnDisappear(true)
|
||||||
.tint(.white)
|
.downsampling(size: CGSize(width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height))
|
||||||
}
|
.resizable()
|
||||||
|
.aspectRatio(contentMode: .fit)
|
||||||
.tag(index)
|
.tag(index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
import Kingfisher
|
||||||
|
|
||||||
struct ChatBgSelectionView: View {
|
struct ChatBgSelectionView: View {
|
||||||
|
|
||||||
@@ -77,16 +78,17 @@ struct ChatBgSelectionView: View {
|
|||||||
|
|
||||||
ZStack(alignment: .bottomTrailing) {
|
ZStack(alignment: .bottomTrailing) {
|
||||||
// 이미지
|
// 이미지
|
||||||
AsyncImage(url: URL(string: item.imageUrl)) { image in
|
KFImage(URL(string: item.imageUrl))
|
||||||
image
|
.placeholder {
|
||||||
.resizable()
|
Rectangle()
|
||||||
.scaledToFill()
|
.fill(Color.gray.opacity(0.3))
|
||||||
.frame(width: width, height: height)
|
}
|
||||||
.clipped()
|
.cancelOnDisappear(true)
|
||||||
} placeholder: {
|
.downsampling(size: CGSize(width: width, height: height))
|
||||||
Rectangle()
|
.resizable()
|
||||||
.fill(Color.gray.opacity(0.3))
|
.scaledToFill()
|
||||||
}
|
.frame(width: width, height: height)
|
||||||
|
.clipped()
|
||||||
.overlay {
|
.overlay {
|
||||||
Rectangle()
|
Rectangle()
|
||||||
.stroke(lineWidth: 5)
|
.stroke(lineWidth: 5)
|
||||||
|
|||||||
Reference in New Issue
Block a user