Skip to content

Commit

Permalink
[Add/#42] CreateChallenge - 챌린지 생성 뷰컨트롤러 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-seonwoo committed Jan 10, 2024
1 parent 1eefece commit aa2551e
Show file tree
Hide file tree
Showing 7 changed files with 253 additions and 1 deletion.
24 changes: 24 additions & 0 deletions HMH_iOS/HMH_iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
objects = {

/* Begin PBXBuildFile section */
0B000CE92B4D9D6E00AEC582 /* SelectPeriodController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B000CE82B4D9D6E00AEC582 /* SelectPeriodController.swift */; };
0B000CEB2B4D9D9100AEC582 /* SelectTotalTimeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B000CEA2B4D9D9100AEC582 /* SelectTotalTimeController.swift */; };
0B000CED2B4D9DA800AEC582 /* ApprovePermisionController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B000CEC2B4D9DA800AEC582 /* ApprovePermisionController.swift */; };
0B000CEF2B4D9DBF00AEC582 /* AppChoiceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B000CEE2B4D9DBF00AEC582 /* AppChoiceController.swift */; };
0B0035402B43D64D00DA140C /* HMHNavigationBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B00353F2B43D64D00DA140C /* HMHNavigationBar.swift */; };
0B2C2D3B2B443BE90023CCFA /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B2C2D3A2B443BE90023CCFA /* Image.swift */; };
0B2C2D412B4572240023CCFA /* HMHSelectButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B2C2D402B4572240023CCFA /* HMHSelectButton.swift */; };
Expand Down Expand Up @@ -153,6 +157,10 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
0B000CE82B4D9D6E00AEC582 /* SelectPeriodController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectPeriodController.swift; sourceTree = "<group>"; };
0B000CEA2B4D9D9100AEC582 /* SelectTotalTimeController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectTotalTimeController.swift; sourceTree = "<group>"; };
0B000CEC2B4D9DA800AEC582 /* ApprovePermisionController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApprovePermisionController.swift; sourceTree = "<group>"; };
0B000CEE2B4D9DBF00AEC582 /* AppChoiceController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppChoiceController.swift; sourceTree = "<group>"; };
0B00353F2B43D64D00DA140C /* HMHNavigationBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HMHNavigationBar.swift; sourceTree = "<group>"; };
0B2C2D3A2B443BE90023CCFA /* Image.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Image.swift; sourceTree = "<group>"; };
0B2C2D402B4572240023CCFA /* HMHSelectButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HMHSelectButton.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -289,6 +297,17 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
0B000CE72B4D9D4E00AEC582 /* ViewControllers */ = {
isa = PBXGroup;
children = (
0B000CE82B4D9D6E00AEC582 /* SelectPeriodController.swift */,
0B000CEA2B4D9D9100AEC582 /* SelectTotalTimeController.swift */,
0B000CEC2B4D9DA800AEC582 /* ApprovePermisionController.swift */,
0B000CEE2B4D9DBF00AEC582 /* AppChoiceController.swift */,
);
path = ViewControllers;
sourceTree = "<group>";
};
0B2C2D3C2B4559AE0023CCFA /* Onboarding */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -796,6 +815,7 @@
3666C8842B47110800564874 /* CreateChallenge */ = {
isa = PBXGroup;
children = (
0B000CE72B4D9D4E00AEC582 /* ViewControllers */,
3666C8852B47110800564874 /* Views */,
);
path = CreateChallenge;
Expand Down Expand Up @@ -985,6 +1005,7 @@
36E05FE42B487911005B633E /* GrayBackgroundView.swift in Sources */,
0B50F9CF2B369813000C5046 /* HomeViewController.swift in Sources */,
0B2C2D412B4572240023CCFA /* HMHSelectButton.swift in Sources */,
0B000CEF2B4D9DBF00AEC582 /* AppChoiceController.swift in Sources */,
0B8A89BC2B369F2D00688BA6 /* UIView+.swift in Sources */,
0B8A89AF2B369E4300688BA6 /* HomeModel.swift in Sources */,
3666C89F2B485C8F00564874 /* DateCollectionViewCell.swift in Sources */,
Expand All @@ -1003,9 +1024,12 @@
0B7817522B4BE0280078E925 /* ProgressBarManager.swift in Sources */,
0B8A89C42B369FA000688BA6 /* F.swift in Sources */,
3666C8892B47110800564874 /* TotalTimePickerView.swift in Sources */,
0B000CE92B4D9D6E00AEC582 /* SelectPeriodController.swift in Sources */,
174AF49A2B447CFB00450D07 /* ChanllengeViews.swift in Sources */,
0B000CEB2B4D9D9100AEC582 /* SelectTotalTimeController.swift in Sources */,
17314F872B49853C0089A551 /* HMHQuitAlert.swift in Sources */,
0BA193B62B4D08B7007E3F9C /* ProblemSurveyViewController.swift in Sources */,
0B000CED2B4D9DA800AEC582 /* ApprovePermisionController.swift in Sources */,
0B8A89B72B369F1100688BA6 /* C.swift in Sources */,
0B2C2D3B2B443BE90023CCFA /* Image.swift in Sources */,
17314F852B497FDE0089A551 /* HMHLogoutAlert.swift in Sources */,
Expand Down
9 changes: 9 additions & 0 deletions HMH_iOS/HMH_iOS/Global/Literals/String/String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ enum StringLiteral {
enum OnboardigMain {
static let timeSurvey = "하루 평균 휴대폰을\n얼마나 사용하나요?"
static let problemSurvey = "휴대폰을 사용할 때\n어떤 문제를 겪고 있나요?"
static let selectPeriod = "챌린지 기간을 선택해 주세요"
}

enum OnboardigSub {
static let problemSurvey = "해당 문항은 최대 2개까지 선택할 수 있어요"
static let selectPeriod = "첫 챌린지로 가볍게 도전하기 좋은 7일을 추천해요"
}

enum TimeSurveySelect {
Expand All @@ -94,4 +96,11 @@ enum StringLiteral {
static let thirdSelect = "특정 앱에 수시로 접속하게 돼요"
static let fourthSelect = "중독을 탈출하려고 노력해도 잘 안 돼요"
}

enum PeriodSelect {
static let firstSelect = "7일"
static let secondSelect = "14일"
static let thirdSelect = "20일"
static let fourthSelect = "30일"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// AppChoiceController.swift
// HMH_iOS
//
// Created by Seonwoo Kim on 1/10/24.
//

import Foundation
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
//
// ApprovePermisionController.swift
// HMH_iOS
//
// Created by Seonwoo Kim on 1/10/24.
//

import UIKit

import SnapKit
import Then

final class ApprovePermisionController: OnboardingBaseViewController {
private let surveyView = SurveyView(buttonType: .solitary)

override func viewDidLoad() {
super.viewDidLoad()
setUI()
configureSurveyView()
setDelegate()
setTimeSurvey()
}

override func viewDidAppear(_ animated: Bool) {
setUI()
}

private func setUI(){
setHierarchy()
setConstraints()
}

private func setHierarchy() {
view.addSubview(surveyView)
}

private func setConstraints() {
surveyView.snp.makeConstraints {
$0.top.equalTo(mainTitleLabel.snp.bottom).offset(94.adjustedHeight)
$0.leading.trailing.equalTo(progressBar)
}
}

private func setDelegate() {
self.delegate = self
}

private func setTimeSurvey() {
view.backgroundColor = .background
step = 5
}

private func configureSurveyView() {
nextButtonText = StringLiteral.OnboardingButton.next
nextButton.setButtonText(buttonTitle: nextButtonText)
mainTitleText = StringLiteral.OnboardigMain.selectPeriod
subTitleText = StringLiteral.OnboardigSub.selectPeriod
surveyView.firstButton.setButtonText(buttonTitle: StringLiteral.PeriodSelect.firstSelect)
surveyView.secondButton.setButtonText(buttonTitle: StringLiteral.PeriodSelect.secondSelect)
surveyView.thirdButton.setButtonText(buttonTitle: StringLiteral.PeriodSelect.thirdSelect)
surveyView.fourthButton.setButtonText(buttonTitle: StringLiteral.PeriodSelect.fourthSelect)
}
}

extension ApprovePermisionController: NextViewPushDelegate {
func didTapButton() {
let nextViewController = SelectTotalTimeController()
self.navigationController?.pushViewController(nextViewController, animated: false)
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
//
// SelectPeriodController.swift
// HMH_iOS
//
// Created by Seonwoo Kim on 1/10/24.
//

import UIKit

import SnapKit
import Then

final class SelectPeriodController: OnboardingBaseViewController {
private let surveyView = SurveyView(buttonType: .solitary)

override func viewDidLoad() {
super.viewDidLoad()
setUI()
configureSurveyView()
setDelegate()
setTimeSurvey()
}

override func viewDidAppear(_ animated: Bool) {
setUI()
}

private func setUI(){
setHierarchy()
setConstraints()
}

private func setHierarchy() {
view.addSubview(surveyView)
}

private func setConstraints() {
surveyView.snp.makeConstraints {
$0.top.equalTo(mainTitleLabel.snp.bottom).offset(94.adjustedHeight)
$0.leading.trailing.equalTo(progressBar)
}
}

private func setDelegate() {
self.delegate = self
}

private func setTimeSurvey() {
view.backgroundColor = .background
step = 3
}

private func configureSurveyView() {
nextButtonText = StringLiteral.OnboardingButton.next
nextButton.setButtonText(buttonTitle: nextButtonText)
mainTitleText = StringLiteral.OnboardigMain.selectPeriod
subTitleText = StringLiteral.OnboardigSub.selectPeriod
surveyView.firstButton.setButtonText(buttonTitle: StringLiteral.PeriodSelect.firstSelect)
surveyView.secondButton.setButtonText(buttonTitle: StringLiteral.PeriodSelect.secondSelect)
surveyView.thirdButton.setButtonText(buttonTitle: StringLiteral.PeriodSelect.thirdSelect)
surveyView.fourthButton.setButtonText(buttonTitle: StringLiteral.PeriodSelect.fourthSelect)
}
}

extension SelectPeriodController: NextViewPushDelegate {
func didTapButton() {
let nextViewController = SelectTotalTimeController()
self.navigationController?.pushViewController(nextViewController, animated: false)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
//
// SelectTotalTimeController.swift
// HMH_iOS
//
// Created by Seonwoo Kim on 1/10/24.
//

import UIKit

import SnapKit
import Then

final class SelectTotalTimeController: OnboardingBaseViewController {
private let surveyView = SurveyView(buttonType: .solitary)

override func viewDidLoad() {
super.viewDidLoad()
setUI()
configureSurveyView()
setDelegate()
setTimeSurvey()
}

override func viewDidAppear(_ animated: Bool) {
setUI()
}

private func setUI(){
setHierarchy()
setConstraints()
}

private func setHierarchy() {
view.addSubview(surveyView)
}

private func setConstraints() {
surveyView.snp.makeConstraints {
$0.top.equalTo(mainTitleLabel.snp.bottom).offset(94.adjustedHeight)
$0.leading.trailing.equalTo(progressBar)
}
}

private func setDelegate() {
self.delegate = self
}

private func setTimeSurvey() {
view.backgroundColor = .background
step = 4
}

private func configureSurveyView() {
nextButtonText = StringLiteral.OnboardingButton.next
nextButton.setButtonText(buttonTitle: nextButtonText)
mainTitleText = StringLiteral.OnboardigMain.selectPeriod
subTitleText = StringLiteral.OnboardigSub.selectPeriod
surveyView.firstButton.setButtonText(buttonTitle: StringLiteral.PeriodSelect.firstSelect)
surveyView.secondButton.setButtonText(buttonTitle: StringLiteral.PeriodSelect.secondSelect)
surveyView.thirdButton.setButtonText(buttonTitle: StringLiteral.PeriodSelect.thirdSelect)
surveyView.fourthButton.setButtonText(buttonTitle: StringLiteral.PeriodSelect.fourthSelect)
}
}

extension SelectTotalTimeController: NextViewPushDelegate {
func didTapButton() {
let nextViewController = ApprovePermisionController()
self.navigationController?.pushViewController(nextViewController, animated: false)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ final class ProblemSurveyViewController: OnboardingBaseViewController {

extension ProblemSurveyViewController: NextViewPushDelegate {
func didTapButton() {
let nextViewController = TimeSurveyViewController()
let nextViewController = SelectPeriodController()
self.navigationController?.pushViewController(nextViewController, animated: false)
}
}
Expand Down

0 comments on commit aa2551e

Please sign in to comment.