diff --git a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj index 51394f90..b5e17360 100644 --- a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj +++ b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj @@ -68,6 +68,7 @@ CE665612295D92E400C64E12 /* UserDefaultWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE665611295D92E400C64E12 /* UserDefaultWrapper.swift */; }; CE665615295D989A00C64E12 /* .swiftlint.yml in Resources */ = {isa = PBXBuildFile; fileRef = CE665614295D989A00C64E12 /* .swiftlint.yml */; }; CEB8416E2962C45300BF8080 /* LocationSearchResultTVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEB8416D2962C45300BF8080 /* LocationSearchResultTVC.swift */; }; + CEB841702963360800BF8080 /* CountDownVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEB8416F2963360800BF8080 /* CountDownVC.swift */; }; CEC2A6852961F92C00160BF7 /* CustomButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEC2A6842961F92C00160BF7 /* CustomButton.swift */; }; CEC2A68729629B9B00160BF7 /* SignInVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEC2A68629629B9B00160BF7 /* SignInVC.swift */; }; CEC2A68A2962ADCD00160BF7 /* RNMapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEC2A6892962ADCD00160BF7 /* RNMapView.swift */; }; @@ -153,6 +154,7 @@ CE665611295D92E400C64E12 /* UserDefaultWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultWrapper.swift; sourceTree = ""; }; CE665614295D989A00C64E12 /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = ""; }; CEB8416D2962C45300BF8080 /* LocationSearchResultTVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationSearchResultTVC.swift; sourceTree = ""; }; + CEB8416F2963360800BF8080 /* CountDownVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountDownVC.swift; sourceTree = ""; }; CEC2A6842961F92C00160BF7 /* CustomButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomButton.swift; sourceTree = ""; }; CEC2A68629629B9B00160BF7 /* SignInVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInVC.swift; sourceTree = ""; }; CEC2A6892962ADCD00160BF7 /* RNMapView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNMapView.swift; sourceTree = ""; }; @@ -292,6 +294,7 @@ children = ( CEEC6B392961C4F300D00E1E /* CourseDrawingHomeVC.swift */, CEC2A6912962BE2900160BF7 /* DepartureSearchVC.swift */, + CEB8416F2963360800BF8080 /* CountDownVC.swift */, ); path = VC; sourceTree = ""; @@ -833,6 +836,7 @@ CE6655D0295D85FF00C64E12 /* CancelBag.swift in Sources */, CE6655DC295D873500C64E12 /* UIButton+.swift in Sources */, CE6655D4295D865B00C64E12 /* Publisher+UIControl.swift in Sources */, + CEB841702963360800BF8080 /* CountDownVC.swift in Sources */, CE6655EC295D88D000C64E12 /* UITableView+.swift in Sources */, CEEC6B3A2961C4F300D00E1E /* CourseDrawingHomeVC.swift in Sources */, CEC2A6902962B06C00160BF7 /* convertLocationObject.swift in Sources */, diff --git a/Runnect-iOS/Runnect-iOS/Global/Literal/FontLiterals.swift b/Runnect-iOS/Runnect-iOS/Global/Literal/FontLiterals.swift index 618c2eb7..a39df7d3 100644 --- a/Runnect-iOS/Runnect-iOS/Global/Literal/FontLiterals.swift +++ b/Runnect-iOS/Runnect-iOS/Global/Literal/FontLiterals.swift @@ -32,6 +32,10 @@ extension UIFont { return UIFont.font(.pretendardSemiBold, ofSize: 15) } + @nonobjc class var h6: UIFont { + return UIFont.font(.pretendardSemiBold, ofSize: 160) + } + @nonobjc class var b1: UIFont { return UIFont.font(.pretendardMedium, ofSize: 17) } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CountDownVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CountDownVC.swift new file mode 100644 index 00000000..ed63d9de --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CountDownVC.swift @@ -0,0 +1,88 @@ +// +// CountDownVC.swift +// Runnect-iOS +// +// Created by sejin on 2023/01/03. +// + +import UIKit + +final class CountDownVC: UIViewController { + + // MARK: - Properties + + private var count = 3 + + // MARK: - UI Components + + private let backgroundImageView = UIImageView().then { + $0.image = ImageLiterals.imgBackground + $0.contentMode = .scaleAspectFill + } + + private let timeLabel = UILabel().then { + $0.text = "3" + $0.font = .h6 + $0.textColor = .w1 + } + + private let directionLabel = UILabel().then { + $0.text = "잠시 후 러닝을 시작합니다" + $0.font = .b1 + $0.textColor = .w1 + } + + // MARK: - View Life Cycle + + override func viewDidLoad() { + super.viewDidLoad() + setUI() + setLayout() + animateTimeLabel() + } +} + +// MARK: - Methods + +extension CountDownVC { + private func animateTimeLabel() { + self.timeLabel.transform = CGAffineTransform(scaleX: 0.4, y: 0.4) + self.timeLabel.text = "\(self.count)" + UIView.animate(withDuration: 1.0, animations: { + self.timeLabel.transform = CGAffineTransform(scaleX: 1, y: 1) + }, completion: { _ in + self.count -= 1 + if self.count > 0 { + self.animateTimeLabel() + } else { + print("Done") + } + }) + } +} + +// MARK: - UI & Layout + +extension CountDownVC { + private func setUI() { + view.backgroundColor = .m1 + } + + private func setLayout() { + view.addSubviews(backgroundImageView, timeLabel, directionLabel) + + backgroundImageView.snp.makeConstraints { make in + make.edges.equalToSuperview() + } + + timeLabel.snp.makeConstraints { make in + make.centerX.equalTo(view.safeAreaLayoutGuide) + make.centerY.equalTo(view.safeAreaLayoutGuide).multipliedBy(0.9) + } + + directionLabel.snp.makeConstraints { make in + make.centerX.equalTo(view.safeAreaLayoutGuide) + make.centerY.equalTo(view.safeAreaLayoutGuide).multipliedBy(1.15) + } + } +} diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingHomeVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingHomeVC.swift index 55a0bcae..05a8d25e 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingHomeVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingHomeVC.swift @@ -71,5 +71,3 @@ extension CourseDrawingHomeVC { } } } - -