Skip to content

Commit

Permalink
[Merge] #36 - pull develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoe0929 committed Jan 12, 2024
2 parents 09c4bf7 + ecda26e commit 0ac37f0
Show file tree
Hide file tree
Showing 91 changed files with 3,143 additions and 412 deletions.
290 changes: 267 additions & 23 deletions HMH_iOS/HMH_iOS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,42 @@
"version" : "2.20.0"
}
},
{
"identity" : "lottie-spm",
"kind" : "remoteSourceControl",
"location" : "https://github.com/airbnb/lottie-spm.git",
"state" : {
"revision" : "96790253c1a82223bd43da651121abfd7e96d0f3",
"version" : "4.3.4"
}
},
{
"identity" : "moya",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Moya/Moya",
"state" : {
"revision" : "c263811c1f3dbf002be9bd83107f7cdc38992b26",
"version" : "15.0.3"
}
},
{
"identity" : "reactiveswift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ReactiveCocoa/ReactiveSwift.git",
"state" : {
"revision" : "c43bae3dac73fdd3cb906bd5a1914686ca71ed3c",
"version" : "6.7.0"
}
},
{
"identity" : "rxswift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ReactiveX/RxSwift.git",
"state" : {
"revision" : "9dcaa4b333db437b0fbfaf453fad29069044a8b4",
"version" : "6.6.0"
}
},
{
"identity" : "snapkit",
"kind" : "remoteSourceControl",
Expand Down
67 changes: 60 additions & 7 deletions HMH_iOS/HMH_iOS/Application/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,72 @@
//

import UIKit
import AuthenticationServices

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

var window: UIWindow?


func sceneDidBecomeActive(_ scene: UIScene) {
let appleIDProvider = ASAuthorizationAppleIDProvider()
appleIDProvider.getCredentialState(forUserID: "000340.8d411a5d11d84e8da0c22ef43dce465a.1657" ?? "") { (credentialState, error) in
switch credentialState {
case .authorized:
print("authorized")
case .revoked:
print("revoked")
case .notFound:
print("notFound")
default:
break
}
}
}

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: windowScene)
window?.rootViewController = UINavigationController(rootViewController: TabBarController())
if let navigationController = window?.rootViewController as? UINavigationController {
navigationController.isNavigationBarHidden = true
guard let windowScene = (scene as? UIWindowScene) else { return }

let window = UIWindow(windowScene: windowScene)
self.window = window
let splashViewController = SplashViewController()
window.rootViewController = splashViewController
if let navigationController = window.rootViewController as? UINavigationController {
navigationController.isNavigationBarHidden = true
}
window.makeKeyAndVisible()

DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
DispatchQueue.main.async{
if UserManager.shared.hasAccessToken {
//애플 로그인 토큰 리프레쉬 로직. 성공한다면 엑세스와 리프레시 토큰 업데이트 그러면서 이동
// 토큰 리프레시가 실패 한다. 로그인 컨트롤러로 바로 이동.
showTabBarViewController()
} else {
showLoginViewController()
}
}
}

func showTabBarViewController() {
let tabBarViewController = TabBarController()
navigateTo(viewController: tabBarViewController)
}

func showLoginViewController() {
let loginViewController = LoginViewController()
navigateTo(viewController: loginViewController)
}

func navigateTo(viewController: UIViewController) {
DispatchQueue.main.async {
if let navigationController = self.window?.rootViewController as? UINavigationController {
navigationController.pushViewController(viewController, animated: true)
} else {
let navigationController = UINavigationController(rootViewController: viewController)
self.window?.rootViewController = navigationController
self.window?.makeKeyAndVisible()
}
}
window?.makeKeyAndVisible()
}
}
}
20 changes: 20 additions & 0 deletions HMH_iOS/HMH_iOS/Global/Extension/UILabel+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,24 @@ extension UILabel {
self.numberOfLines = 2
}
}

func setTextWithLineHeightLeft(text: String?, lineHeight: CGFloat) {
if let text = text {
let style = NSMutableParagraphStyle()
style.maximumLineHeight = lineHeight
style.minimumLineHeight = lineHeight

let attributes: [NSAttributedString.Key: Any] = [
.paragraphStyle: style,
.baselineOffset: (lineHeight - font.lineHeight) * 0.26
]

let attrString = NSAttributedString(string: text,
attributes: attributes)
self.attributedText = attrString
self.textAlignment = .left
self.numberOfLines = 2
}
}

}
20 changes: 20 additions & 0 deletions HMH_iOS/HMH_iOS/Global/Extension/UIViewController+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// UIViewController+.swift
// HMH_iOS
//
// Created by Seonwoo Kim on 1/13/24.
//

import UIKit

extension UIViewController {
func setRootViewController(_ viewController: UIViewController) {
let navigationController = UINavigationController(rootViewController: viewController)
let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate
guard let delegate = sceneDelegate else {
return
}
delegate.window?.rootViewController = navigationController
}
}

10 changes: 8 additions & 2 deletions HMH_iOS/HMH_iOS/Global/Literals/Literal/Image.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
enum ImageLiterals {
enum NavigationBar {
static var icArrowLeft: UIImage { .load(named: "ic_back")}
static var icPoint: UIImage { .load(named: "ios_point")}
static var icPoint: UIImage { .load(named: "ios_point_ic")}
}

enum TabBar {
Expand All @@ -22,8 +22,14 @@ enum ImageLiterals {
static var icMyPageSelected: UIImage { .load(named: "mypageEnabled") }
}

enum myPage {
static var icBadge: UIImage { .load(named: "ios_badge_ic_disabled")}
static var icJourney: UIImage { .load(named: "ios_journey_ic")}
static var icStore: UIImage { .load(named: "ios_store_ic")}
static var icArrowRight: UIImage { .load(named: "chevron_right")}
}

enum Challenge {
static var icPlus: UIImage { .load(named: "Minus_XL") }
}
}

49 changes: 48 additions & 1 deletion HMH_iOS/HMH_iOS/Global/Literals/String/String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ enum StringLiteral {
static var myPageTitle = "마이페이지"
}

enum Home {
static var blackHoleFirstStep = "\(UserModel.dummy().userName)님을 위한\n우주가 생성되었어요"
static var blackHoleSecondStep = "블랙홀이 다가와요\n도파민의 유혹을 이겨내요"
static var blackHoleThridStep = "블랙홀이 가까워졌어요\n스마트폰을 멀리해 볼까요?"
static var blackHoleFourthStep = "블랙홀에 빠질 수 있어요\n스마트폰을 내려놓아요"
static var blackHoleFifthStep = "지금부터 앱을 사용하면\n챌린지를 실패해요"
static var blackHoleFailure = "블랙홀에 빠졌어요\n내일은 목표를 이뤄보아요"

static var totalGoalUsingTime = "총 목표 이용 시간"
static var remainedTimeUnit = "남음"
}

enum Challenge {
static var NavigationBarTitle = "나의 챌린지"
enum Date {
Expand All @@ -22,7 +34,8 @@ enum StringLiteral {
}
enum AppList {
static var appListHeaderTitle = "앱 잠금"
static var appListHeaderButtonText = "삭제"
static var appListDeleteHeaderButtonText = "삭제"
static var appListCancelHeaderButtonText = "취소"
}

enum GoalTime {
Expand All @@ -37,6 +50,23 @@ enum StringLiteral {
static var appAddFooterViewID = "appAddFooter"
}
}

enum myPage {
static var point = "보유 포인트"
static var badge = "배지 컬랙션"

static var journey = "지금까지의 여정"
static var store = "상점"

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

static var info = "정보"

static var logout = "로그아웃"
static var quit = "회원탈퇴"
}

enum AlertButton {
static let confirm = "확인"
static let cancel = "취소"
Expand Down Expand Up @@ -64,10 +94,20 @@ enum StringLiteral {
enum OnboardigMain {
static let timeSurvey = "하루 평균 휴대폰을\n얼마나 사용하나요?"
static let problemSurvey = "휴대폰을 사용할 때\n어떤 문제를 겪고 있나요?"
static let selectPeriod = "챌린지 기간을 선택해 주세요"
static let selectTotalTime = "총 목표 이용 시간을\n설정해 주세요"
static let approvePermision = "스크린타임 권한 허용이 필요해요"
static let appSelect = "중독에서 탈출하고 싶은\n앱을 선택해 주세요"
static let signInComplete = "회원가입 완료"
}

enum OnboardigSub {
static let problemSurvey = "해당 문항은 최대 2개까지 선택할 수 있어요"
static let selectPeriod = "첫 챌린지로 가볍게 도전하기 좋은 7일을 추천해요"
static let selectTotalTime = "목표 이용 시간은 최대 6시간까지 설정할 수 있어요"
static let approvePermision = "언제든지 설정에서 스크린타임과 알림\n권한을 변경할 수 있어요"
static let appSelect = "목표 이용 시간이 지나면 앱이 잠겨요\n선택하고 싶은 앱은 언제든지 추가할 수 있어요"
static let signInComplete = "이제 하면함에서 블랙홀 탈출을 위한\n여정을 시작해 볼까요?"
}

enum TimeSurveySelect {
Expand All @@ -83,4 +123,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
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "first_default.svg",
"filename" : "chevron_right.svg",
"idiom" : "universal"
}
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "ios_badge_ic_disabled.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
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,7 +1,7 @@
{
"images" : [
{
"filename" : "second_active.svg",
"filename" : "ios_badge_ic_normal.svg",
"idiom" : "universal"
}
],
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,7 +1,7 @@
{
"images" : [
{
"filename" : "second_default.svg",
"filename" : "ios_journey_ic.svg",
"idiom" : "universal"
}
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "first_active.svg",
"filename" : "ios_point_ic.svg",
"idiom" : "universal"
}
],
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

0 comments on commit 0ac37f0

Please sign in to comment.