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
36 changes: 36 additions & 0 deletions Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
A3BC2F3D296468E500198261 /* UploadedCourseInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3BC2F3C296468E500198261 /* UploadedCourseInfoModel.swift */; };
A3BC2F3F2964706100198261 /* UploadedCourseInfoCVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3BC2F3E2964706100198261 /* UploadedCourseInfoCVC.swift */; };
CE0D9FD329648DA300CEB5CD /* CustomAlertVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE0D9FD229648DA300CEB5CD /* CustomAlertVC.swift */; };
CE146770296568DC00DCEA1B /* RunTrackingVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE14676F296568DC00DCEA1B /* RunTrackingVC.swift */; };
CE14677829658C7200DCEA1B /* Stopwatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE14677729658C7200DCEA1B /* Stopwatch.swift */; };
CE14677A2965A80700DCEA1B /* CustomBottomSheetVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE1467792965A80700DCEA1B /* CustomBottomSheetVC.swift */; };
CE17F02D2961BBA100E1DED0 /* ColorLiterals.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE17F02C2961BBA100E1DED0 /* ColorLiterals.swift */; };
CE17F0332961BEF800E1DED0 /* Pretendard-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = CE17F02F2961BEF800E1DED0 /* Pretendard-Medium.otf */; };
CE17F0342961BEF800E1DED0 /* Pretendard-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = CE17F0302961BEF800E1DED0 /* Pretendard-Bold.otf */; };
Expand Down Expand Up @@ -104,6 +107,9 @@
A3BC2F3C296468E500198261 /* UploadedCourseInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadedCourseInfoModel.swift; sourceTree = "<group>"; };
A3BC2F3E2964706100198261 /* UploadedCourseInfoCVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadedCourseInfoCVC.swift; sourceTree = "<group>"; };
CE0D9FD229648DA300CEB5CD /* CustomAlertVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomAlertVC.swift; sourceTree = "<group>"; };
CE14676F296568DC00DCEA1B /* RunTrackingVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunTrackingVC.swift; sourceTree = "<group>"; };
CE14677729658C7200DCEA1B /* Stopwatch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Stopwatch.swift; sourceTree = "<group>"; };
CE1467792965A80700DCEA1B /* CustomBottomSheetVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomBottomSheetVC.swift; sourceTree = "<group>"; };
CE17F02C2961BBA100E1DED0 /* ColorLiterals.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorLiterals.swift; sourceTree = "<group>"; };
CE17F02F2961BEF800E1DED0 /* Pretendard-Medium.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Medium.otf"; sourceTree = "<group>"; };
CE17F0302961BEF800E1DED0 /* Pretendard-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Bold.otf"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -259,6 +265,30 @@
path = UploadedCourseInfoCollectionView;
sourceTree = "<group>";
};
CE14676C296568C000DCEA1B /* RunTracking */ = {
isa = PBXGroup;
children = (
CE14676E296568CD00DCEA1B /* Views */,
CE14676D296568CA00DCEA1B /* VC */,
);
path = RunTracking;
sourceTree = "<group>";
};
CE14676D296568CA00DCEA1B /* VC */ = {
isa = PBXGroup;
children = (
CE14676F296568DC00DCEA1B /* RunTrackingVC.swift */,
);
path = VC;
sourceTree = "<group>";
};
CE14676E296568CD00DCEA1B /* Views */ = {
isa = PBXGroup;
children = (
);
path = Views;
sourceTree = "<group>";
};
CE17F02E2961BEAE00E1DED0 /* Fonts */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -448,6 +478,7 @@
CE17F03C2961C32C00E1DED0 /* CourseDiscovery */,
CE17F03B2961C2F700E1DED0 /* MyPage */,
CE17F03E2961C38100E1DED0 /* CourseDetail */,
CE14676C296568C000DCEA1B /* RunTracking */,
);
path = Presentation;
sourceTree = "<group>";
Expand Down Expand Up @@ -549,6 +580,7 @@
CE6655C9295D84DD00C64E12 /* UserDefaultKeyList.swift */,
CEC2A68F2962B06C00160BF7 /* convertLocationObject.swift */,
CE29D583296416D800F47542 /* caculateStatusBarHeight.swift */,
CE14677729658C7200DCEA1B /* Stopwatch.swift */,
);
path = Utils;
sourceTree = "<group>";
Expand Down Expand Up @@ -600,6 +632,7 @@
CEEC6B4A2961D89700D00E1E /* CustomNavigationBar.swift */,
CEC2A6842961F92C00160BF7 /* CustomButton.swift */,
CE0D9FD229648DA300CEB5CD /* CustomAlertVC.swift */,
CE1467792965A80700DCEA1B /* CustomBottomSheetVC.swift */,
);
path = UIComponents;
sourceTree = "<group>";
Expand Down Expand Up @@ -842,6 +875,7 @@
CE665602295D918000C64E12 /* JsonCoder.swift in Sources */,
CE4545CD295D7AF4003201E1 /* TaBarController.swift in Sources */,
CE6655F4295D898400C64E12 /* UIViewController+.swift in Sources */,
CE14677829658C7200DCEA1B /* Stopwatch.swift in Sources */,
CE5645162961B72E000A2856 /* ImageLiterals.swift in Sources */,
CE6655CD295D856300C64E12 /* KeyPathFindable.swift in Sources */,
CE29D582296402B500F47542 /* CourseDrawingVC.swift in Sources */,
Expand Down Expand Up @@ -888,13 +922,15 @@
CE6655DE295D877F00C64E12 /* UIColor+.swift in Sources */,
CEEC6B402961C55000D00E1E /* MyPageVC.swift in Sources */,
CE665608295D921500C64E12 /* setImage.swift in Sources */,
CE146770296568DC00DCEA1B /* RunTrackingVC.swift in Sources */,
CE665612295D92E400C64E12 /* UserDefaultWrapper.swift in Sources */,
A3BC2F3A2963D0ED00198261 /* ActivityRecordInfoTVC.swift in Sources */,
CE665610295D92C200C64E12 /* setTextLineHeight.swift in Sources */,
CE6655E2295D87EB00C64E12 /* UIImage+.swift in Sources */,
A3BC2F322962E0DB00198261 /* GoalRewardInfoModel.swift in Sources */,
CEC2A68C2962AE1B00160BF7 /* RNStartMarker.swift in Sources */,
CE5875A4296015D2005D967E /* Encodable+.swift in Sources */,
CE14677A2965A80700DCEA1B /* CustomBottomSheetVC.swift in Sources */,
CEEC6B4B2961D89700D00E1E /* CustomNavigationBar.swift in Sources */,
CE17F02D2961BBA100E1DED0 /* ColorLiterals.swift in Sources */,
CEC2A68E2962AF2C00160BF7 /* RNMarker.swift in Sources */,
Expand Down
1 change: 1 addition & 0 deletions Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ enum ImageLiterals {
static var imgStorage: UIImage { .load(named: "img_storage") }
static var imgLock: UIImage { .load(named: "img_lock") }
static var imgTelescope: UIImage { .load(named: "img_telescope") }
static var imgAppIcon: UIImage { .load(named: "img_app_icon") }
}

extension UIImage {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"images" : [
{
"filename" : "runnect logo-01 1.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"images" : [
{
"filename" : "btn_back.png",
"filename" : "back.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "btn_back@2x.png",
"filename" : "back@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "btn_back@3x.png",
"filename" : "back@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"images" : [
{
"filename" : "map_location.png",
"filename" : "btn.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "map_location@2x.png",
"filename" : "btn@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "map_location@3x.png",
"filename" : "btn@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "original"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "original"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "runnect logo-01 1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "runnect logo-01 1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "runnect logo-01 1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class CustomAlertVC: UIViewController {

private let alertView = UIView()
private let alertImageView = UIImageView().then {
$0.image = ImageLiterals.imgTelescope
$0.image = ImageLiterals.imgPaper
}
private let contentsLabel = UILabel().then {
$0.text = "코스를 만들었어요!"
Expand Down
103 changes: 103 additions & 0 deletions Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomBottomSheetVC.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
//
// CustomBottomSheetVC.swift
// Runnect-iOS
//
// Created by sejin on 2023/01/04.
//

import UIKit
import Combine

final class CustomBottomSheetVC: UIViewController {

// MARK: - Properties

var completeButtonTapped: Driver<Void> {
completeButton.publisher(for: .touchUpInside)
.map { _ in }
.asDriver()
}

// MARK: - UI Components

private let bottomSheetView = UIView().then {
$0.backgroundColor = .w1
$0.layer.cornerRadius = 20
$0.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]
}

private let contentsLabel = UILabel().then {
$0.text = "수고하셨습니다! 러닝을 완료했어요!"
$0.font = .h5
$0.textColor = .g2
}

private let mainImageView = UIImageView().then {
$0.image = ImageLiterals.imgTelescope
}

private let completeButton = CustomButton(title: "기록 보러가기")

// MARK: - View Life Cycle

override func viewDidLoad() {
super.viewDidLoad()
self.setUI()
self.setLayout()
}
}

// MARK: - Methods

extension CustomBottomSheetVC {

/// 바텀 시트의 라벨에 들어갈 텍스트 설정
@discardableResult
func setContentsText(text: String) -> Self {
self.contentsLabel.text = text
return self
}

/// 하단 버튼의 텍스트 변경
@discardableResult
public func setBottomButtonTitle(_ title: NSAttributedString) -> Self {
self.completeButton.changeTitle(attributedString: title)
return self
}
}

// MARK: - UI & Layout

extension CustomBottomSheetVC {
private func setUI() {
view.backgroundColor = .black.withAlphaComponent(0.8)
}

private func setLayout() {
view.addSubviews(bottomSheetView)
bottomSheetView.addSubviews(contentsLabel, mainImageView, completeButton)

bottomSheetView.snp.makeConstraints { make in
make.leading.bottom.trailing.equalToSuperview()
make.height.equalTo(330)
}

contentsLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalToSuperview().inset(26)
}

mainImageView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(contentsLabel.snp.bottom).offset(8)
make.width.equalTo(223)
make.height.equalTo(180)
}

completeButton.snp.makeConstraints { make in
make.top.equalTo(mainImageView.snp.bottom).offset(20)
make.height.equalTo(44)
make.leading.trailing.equalToSuperview().inset(16)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ extension RNMapView {
@discardableResult
func makeMarkersWithStartMarker(at locations: [NMGLatLng]) -> Self {
if locations.count < 2 { return self }
makeStartMarker(at: locations[0])
makeStartMarker(at: locations[0], withCameraMove: true)
locations[1...].forEach { location in
makeMarker(at: location)
}
Expand Down Expand Up @@ -329,8 +329,8 @@ extension RNMapView {
}

locationButton.snp.makeConstraints { make in
make.bottom.equalToSuperview().inset(98+bottomPadding)
make.trailing.equalToSuperview().inset(24)
make.bottom.equalToSuperview().inset(88+bottomPadding)
make.trailing.equalToSuperview().inset(12)
}
}

Expand Down
55 changes: 55 additions & 0 deletions Runnect-iOS/Runnect-iOS/Global/Utils/Stopwatch.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//
// Stopwatch.swift
// Runnect-iOS
//
// Created by sejin on 2023/01/04.
//

import Combine
import Foundation

class Stopwatch {
private var startTime: Date?
private var accumulatedTime: TimeInterval = 0
private var timer: Cancellable?

@Published var isRunning = false {
didSet {
if self.isRunning {
self.start()
} else {
self.stop()
}
}
}

@Published private(set) var elapsedTime: TimeInterval = 0

private func start() {
self.startTime = Date()
self.timer?.cancel()
self.timer = Timer.publish(every: 1.0, on: .main, in: .common)
.autoconnect()
.sink { _ in
self.elapsedTime = self.getElapsedTime()
}
}

private func stop() {
self.timer?.cancel()
self.timer = nil
self.accumulatedTime = self.getElapsedTime()
self.startTime = nil
}

func reset() {
self.accumulatedTime = 0
self.elapsedTime = 0
self.startTime = nil
self.isRunning = false
}

private func getElapsedTime() -> TimeInterval {
return -(self.startTime?.timeIntervalSinceNow ?? 0)+self.accumulatedTime
}
}
Loading