Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -153,6 +154,7 @@
CE665611295D92E400C64E12 /* UserDefaultWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultWrapper.swift; sourceTree = "<group>"; };
CE665614295D989A00C64E12 /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = "<group>"; };
CEB8416D2962C45300BF8080 /* LocationSearchResultTVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationSearchResultTVC.swift; sourceTree = "<group>"; };
CEB8416F2963360800BF8080 /* CountDownVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountDownVC.swift; sourceTree = "<group>"; };
CEC2A6842961F92C00160BF7 /* CustomButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomButton.swift; sourceTree = "<group>"; };
CEC2A68629629B9B00160BF7 /* SignInVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInVC.swift; sourceTree = "<group>"; };
CEC2A6892962ADCD00160BF7 /* RNMapView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNMapView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -292,6 +294,7 @@
children = (
CEEC6B392961C4F300D00E1E /* CourseDrawingHomeVC.swift */,
CEC2A6912962BE2900160BF7 /* DepartureSearchVC.swift */,
CEB8416F2963360800BF8080 /* CountDownVC.swift */,
);
path = VC;
sourceTree = "<group>";
Expand Down Expand Up @@ -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 */,
Expand Down
4 changes: 4 additions & 0 deletions Runnect-iOS/Runnect-iOS/Global/Literal/FontLiterals.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

옹 애니메이션.. 신기하네욥...

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

높이 계산할 때 multipliedBy를 쓴 이유가 몬가욥?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

중앙 정렬을 하고 중앙보다 살짝 위 또는 아래에 위치시키기 위해 multipliedBy를 사용했어요~!
이렇게 하면 크기가 다른 기기에서도 동일한 위치(중앙에서 떨어진 비율)을 유지할 수 있어요!

}

directionLabel.snp.makeConstraints { make in
make.centerX.equalTo(view.safeAreaLayoutGuide)
make.centerY.equalTo(view.safeAreaLayoutGuide).multipliedBy(1.15)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,3 @@ extension CourseDrawingHomeVC {
}
}
}