Skip to content

Commit a15e557

Browse files
authored
Merge pull request #125 from boostcampwm-2024/feat/#122-apply-data-cache
[FIX/#122] ์ด๋ฏธ์ง€ ์บ์‹œ ๋ฉ”์„œ๋“œ๋กœ ๋ณ€๊ฒฝ ๋ฐ ๋ฐ”ํ…€ ์‹œํŠธ present detent ์—๋Ÿฌ ์ˆ˜์ •
2 parents 3e6f1d0 + 2dcb2f3 commit a15e557

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

โ€ŽPhotoGether/PresentationLayer/EditPhotoRoomFeature/EditPhotoRoomFeature/Source/StickerBottomSheetViewController.swiftโ€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ public final class StickerBottomSheetViewController: UIViewController, ViewContr
4141
self.bindOutput()
4242
}
4343

44+
public override func viewWillAppear(_ animated: Bool) {
45+
super.viewWillAppear(animated)
46+
47+
self.sheetPresentationController?.detents = [.medium(), .large()]
48+
}
49+
4450
private func setupCollectionView() {
4551
self.collectionView.delegate = self
4652
self.collectionView.dataSource = self
@@ -62,7 +68,6 @@ public final class StickerBottomSheetViewController: UIViewController, ViewContr
6268
}
6369

6470
public func configureUI() {
65-
self.sheetPresentationController?.detents = [.medium(), .large()]
6671
self.view.backgroundColor = PTGColor.gray10.color
6772
}
6873

โ€ŽPhotoGether/PresentationLayer/EditPhotoRoomFeature/EditPhotoRoomFeature/Source/StickerCollectionViewCell.swiftโ€Ž

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,7 @@ final class StickerCollectionViewCell: UICollectionViewCell {
3232
private func configureUI() { }
3333

3434
func setupImage(by emoji: EmojiEntity) {
35-
Task {
36-
guard let url = URL(string: emoji.image),
37-
let (data, _) = try? await URLSession.shared.data(from: url)
38-
else { return }
39-
40-
self.imageView.image = UIImage(data: data)
41-
}
35+
guard let url = URL(string: emoji.image) else { return }
36+
Task { await imageView.setAsyncImage(url) }
4237
}
4338
}

โ€ŽPhotoGether/PresentationLayer/EditPhotoRoomFeature/EditPhotoRoomFeature/Source/View/StickerView.swiftโ€Ž

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,7 @@ final class StickerView: UIImageView {
121121

122122
private func setImage(to urlString: String) {
123123
guard let url = URL(string: urlString) else { return }
124-
125-
Task { [weak self] in
126-
guard let (data, _) = try? await URLSession.shared.data(from: url)
127-
else { return }
128-
129-
self?.image = UIImage(data: data)
130-
}
124+
Task { await self.setAsyncImage(url) }
131125
}
132126

133127
@objc private func handleTap() {

0 commit comments

Comments
ย (0)