Skip to content

Commit

Permalink
feat: recordView coordinator 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
guesswb committed Jul 6, 2023
1 parent cdcf77e commit 4668d5e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ extension RecordRunningCoordinator: RunningStartViewControllerDelegate {
func showRecordView(goalType: GoalType, goal: String) {
let recordVC = RecordViewController(viewModel: RecordViewModel(goalType: goalType, goal: goal))
recordVC.modalPresentationStyle = .fullScreen
recordVC.delegate = self
self.navigationController.present(recordVC, animated: false)
}
}
Expand All @@ -76,3 +77,12 @@ extension RecordRunningCoordinator: GoalSettingViewDelegate {
self.navigationController.popViewController(animated: true)
}
}

extension RecordRunningCoordinator: RecordViewDelegate {
func finishRunning() {
self.navigationController.viewControllers.last?.dismiss(animated: false)
let saveRecordRunningVC = SaveRecordRunningViewController()
saveRecordRunningVC.modalPresentationStyle = .fullScreen
self.navigationController.present(saveRecordRunningVC, animated: true)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
import UIKit
import RxSwift

class RecordViewController: BaseViewController {
protocol RecordViewDelegate: AnyObject {
func finishRunning()
}

final class RecordViewController: BaseViewController {

@IBOutlet weak var runningMeasuringView: UIView!
@IBOutlet weak var readyDiscussionLabel: UILabel!
Expand All @@ -24,6 +28,8 @@ class RecordViewController: BaseViewController {
private var readyTimer = Observable<Int>.timer(.seconds(1), period: .seconds(1), scheduler: MainScheduler.instance)
private var viewModel: RecordViewModel

weak var delegate: RecordViewDelegate?

override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
Expand Down Expand Up @@ -107,9 +113,7 @@ class RecordViewController: BaseViewController {
completeButton.rx.controlEvent(.touchDown)
.bind {
Timer.scheduledTimer(withTimeInterval: 2.0, repeats: false, block: {[weak self] timer in
let vc = SaveRecordRunningViewController()
vc.modalPresentationStyle = .fullScreen
self?.present(vc, animated: true)
self?.delegate?.finishRunning()
})

let animation = CABasicAnimation(keyPath: "strokeEnd")
Expand Down

0 comments on commit 4668d5e

Please sign in to comment.