-
Notifications
You must be signed in to change notification settings - Fork 0
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
✨ 다른 앱에서 스트릿드랍으로 공유하는 Share Extension 기능 추가 #300
base: feature/region-filtering
Are you sure you want to change the base?
Conversation
…고 서버통신을 통해 주소 찍어줌 - 그 외 몇가지 UI들만 추가
…usic Array 첫번째 인덱스값 앨범커버, 노래이름, 아티스트이름 UI에 표시
… Share Extension 앱타겟 추가
- Share Extension에서는 UIApplication.shared.open(url) 사용 불가능해서 SFSafariViewController로 노션페이지 띄움
- 기존 드랍하기 버튼 이외에, 텍스트뷰 클릭해서 키보드 올라올때, 키보드 바로위에 드랍하기 버튼 추가
…WithMaxCount 키값 1로 설정해서 한 번에 하나의 웹 URL만 수락하도록 함 - NSExtensionActivationSupportsWebURLWithMaxCount: 이 키는 확장이 웹 URL을 수락하고 처리할 수 있다는 것을 나타냄. 값은 최대 몇 개의 웹 URL을 한 번에 지원할 수 있는지를 나타내는 정수로 설정
… 공유된 곡이름 통해 검색 및 테이블 뷰 데이터들 나타냄
- 기존 데이터는 뒤에 "- TOPIC' 접미어가 붙어 검색 정확도가 떨어졌음
…시, 테이블뷰에 빈배열(빈화면) 보여줌
- 원래 changingMusicView 클릭 할때만 이벤트 발생해야함
- '음악 검색하기'버튼 클릭 시, 빈 테이블뷰의 재검색 화면으로 이동
- 정상 동작을 위한 재기동을 위해 팝업 확인 버튼 클릭 시, Share Extension 종료
…없는 경우(음악 정보 못가져온 경우) 딜레이없이 빠르게 관련 UI 렌더링
…ion과 App간의 App Groups를 설정
… 필요하기 때문에 앱의 드랍하기 로직과 분기
…랍한 아이템에 대한 커뮤니티 Scene에서 렌더링 - Share Extension에서 드랍한 아이템 ID, UserDefaults에 저장 및 메인 Scene ViewDidAppear 또는 Bakcground -> Foreground 전환 시 커뮤니티 Scene 렌더링
|
||
layoutIfNeeded() | ||
|
||
let contentContainerHeight = 16 + 48 + 33 + commentLabel.actualNumberOfLines() * 20 + 46 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
어떤 컴포넌트의 height인지 상수로 선언되어 있으면 더 좋겠네요..! (유지보수를 위하여,,)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다 요셉님~~!
private lazy var searchCancelView: UIView = { | ||
let view: UIView = .init() | ||
|
||
return view | ||
}() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private lazy var searchCancelView: UIView = { | |
let view: UIView = .init() | |
return view | |
}() | |
private lazy var searchCancelView: UIView = .init() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lazy 도 빼도 될거같네용
private let warningImageView: UIImageView = { | ||
let imageView: UIImageView = .init(image: .init(named: "warning")) | ||
|
||
return imageView | ||
}() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private let warningImageView: UIImageView = { | |
let imageView: UIImageView = .init(image: .init(named: "warning")) | |
return imageView | |
}() | |
private let warningImageView: UIImageView = .init(image: .init(named: "warning")) |
func bindAction() { | ||
searchTextField.rx.text.orEmpty | ||
.filter { $0.isEmpty } | ||
.map { _ in } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.map { _ in } |
|
||
sceneDelegate.navigateToCommunity(with: shareExtensionDroppedItemID) | ||
sharedDefaults.removeObject(forKey: "ShareExtensionDroppedItemID") | ||
sharedDefaults.synchronize() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
synchronize() 메서드는 공식 레퍼런스에서도 사용하지 않는 것을 권장하고 있습니다!
참고
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다~!!
private lazy var searchCancelView: UIView = { | ||
let view: UIView = .init() | ||
|
||
return view | ||
}() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lazy 도 빼도 될거같네용
override func setSelected(_ selected: Bool, animated: Bool) { | ||
super.setSelected(selected, animated: animated) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
별도 작업을 하지 않아서 제거해도 될거같네용~
|
||
communityGuideButton.rx.tap | ||
.bind { [weak self] in | ||
guard let self = self else { return } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
옵셔널 제거 단축 syntax 로 써도 될거같아요~!
https://github.com/swiftlang/swift-evolution/blob/main/proposals/0345-if-let-shorthand.md
guard let self = self else { return } | |
guard let self else { return } |
} onFailure: { owner, error in | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제거해도될거같네용~
|
||
func navigateToCommunity(with itemID: Int) { | ||
let sceneDelegate = UIApplication.shared.connectedScenes | ||
.first!.delegate as? SceneDelegate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
지금도 type 이 SceneDelegate? 라서 first? 로 써도 될거같아요~
let sceneDelegate = UIApplication.shared.connectedScenes | ||
.first!.delegate as? SceneDelegate | ||
|
||
if let navigationView = topViewController(base: sceneDelegate?.window!.rootViewController)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도 window? 해도 될거같네용~
d932c53
to
49432e0
Compare
📌 배경
close #297
내용
테스트 방법 (optional)
스크린샷 (optional)
RPReplay_Final1724291345-2.MP4
RPReplay_Final1724291387-2.MP4