Skip to content

Commit

Permalink
Merge pull request #107 from Team-HMH/fix/#104-Challenge
Browse files Browse the repository at this point in the history
Fix [#104] Challenge뷰 UI 수정
  • Loading branch information
kim-seonwoo authored Jan 17, 2024
2 parents d0c11eb + 4076f58 commit 293276f
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 21 deletions.
1 change: 1 addition & 0 deletions HMH_iOS/HMH_iOS/Global/Literals/Literal/Image.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ enum ImageLiterals {
static var icAddNewChallengeBackground: UIImage { .load(named: "ios_add_new_challenge_img") }
static var icSevenDaysChallengeBackground: UIImage { .load(named: "ios_sevenDays_challenge_img") }
static var icFourteenDaysChallengeBackground: UIImage { .load(named: "img_ios_14") }
static var icUnselected: UIImage { .load(named: "img_ios_unselected") }
}

enum Alert {
Expand Down
17 changes: 9 additions & 8 deletions HMH_iOS/HMH_iOS/Global/Literals/String/String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ enum StringLiteral {
}

enum Challenge {
static var NavigationBarTitle = "나의 챌린지"
static var NavigationBarTitle = "챌린지"
enum Date {
static var dateHeaderTitle = "3시간"
static var createHeaderTitle = "새로운 여정을 위한\n챌린지를 생성해 주세요"
static var dateHeaderSubTitle = "목표 이용시간"
static var dateHeaderSubTitle = "목표 사용 시간"
static var challengeButton = "챌린지 생성하기"
}
enum AppList {
Expand Down Expand Up @@ -66,7 +66,7 @@ enum StringLiteral {
static var store = "상점"

static var TOS = "이용약관"
static var privacyPolicy = "개인정보처리방침"
static var privacyPolicy = "개인정보 처리방침"

static var info = "정보"

Expand All @@ -79,20 +79,21 @@ enum StringLiteral {

enum AlertButton {
static let confirm = "확인"
static let quit = "탈퇴"
static let cancel = "취소"
static let close = "닫기"
}

enum AlertTitle {
static let logout = "HMH을 로그아웃 하실 건가요?"
static let quit = "HMH을 탈퇴 하실 건가요?"
static let push = "을(를)\n계속 사용하시겠어요?"
static let logout = "하면함을 로그아웃 하시겠어요?"
static let quit = "정말 하면함을 탈퇴 하시겠어요?"
static let push = "을(를)\n삭제하시겠어요?"
static let challenge = "새로운 챌린지 생성 완료"
}

enum AlertDescription {
static let quit = "회원탈퇴 후 유저의 정보는 30일 동안 임시보관 후 영구 삭제됩니다."
static let push = "사용 시간을 연장하면\n챌린지를 실패해요"
static let quit = "회원탈퇴 후 유저 정보는 30일 동안\n임시보관되며, 이후 영구 삭제됩니다"
static let push = "집계되고 있던 앱의 사용 시간은\n총 사용 시간에서도 차감돼요"
static let challenge = "블랙홀 탈출을 위한\n새로운 여정을 시작해 보아요"
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "img_iOS_unselected.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"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 @@ -20,7 +20,7 @@ class DateCollectionViewCell: UICollectionViewCell {
}

private let imageView = UIImageView().then {
$0.backgroundColor = .background
$0.image = ImageLiterals.Challenge.icUnselected
$0.makeCornerRound(radius: 8.adjusted)
}

Expand All @@ -38,7 +38,7 @@ class DateCollectionViewCell: UICollectionViewCell {
}

private func setHierarchy() {
contentView.addSubviews(dateLabel, imageView)
contentView.addSubviews(imageView, dateLabel)
}

private func setConstraints() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class GrayBackgroundView: UICollectionReusableView {
var backgroundType: BackgroundImage?

private lazy var backgroundImageView = UIImageView().then {
backgroundType = .sevenDays
backgroundType = .completed
switch backgroundType {
case .sevenDays:
$0.image = ImageLiterals.Challenge.icSevenDaysChallengeBackground
Expand Down Expand Up @@ -56,7 +56,7 @@ final class GrayBackgroundView: UICollectionReusableView {
grayBackgroundView.snp.makeConstraints {
$0.leading.trailing.equalToSuperview()
$0.bottom.equalToSuperview().inset(12)
$0.top.equalToSuperview().offset(-200)
$0.top.equalToSuperview()
}

backgroundImageView.snp.makeConstraints {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ final class TitleCollectionReusableView: UICollectionReusableView {
}
} else {
titleLabel.snp.makeConstraints {
$0.top.equalToSuperview().offset(30.adjusted)
$0.leading.equalToSuperview().offset(29.adjustedWidth)
$0.bottom.equalToSuperview().inset(26.adjusted)
}

subTitleLabel.snp.makeConstraints {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ final class ChallengeViewController: UIViewController {
}

challengeView.snp.makeConstraints {
$0.top.equalTo(navigationBar.snp.bottom)
$0.top.equalTo(navigationBar.snp.bottom)
$0.leading.trailing.bottom.equalToSuperview()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class ChallengeView: UIView {

private var appAddButtonViewModel: BlockingApplicationModel = BlockingApplicationModel.shared
private var cancellables: Set<AnyCancellable> = []
var isChallengeComplete: Bool = false
var isChallengeComplete: Bool = true

private let goalTime: Int = 3
private var days: Int = 7
Expand Down Expand Up @@ -122,7 +122,7 @@ extension ChallengeView: UICollectionViewDataSource {
as? DateCollectionViewCell else {
return UICollectionViewCell()
}
cell.configureCell(date: "\(1 + indexPath.item)")
cell.configureCell(date: "\(1 + indexPath.item)", image: ImageLiterals.Challenge.icUnselected)
return cell
case 1:
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: AppListCollectionViewCell.identifer, for: indexPath)
Expand Down Expand Up @@ -204,7 +204,7 @@ extension ChallengeView {
section.interGroupSpacing = 19
section.contentInsets = .init(top: 0, leading: 0, bottom: 35, trailing:0)

let headerHeight = isChallengeComplete ? 275.adjustedHeight : 145.adjustedHeight
let headerHeight = isChallengeComplete ? 263.adjustedHeight: 100.adjustedHeight

let headerSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .estimated(CGFloat(headerHeight)))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class HMHQuitAlert: UIView {
$0.spacing = 7
}

private let cancelButton = CustomAlertButton(buttonType: .disabled, buttonText: StringLiteral.AlertButton.close)
private let cancelButton = CustomAlertButton(buttonType: .disabled, buttonText: StringLiteral.AlertButton.quit)
private let confirmButton = CustomAlertButton(buttonType: .enabled, buttonText: StringLiteral.AlertButton.confirm)

override init(frame: CGRect) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ final class TabBarController: UITabBarController {
super.viewDidLoad()
setUI()
setTabBar()
self.selectedIndex = selectedIndexNumber
}

override func viewDidLayoutSubviews() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ extension SelectPeriodController: NextViewPushDelegate {
let nextViewController = SelectTotalTimeController()
let periodAmount: Int = convertAndRemoveLastCharacter(selectPeriod) ?? 0
self.navigationController?.pushViewController(nextViewController, animated: false)
SignUpManager.shared.period = convertHoursAndMinutesToMilliseconds(hours: periodAmount, minutes: 0)
print(SignUpManager.shared.period)
SignUpManager.shared.period = periodAmount
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ extension OnboardingGoalTimeViewController: NextViewPushDelegate {
UserManager.shared.updateToken(data.token.accessToken, data.token.refreshToken)
UserManager.shared.updateUserId(data.userId)
} else {
self.view.showToast(message: "Oops, 저희와 함께 우주로 가실 수 없습니다.", at: 100)
self.setRootViewController(LoginViewController())
}
}
}
Expand Down

0 comments on commit 293276f

Please sign in to comment.