-
Notifications
You must be signed in to change notification settings - Fork 6
[Feat] #191 - 위치선택 지도에서 선택 기능 추가 #205
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
The head ref may contain hidden characters: "#191-\uC704\uCE58\uC120\uD0DD"
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
ffd8ada
[Add] #191 - 아이콘 추가
513sojin 074eba6
[Feat] #191 - 현재 위치 혹은 지도 선택 UI 구현
513sojin 58b23f5
[Feat] #191 - BaseView 추가
513sojin 442c834
[Feat] #191 - combineCocoa 설치
513sojin bb600b2
[Feat] #191 - view에 tapgesture 추가
513sojin 1a8cb86
[Feat] #191 - 위도 경도에 따른 주소 가져오는 api 연결
513sojin f261df1
[Feat] #191 - tmap api 연결
513sojin b641edf
[Feat] #191 - 지도에서 선택시 마커 추가
513sojin 0e733d9
[Feat] #191 - 지도 위치에 따라 위치 정보 변경
513sojin 90a10bc
[Feat] #191 - 지도에서 선택한 경우 분기처리
513sojin 1f77f0f
[Feat] #191 - 코스 이름 바텀시트 UI 구현
513sojin c457fcf
[Feat] #191 - textfield 이벤트 추가
513sojin ed1874c
Merge branch 'develop' into #191-위치선택
513sojin e77759e
[Feat] #191 - 주석 추가
513sojin 2b98db7
[Del] #191 - 바텀시트VC 삭제
513sojin e7b6a3a
[Fix] #191 - 카카오 주소 찾기 api 삭제
513sojin 79aa673
[Feat] #191 - 지도에서 선택된 경우 네비바 문구 수정
513sojin 0e21db2
[Feat] #191 - 지도에서 선택시 안내 문구 뷰 추가
513sojin 0b5232a
[Feat] #191 - 라이브러리 업데이트
513sojin 02c6365
Merge branch 'develop' into #191-위치선택
513sojin 78c4a15
Merge branch 'develop' into #191-위치선택
513sojin 63bb063
[Fix] podfile 수정
513sojin 2ba2da7
[Fix] #191 - project 파일 변경 및 접근제한자 수정
513sojin 1367f1f
[Fix] #191 - 코드리뷰 반영
513sojin 4c5966f
[Fix] #191 - 싱글톤으로 수정
513sojin 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
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
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
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,41 @@ | ||
| // | ||
| // BaseView.swift | ||
| // Runnect-iOS | ||
| // | ||
| // Created by Sojin Lee on 2023/09/25. | ||
| // | ||
|
|
||
| import UIKit | ||
| import SnapKit | ||
|
|
||
| protocol BaseViewProtocol { | ||
| func setDelegate() | ||
| func setUI() | ||
| func setLayout() | ||
| } | ||
|
|
||
| class BaseView: UIView, BaseViewProtocol { | ||
| // MARK: - Initializer | ||
|
|
||
| override init(frame: CGRect) { | ||
| super.init(frame: frame) | ||
|
|
||
| setDelegate() | ||
| setUI() | ||
| setLayout() | ||
| } | ||
|
|
||
| @available(*, unavailable) | ||
| required init?(coder _: NSCoder) { | ||
| fatalError("init(coder:) has not been implemented") | ||
| } | ||
|
|
||
| // MARK: - Setup Methods | ||
|
|
||
| func setDelegate() { } | ||
|
|
||
| func setUI() { } | ||
|
|
||
| func setLayout() { } | ||
| } | ||
|
|
||
82 changes: 82 additions & 0 deletions
82
Runnect-iOS/Runnect-iOS/Global/Extension/UIKit+/UIGestureRecognizer+.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,82 @@ | ||
| // | ||
| // UIGestureRecognizer+.swift | ||
| // Runnect-iOS | ||
| // | ||
| // Created by Sojin Lee on 2023/09/26. | ||
| // | ||
|
|
||
| import UIKit | ||
| import Combine | ||
|
|
||
| enum GestureType { | ||
| case tap(UITapGestureRecognizer = .init()) | ||
| case swipe(UISwipeGestureRecognizer = .init()) | ||
| case longPress(UILongPressGestureRecognizer = .init()) | ||
| case pan(UIPanGestureRecognizer = .init()) | ||
| case pinch(UIPinchGestureRecognizer = .init()) | ||
| case edge(UIScreenEdgePanGestureRecognizer = .init()) | ||
| func get() -> UIGestureRecognizer { | ||
| switch self { | ||
| case let .tap(tapGesture): | ||
| return tapGesture | ||
| case let .swipe(swipeGesture): | ||
| return swipeGesture | ||
| case let .longPress(longPressGesture): | ||
| return longPressGesture | ||
| case let .pan(panGesture): | ||
| return panGesture | ||
| case let .pinch(pinchGesture): | ||
| return pinchGesture | ||
| case let .edge(edgePanGesture): | ||
| return edgePanGesture | ||
| } | ||
| } | ||
| } | ||
|
|
||
| extension UIGestureRecognizer { | ||
| struct GesturePublisher: Publisher { | ||
| typealias Output = GestureType | ||
| typealias Failure = Never | ||
| private let view: UIView | ||
| private let gestureType: GestureType | ||
| init(view: UIView, gestureType: GestureType) { | ||
| self.view = view | ||
| self.gestureType = gestureType | ||
| } | ||
| func receive<S>(subscriber: S) where S : Subscriber, | ||
| GesturePublisher.Failure == S.Failure, GesturePublisher.Output | ||
| == S.Input { | ||
| let subscription = GestureSubscription( | ||
| subscriber: subscriber, | ||
| view: view, | ||
| gestureType: gestureType | ||
| ) | ||
| subscriber.receive(subscription: subscription) | ||
| } | ||
| } | ||
|
|
||
| class GestureSubscription<S: Subscriber>: Subscription where S.Input == GestureType, S.Failure == Never { | ||
| private var subscriber: S? | ||
| private var gestureType: GestureType | ||
| private var view: UIView | ||
| init(subscriber: S, view: UIView, gestureType: GestureType) { | ||
| self.subscriber = subscriber | ||
| self.view = view | ||
| self.gestureType = gestureType | ||
| configureGesture(gestureType) | ||
| } | ||
| private func configureGesture(_ gestureType: GestureType) { | ||
| let gesture = gestureType.get() | ||
| gesture.addTarget(self, action: #selector(handler)) | ||
| view.addGestureRecognizer(gesture) | ||
| } | ||
| func request(_ demand: Subscribers.Demand) { } | ||
| func cancel() { | ||
| subscriber = nil | ||
| } | ||
| @objc | ||
| private func handler() { | ||
| _ = subscriber?.receive(gestureType) | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
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.
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.
오.. 리팩터링할때 정말 유용할 것 같습니다 👍👍👍