-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'iOS/release' into iOS/task/RewindJourney-Music
- Loading branch information
Showing
30 changed files
with
556 additions
and
140 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
14 changes: 14 additions & 0 deletions
14
iOS/Features/Home/Sources/NavigateMap/Presentation/Common/MapViewControllerDelegate.swift
This file contains 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,14 @@ | ||
// | ||
// MapViewControllerDelegate.swift | ||
// NavigateMap | ||
// | ||
// Created by 이창준 on 2023.12.10. | ||
// | ||
|
||
import Foundation | ||
|
||
public protocol MapViewControllerDelegate: AnyObject { | ||
|
||
func mapViewControllerDidChangeVisibleRegion(_ mapViewController: MapViewController) | ||
|
||
} |
This file contains 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 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 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 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
63 changes: 63 additions & 0 deletions
63
iOS/Features/Spot/Sources/Spot/Presentation/SpotViewController+Gesture.swift
This file contains 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,63 @@ | ||
// | ||
// SpotViewController+Gesture.swift | ||
// Spot | ||
// | ||
// Created by 전민건 on 12/10/23. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
// MARK: - Constants | ||
|
||
private enum Metric { | ||
|
||
static let movedXPositionToBackScene: CGFloat = 50.0 | ||
static let animationDuration: Double = 0.3 | ||
|
||
} | ||
|
||
// MARK: - Gesture | ||
|
||
internal extension SpotViewController { | ||
|
||
func configureLeftToRightSwipeGesture() { | ||
let panGesture = UIPanGestureRecognizer(target: self, action: #selector(panGestureDismiss(_:))) | ||
self.view.addGestureRecognizer(panGesture) | ||
} | ||
|
||
@objc | ||
private func panGestureDismiss(_ sender: UIPanGestureRecognizer) { | ||
let touchPoint = sender.location(in: self.view.window) | ||
let width = self.view.frame.width | ||
let height = self.view.frame.height | ||
switch sender.state { | ||
case .began: | ||
self.initialTouchPoint = touchPoint | ||
case .changed: | ||
if touchPoint.x - self.initialTouchPoint.x > .zero { | ||
self.view.frame = CGRect(x: touchPoint.x - self.initialTouchPoint.x, | ||
y: .zero, | ||
width: width, | ||
height: height) | ||
} | ||
case .ended, .cancelled: | ||
if touchPoint.x - self.initialTouchPoint.x > Metric.movedXPositionToBackScene { | ||
self.navigationDelegate?.popToHome() | ||
} else { | ||
self.view.frame = CGRect(x: .zero, | ||
y: .zero, | ||
width: width, | ||
height: height) | ||
} | ||
default: | ||
UIView.animate(withDuration: Metric.animationDuration) { | ||
self.view.frame = CGRect(x: .zero, | ||
y: .zero, | ||
width: width, | ||
height: height) | ||
} | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.