Skip to content

Commit

Permalink
Merge pull request #188 from thingineeer/#187---마이-페이지-수정-및-기능-구현
Browse files Browse the repository at this point in the history
[Feat] #187 - 마이 페이지 수정 및 기능 구현
  • Loading branch information
thingineeer authored Sep 23, 2023
2 parents 529943a + b191a05 commit 377fe95
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ final class RNAlertVC: UIViewController {
}

private lazy var yesButton = UIButton(type: .custom).then {
$0.setTitle("", for: .normal)
$0.setTitle("", for: .normal)
$0.titleLabel?.font = .h5
$0.setTitleColor(.w1, for: .normal)
$0.layer.backgroundColor = UIColor.m1.cgColor
Expand Down
69 changes: 45 additions & 24 deletions Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ final class MyPageVC: UIViewController {
private let secondDivideView = UIView()
private let thirdDivideView = UIView()
private let fourthDivideView = UIView()
private let fifthDivideView = UIView()
private let topVersionDivideView = UIView()
private let bottomVersionDivideView = UIView()

Expand Down Expand Up @@ -71,13 +72,13 @@ final class MyPageVC: UIViewController {

private let myRunnigProgressPercentLabel = UILabel()

private lazy var goalRewardInfoView = makeInfoView(title: "목표 보상").then {
let tap = UITapGestureRecognizer(target: self, action: #selector(self.touchUpGoalRewardInfoView))
private lazy var activityRecordInfoView = makeInfoView(title: "러닝 기록").then {
let tap = UITapGestureRecognizer(target: self, action: #selector(self.touchUpActivityRecordInfoView))
$0.addGestureRecognizer(tap)
}

private lazy var activityRecordInfoView = makeInfoView(title: "러닝 기록").then {
let tap = UITapGestureRecognizer(target: self, action: #selector(self.touchUpActivityRecordInfoView))
private lazy var goalRewardInfoView = makeInfoView(title: "목표 보상").then {
let tap = UITapGestureRecognizer(target: self, action: #selector(self.touchUpGoalRewardInfoView))
$0.addGestureRecognizer(tap)
}

Expand All @@ -91,6 +92,11 @@ final class MyPageVC: UIViewController {
$0.addGestureRecognizer(tap)
}

private lazy var kakaoChannelAsk = makeInfoView(title: "카카오톡 채널 문의").then {
let tap = UITapGestureRecognizer(target: self, action: #selector(self.touchUpkakaoChannelAsk))
$0.addGestureRecognizer(tap)
}

private let versionInfoLabel = UILabel().then {
$0.textColor = .g2
$0.font = .b2
Expand Down Expand Up @@ -222,13 +228,13 @@ extension MyPageVC {

extension MyPageVC {
@objc
private func touchUpGoalRewardInfoView() {
pushToGoalRewardInfoVC()
private func touchUpActivityRecordInfoView() {
pushToActivityRecordInfoVC()
}

@objc
private func touchUpActivityRecordInfoView() {
pushToActivityRecordInfoVC()
private func touchUpGoalRewardInfoView() {
pushToGoalRewardInfoVC()
}

@objc
Expand All @@ -245,6 +251,14 @@ extension MyPageVC {
private func touchUpSettingView() {
pushToSettingVC()
}

@objc
private func touchUpkakaoChannelAsk() {
if let url = URL(string: "https://pf.kakao.com/_hXduG") {
UIApplication.shared.open(url)
}
}

}

// MARK: - UI & Layout
Expand All @@ -266,6 +280,7 @@ extension MyPageVC {
secondDivideView.backgroundColor = .g4
thirdDivideView.backgroundColor = .g4
fourthDivideView.backgroundColor = .g4
fifthDivideView.backgroundColor = .g4
topVersionDivideView.backgroundColor = .g5
bottomVersionDivideView.backgroundColor = .g5
}
Expand All @@ -277,8 +292,8 @@ extension MyPageVC {
}

view.addSubviews(myProfileView, myRunningProgressView, firstDivideView,
goalRewardInfoView, secondDivideView, activityRecordInfoView,
thirdDivideView, uploadedCourseInfoView, fourthDivideView, settingView)
activityRecordInfoView, secondDivideView, goalRewardInfoView,
thirdDivideView, uploadedCourseInfoView, fourthDivideView, settingView, fifthDivideView, kakaoChannelAsk)

myProfileView.snp.makeConstraints { make in
make.top.equalTo(navibar.snp.bottom).offset(6)
Expand Down Expand Up @@ -350,26 +365,26 @@ extension MyPageVC {
}

private func setInfoButtonLayout() {
goalRewardInfoView.snp.makeConstraints { make in
activityRecordInfoView.snp.makeConstraints { make in
make.top.equalTo(firstDivideView.snp.bottom)
make.leading.trailing.equalToSuperview()
make.height.equalTo(60)
}

secondDivideView.snp.makeConstraints { make in
make.top.equalTo(goalRewardInfoView.snp.bottom).offset(1)
make.top.equalTo(activityRecordInfoView.snp.bottom).offset(1)
make.leading.trailing.equalToSuperview()
make.height.equalTo(0.5)
}

activityRecordInfoView.snp.makeConstraints { make in
goalRewardInfoView.snp.makeConstraints { make in
make.top.equalTo(secondDivideView.snp.bottom)
make.leading.trailing.equalToSuperview()
make.height.equalTo(60)
}

thirdDivideView.snp.makeConstraints { make in
make.top.equalTo(activityRecordInfoView.snp.bottom).offset(1)
make.top.equalTo(goalRewardInfoView.snp.bottom).offset(1)
make.leading.trailing.equalToSuperview()
make.height.equalTo(0.5)
}
Expand All @@ -380,12 +395,6 @@ extension MyPageVC {
make.height.equalTo(60)
}

activityRecordInfoView.snp.makeConstraints { make in
make.top.equalTo(secondDivideView.snp.bottom)
make.leading.trailing.equalToSuperview()
make.height.equalTo(60)
}

fourthDivideView.snp.makeConstraints { make in
make.top.equalTo(uploadedCourseInfoView.snp.bottom).offset(1)
make.leading.trailing.equalToSuperview()
Expand All @@ -395,22 +404,34 @@ extension MyPageVC {
settingView.snp.makeConstraints { make in
make.top.equalTo(fourthDivideView.snp.bottom)
make.leading.trailing.equalToSuperview()
make.height.equalTo(100)
make.height.equalTo(60)
}


fifthDivideView.snp.makeConstraints { make in
make.top.equalTo(settingView.snp.bottom).offset(1)
make.leading.trailing.equalToSuperview()
make.height.equalTo(0.5)
}

kakaoChannelAsk.snp.makeConstraints { make in
make.top.equalTo(fifthDivideView.snp.bottom)
make.leading.trailing.equalToSuperview()
make.height.equalTo(62)
}

}

private func setVersionInfoLayout() {
view.addSubviews(topVersionDivideView, versionInfoView, bottomVersionDivideView)

topVersionDivideView.snp.makeConstraints { make in
make.top.equalTo(settingView.snp.bottom)
make.top.equalTo(kakaoChannelAsk.snp.bottom)
make.leading.trailing.equalToSuperview()
make.height.equalTo(4)
}

versionInfoView.snp.makeConstraints { make in
make.top.equalTo(settingView.snp.bottom)
make.top.equalTo(kakaoChannelAsk.snp.bottom)
make.leading.trailing.equalToSuperview()
make.height.equalTo(62)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ final class SettingVC: UIViewController {
private let bottomNavibarDiviedView = UIView()
private let firstDiviedView = UIView()
private let secondDiviedView = UIView()
private let thirdDiviedView = UIView()

let reportUrl = NSURL(string: "https://docs.google.com/forms/d/e/1FAIpQLSek2rkClKfGaz1zwTEHX3Oojbq_pbF3ifPYMYezBU0_pe-_Tg/viewform")
lazy var reportSafariView: SFSafariViewController = SFSafariViewController(url: self.reportUrl! as URL)

let termsOfServiceUrl = NSURL(string: "https://third-sight-046.notion.site/Runnect-5dfee19ccff04c388590e5ee335e77ed")
lazy var termsOfServiceSafariView: SFSafariViewController = SFSafariViewController(url: self.termsOfServiceUrl! as URL)
Expand All @@ -33,11 +29,6 @@ final class SettingVC: UIViewController {
let tap = UITapGestureRecognizer(target: self, action: #selector(self.touchUpPersonalInfoView))
$0.addGestureRecognizer(tap)
}

private lazy var reportView = makeInfoView(title: "문의 및 신고하기").then {
let tap = UITapGestureRecognizer(target: self, action: #selector(self.touchUpReportView))
$0.addGestureRecognizer(tap)
}

private lazy var termsOfServiceView = makeInfoView(title: "이용약관").then {
let tap = UITapGestureRecognizer(target: self, action: #selector(self.touchUpTermsOfServiceView))
Expand Down Expand Up @@ -103,11 +94,6 @@ extension SettingVC {
pushToPersonalInfoVC()
}

@objc
private func touchUpReportView() {
self.present(self.reportSafariView, animated: true, completion: nil)
}

@objc
private func touchUpTermsOfServiceView() {
self.present(self.termsOfServiceSafariView, animated: true, completion: nil)
Expand All @@ -122,7 +108,6 @@ extension SettingVC {
bottomNavibarDiviedView.backgroundColor = .g5
firstDiviedView.backgroundColor = .g5
secondDiviedView.backgroundColor = .g5
thirdDiviedView.backgroundColor = .g5
}

private func setLayout() {
Expand All @@ -140,7 +125,6 @@ extension SettingVC {
}

setPersonalInfoViewLayout()
setReportViewLayout()
setTermsOfServiceViewLayout()
}

Expand All @@ -160,32 +144,16 @@ extension SettingVC {
}
}

private func setReportViewLayout() {
view.addSubviews(reportView, secondDiviedView)

reportView.snp.makeConstraints { make in
make.top.equalTo(firstDiviedView.snp.bottom)
make.leading.trailing.equalToSuperview()
make.height.equalTo(62)
}

secondDiviedView.snp.makeConstraints { make in
make.top.equalTo(reportView.snp.bottom).offset(1)
make.leading.trailing.equalToSuperview()
make.height.equalTo(0.5)
}
}

private func setTermsOfServiceViewLayout() {
view.addSubviews(termsOfServiceView, thirdDiviedView)
view.addSubviews(termsOfServiceView, secondDiviedView)

termsOfServiceView.snp.makeConstraints { make in
make.top.equalTo(secondDiviedView.snp.bottom)
make.top.equalTo(firstDiviedView.snp.bottom)
make.leading.trailing.equalToSuperview()
make.height.equalTo(62)
}

thirdDiviedView.snp.makeConstraints { make in
secondDiviedView.snp.makeConstraints { make in
make.top.equalTo(termsOfServiceView.snp.bottom).offset(1)
make.leading.trailing.equalToSuperview()
make.height.equalTo(0.5)
Expand Down

0 comments on commit 377fe95

Please sign in to comment.