-
Notifications
You must be signed in to change notification settings - Fork 2
[FEAT/#77] 스티커를 선택할 수 있는 기능을 구현합니다. #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
6e3e1cb
fix/#77 :: CanvasScrollView 내부 객체를 탭할 수 있도록 변경
hsw1920 95887bb
feat/#77 StickerView UI 구현
hsw1920 3d17228
feat/#77 :: StickerView tapPublisher 구현
hsw1920 724a11f
feat/#77 :: StickerView update 구현
hsw1920 896b7eb
chore/#77 :: 불필요한 코드 및 주석 삭제
hsw1920 076a58b
refactor/#77 :: 변하지 않는 인스턴스를 let으로 변경
hsw1920 67f66b7
feat/#77 :: EditPhotoRoomViewModel input event 추가
hsw1920 1d9e1ad
feat/#77 :: EventEntity에 unlock 케이스 추가
hsw1920 f500d1d
fix/#77 :: StickerList Identifiable 관련 버그 수정
hsw1920 75488d7
feat/#77 :: Host, Guest를 구분할 수 있는 인스턴스 추가
hsw1920 f3de2cd
feat/#77 :: 스티커뷰 탭 관련 비즈니스 로직 구현
hsw1920 25990e2
refactor/#77 :: 코드 가독성 및 재활용성 개선
hsw1920 b763e0c
chore/#77 :: 불필요한 주석 삭제
hsw1920 fe309a5
fix/#77 :: EventQueue 버그 수정
hsw1920 76be477
refactor/#77 :: StickerViewActionDelegate 구현
hsw1920 99d7ee7
style/#77 :: 코드 컨벤션 및 공백 추가
hsw1920 903a6de
feat/#77 :: StickerEntity Array 서브스크립트 추가 및 적용
hsw1920 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...PresentationLayer/EditPhotoRoomFeature/EditPhotoRoomFeature/Source/View/StickerView.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import DesignSystem | ||
| import PhotoGetherDomainInterface | ||
| import UIKit | ||
|
|
||
| final class StickerView: UIImageView { | ||
| private let nicknameLabel = UILabel() | ||
|
|
||
| private var sticker: StickerEntity | ||
|
|
||
|
|
||
| init(sticker: StickerEntity) { | ||
| self.sticker = sticker | ||
| super.init(frame: sticker.frame) | ||
| setupTapGesture() | ||
| addViews() | ||
| setupConstraints() | ||
| configureUI() | ||
| } | ||
|
|
||
| @available(*, unavailable) | ||
| required init?(coder: NSCoder) { | ||
| fatalError("init(coder:) has not been implemented") | ||
| } | ||
|
|
||
| private func addViews() { | ||
| addSubview(nicknameLabel) | ||
| } | ||
|
|
||
| private func setupConstraints() { | ||
| nicknameLabel.snp.makeConstraints { | ||
| $0.top.equalTo(snp.bottom) | ||
| $0.trailing.equalTo(snp.trailing) | ||
| } | ||
| } | ||
|
|
||
| private func configureUI() { | ||
| layer.borderColor = PTGColor.primaryGreen.color.cgColor | ||
| setImage(to: sticker.image) | ||
|
|
||
| sticker.owner != nil | ||
| ? (layer.borderWidth = 1) | ||
| : (layer.borderWidth = 0) | ||
| } | ||
|
|
||
| private func setupTapGesture() { | ||
| isUserInteractionEnabled = true | ||
|
|
||
| let tapGesture = UITapGestureRecognizer(target: self, action: #selector(handleTap)) | ||
| addGestureRecognizer(tapGesture) | ||
| } | ||
|
|
||
| private func setImage(to urlString: String) { | ||
| guard let url = URL(string: urlString) else { return } | ||
|
|
||
| Task { [weak self] in | ||
| guard let (data, _) = try? await URLSession.shared.data(from: url) | ||
| else { return } | ||
|
|
||
| self?.image = UIImage(data: data) | ||
| } | ||
| } | ||
youn9k marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.