-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
296 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
212 changes: 212 additions & 0 deletions
212
HealthFoodMe/HealthFoodMe/Presentation/Setting/VC/SettingVC.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,212 @@ | ||
// | ||
// SettingVC.swift | ||
// HealthFoodMe | ||
// | ||
// Created by 송지훈 on 2022/07/15. | ||
// | ||
|
||
import UIKit | ||
|
||
class SettingVC: UIViewController { | ||
|
||
// MARK: - Properties | ||
|
||
// MARK: - UI Components | ||
|
||
private var topTitleLabel: UILabel = { | ||
let label = UILabel() | ||
label.font = .NotoBold(size: 16) | ||
label.text = I18N.Auth.ChangeNickname.headerTitle | ||
label.textColor = UIColor.helfmeBlack | ||
return label | ||
}() | ||
|
||
private lazy var backButton: UIButton = { | ||
let button = UIButton() | ||
button.setBackgroundImage(ImageLiterals.MainDetail.beforeIcon, for: .normal) | ||
button.press { self.navigationController?.popViewController(animated: true) } | ||
return button | ||
}() | ||
|
||
private lazy var headerDividerView: UIView = { | ||
let dividerView = UIView() | ||
dividerView.backgroundColor = UIColor.helfmeLineGray | ||
return dividerView | ||
}() | ||
|
||
private lazy var customerServiceTitle: UILabel = { | ||
let label = UILabel() | ||
label.text = I18N.Setting.customerServiceTitle | ||
label.font = .NotoRegular(size: 14) | ||
label.textColor = UIColor.helfmeGray2 | ||
return label | ||
}() | ||
|
||
private lazy var askButton: UIButton = { | ||
let button = UIButton() | ||
button.setTitle(I18N.Setting.askButtonTitle, for: .normal) | ||
button.setTitleColor(UIColor.helfmeBlack, for: .normal) | ||
button.titleLabel?.font = .NotoRegular(size: 16) | ||
button.contentHorizontalAlignment = .left | ||
return button | ||
}() | ||
|
||
private lazy var withdrawalButton: UIButton = { | ||
let button = UIButton() | ||
button.setTitle(I18N.Setting.userWithdrawalTitle, for: .normal) | ||
button.setTitleColor(UIColor.helfmeBlack, for: .normal) | ||
button.titleLabel?.font = .NotoRegular(size: 16) | ||
button.contentHorizontalAlignment = .left | ||
return button | ||
}() | ||
|
||
private lazy var termsTitle: UILabel = { | ||
let label = UILabel() | ||
label.text = I18N.Setting.termsTitle | ||
label.font = .NotoRegular(size: 14) | ||
label.textColor = UIColor.helfmeGray2 | ||
return label | ||
}() | ||
|
||
private lazy var openSourceButton: UIButton = { | ||
let button = UIButton() | ||
button.setTitle(I18N.Setting.openSourceButtonTitle, for: .normal) | ||
button.setTitleColor(UIColor.helfmeBlack, for: .normal) | ||
button.titleLabel?.font = .NotoRegular(size: 16) | ||
button.contentHorizontalAlignment = .left | ||
return button | ||
}() | ||
|
||
private lazy var naverMapTermsButton: UIButton = { | ||
let button = UIButton() | ||
button.setTitle(I18N.Setting.naverMapTerms, for: .normal) | ||
button.setTitleColor(UIColor.helfmeBlack, for: .normal) | ||
button.titleLabel?.font = .NotoRegular(size: 16) | ||
button.contentHorizontalAlignment = .left | ||
return button | ||
}() | ||
|
||
private lazy var naverMapLicenseButton: UIButton = { | ||
let button = UIButton() | ||
button.setTitle(I18N.Setting.naverMapLicense, for: .normal) | ||
button.setTitleColor(UIColor.helfmeBlack, for: .normal) | ||
button.titleLabel?.font = .NotoRegular(size: 16) | ||
button.contentHorizontalAlignment = .left | ||
return button | ||
}() | ||
|
||
|
||
// MARK: - View Life Cycle | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
setUI() | ||
setLayout() | ||
addButtonAction() | ||
} | ||
} | ||
|
||
// MARK: - Methods | ||
|
||
extension SettingVC { | ||
private func setLayout() { | ||
view.addSubviews(topTitleLabel, backButton, headerDividerView, | ||
customerServiceTitle, askButton, withdrawalButton, | ||
termsTitle, openSourceButton, naverMapTermsButton, naverMapLicenseButton) | ||
|
||
topTitleLabel.snp.makeConstraints { make in | ||
make.top.equalTo(view.safeAreaLayoutGuide).offset(14) | ||
make.centerX.equalToSuperview() | ||
make.height.equalTo(20) | ||
} | ||
|
||
backButton.snp.makeConstraints { make in | ||
make.height.width.equalTo(24) | ||
make.top.equalTo(view.safeAreaLayoutGuide).offset(12) | ||
make.leading.equalToSuperview().offset(20) | ||
} | ||
|
||
headerDividerView.snp.makeConstraints { make in | ||
make.top.equalTo(topTitleLabel.snp.bottom).offset(13) | ||
make.leading.trailing.equalToSuperview() | ||
make.height.equalTo(1) | ||
} | ||
|
||
customerServiceTitle.snp.makeConstraints { make in | ||
make.top.equalTo(headerDividerView.snp.bottom).offset(32) | ||
make.leading.equalToSuperview().offset(20) | ||
make.height.equalTo(20) | ||
} | ||
|
||
askButton.snp.makeConstraints { make in | ||
make.top.equalTo(customerServiceTitle.snp.bottom).offset(24) | ||
make.leading.equalToSuperview().offset(20) | ||
make.trailing.equalToSuperview().offset(-20) | ||
make.height.equalTo(16) | ||
} | ||
|
||
withdrawalButton.snp.makeConstraints { make in | ||
make.top.equalTo(askButton.snp.bottom).offset(36) | ||
make.leading.equalToSuperview().offset(20) | ||
make.trailing.equalToSuperview().offset(-20) | ||
make.height.equalTo(16) | ||
} | ||
|
||
termsTitle.snp.makeConstraints { make in | ||
make.top.equalTo(withdrawalButton.snp.bottom).offset(54) | ||
make.leading.equalToSuperview().offset(20) | ||
make.height.equalTo(20) | ||
} | ||
|
||
openSourceButton.snp.makeConstraints { make in | ||
make.top.equalTo(termsTitle.snp.bottom).offset(24) | ||
make.leading.equalToSuperview().offset(20) | ||
make.trailing.equalToSuperview().offset(-20) | ||
make.height.equalTo(16) | ||
} | ||
|
||
naverMapTermsButton.snp.makeConstraints { make in | ||
make.top.equalTo(openSourceButton.snp.bottom).offset(36) | ||
make.leading.equalToSuperview().offset(20) | ||
make.trailing.equalToSuperview().offset(-20) | ||
make.height.equalTo(16) | ||
} | ||
|
||
naverMapLicenseButton.snp.makeConstraints { make in | ||
make.top.equalTo(naverMapTermsButton.snp.bottom).offset(36) | ||
make.leading.equalToSuperview().offset(20) | ||
make.trailing.equalToSuperview().offset(-20) | ||
make.height.equalTo(16) | ||
} | ||
} | ||
|
||
private func setUI() { | ||
self.navigationController?.navigationBar.isHidden = true | ||
} | ||
} | ||
|
||
// MARK: - Methods | ||
|
||
extension SettingVC { | ||
private func addButtonAction() { | ||
askButton.press(animated: false) { | ||
print("문의하기") | ||
} | ||
|
||
withdrawalButton.press(animated: false) { | ||
print("회원탈퇴") | ||
} | ||
|
||
openSourceButton.press(animated: false) { | ||
print("오픈 소스 정보") | ||
} | ||
|
||
naverMapTermsButton.press(animated: false) { | ||
print("네이버 지도 법적 공지") | ||
} | ||
|
||
naverMapLicenseButton.press(animated: false) { | ||
print("네이버 지도 라이선스") | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
HealthFoodMe/HealthFoodMe/Presentation/Setting/Views/Setting.storyboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> | ||
<device id="retina6_1" orientation="portrait" appearance="light"/> | ||
<dependencies> | ||
<deployment identifier="iOS"/> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<capability name="System colors in document resources" minToolsVersion="11.0"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<scenes> | ||
<!--SettingVC--> | ||
<scene sceneID="s0d-6b-0kx"> | ||
<objects> | ||
<viewController storyboardIdentifier="SettingVC" id="Y6W-OH-hqX" customClass="SettingVC" customModule="HealthFoodMe" customModuleProvider="target" sceneMemberID="viewController"> | ||
<view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc"> | ||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/> | ||
<color key="backgroundColor" systemColor="systemBackgroundColor"/> | ||
</view> | ||
</viewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="-16" y="85"/> | ||
</scene> | ||
</scenes> | ||
<resources> | ||
<systemColor name="systemBackgroundColor"> | ||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
</systemColor> | ||
</resources> | ||
</document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters