Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REFACTOR]라이온하트 디자인시스템 구축 및 적용(#133) #134

Merged
merged 39 commits into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
14a8162
♻️ 챌린지ViewController 코드정리
kimscastle Sep 23, 2023
25a02c1
🔥 wrapper에 필요없는 코드 삭제
kimscastle Sep 23, 2023
644251b
♻️ Challenge DI적용
kimscastle Sep 23, 2023
c00900c
♻️ Today DI적용
kimscastle Sep 24, 2023
17af3e1
♻️ 아티클상세뷰 DI적용
kimscastle Sep 24, 2023
f8d50de
♻️ 챌린지뷰 DI 적용
kimscastle Sep 24, 2023
1f6f6e5
♻️ 북마크뷰 DI 적용
kimscastle Sep 24, 2023
03134c7
♻️ 마이페이지뷰 DI 적용
kimscastle Sep 24, 2023
bbe1c0b
♻️ 스플래시뷰 DI 적용
kimscastle Sep 24, 2023
6a5220b
♻️ 로그인뷰 DI 적용
kimscastle Sep 24, 2023
30d3f8f
♻️ 아티클 카테고리뷰 DI 적용
kimscastle Sep 24, 2023
34eafb7
♻️ 온보딩뷰 DI 적용
kimscastle Sep 24, 2023
d9a90bb
♻️ 커리큘럼뷰 DI 적용
kimscastle Sep 24, 2023
1a8dfcc
🔥 사용하지 않는 폴더 제거
kimscastle Sep 24, 2023
df5adb9
♻️ 커리큘럼리스트뷰 DI 적용
kimscastle Sep 24, 2023
435ad95
🔥 기존 네트워크레이어 주석처리
kimscastle Sep 24, 2023
54b0497
♻️ 수정중
kimscastle Sep 24, 2023
0954a87
♻️ 앱전체 navigation DI적용
kimscastle Sep 24, 2023
2450b9c
♻️ global enum에 badge 추가
kimscastle Sep 24, 2023
c58dfc0
🔥 기존네트워크 레이어 삭제
kimscastle Sep 24, 2023
dd26163
♻️ LHLabel추가
kimscastle Sep 24, 2023
a6d54ec
♻️ UnderLine공용 컴포넌트 추가 및 적용
kimscastle Sep 24, 2023
aadf3b8
💄 LHLottie, LHImageView 추가
kimscastle Sep 24, 2023
931d936
💄 LHCollectionView 추가
kimscastle Sep 24, 2023
7ea6db2
♻️ 챌린지뷰 UI컴포넌트 적용 및 로직정리
kimscastle Sep 24, 2023
537403c
♻️ 챌린지뷰 옵셔널처리 및 로직 추가 수정
kimscastle Sep 24, 2023
31a07ce
♻️ 커리큘럼관련뷰 로직정리 및 수정
kimscastle Sep 24, 2023
58e99d4
💄 LHStackView 추가
kimscastle Sep 24, 2023
bb07b22
💄 LHImageButton추가
kimscastle Sep 25, 2023
40b442e
💄ToggleImageButton 추가
kimscastle Sep 25, 2023
f44b909
🔥 사용하지 않는 파일 삭제
kimscastle Sep 25, 2023
b6f8eaf
♻️ 커리큘럼관련뷰 디자인시스템 적용 및 코드 리팩터링
kimscastle Sep 25, 2023
c16982f
♻️ 마이페이지 디자인시스템적용
kimscastle Sep 25, 2023
b2f879d
🔥 사용하지 않는 파일 삭제
kimscastle Sep 25, 2023
55a847b
♻️ 아티클관련 디자인시스템적용
kimscastle Sep 25, 2023
5e3b01b
🔥 사용하지 않는 파일 삭제
kimscastle Sep 25, 2023
b5fd474
💄LHView 추가
kimscastle Sep 25, 2023
76878c4
♻️ cell요소들에 디자인시스템적용(찬미 민재뷰 제외)
kimscastle Sep 25, 2023
348c9f9
♻️ LHLottie contentMode default값 변경
kimscastle Sep 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
274 changes: 135 additions & 139 deletions LionHeart-iOS/LionHeart-iOS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion LionHeart-iOS/LionHeart-iOS/Application/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
self.window = UIWindow(windowScene: windowScene)
/// 폰트등록
Font.registerFonts()
let navigationController = UINavigationController(rootViewController: SplashViewController(authService: AuthMyPageServiceWrapper(authAPIService: AuthAPI(apiService: APIService()), mypageAPIService: MyPageAPI(apiService: APIService()))))
let splashViewController = SplashViewController(manager: SplashManagerImpl(authService: AuthServiceImpl(apiService: APIService())))
let navigationController = UINavigationController(rootViewController: splashViewController)
self.window?.rootViewController = navigationController
self.window?.makeKeyAndVisible()
}
Expand Down
46 changes: 46 additions & 0 deletions LionHeart-iOS/LionHeart-iOS/Global/Enums/Badge.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//
// Badge.swift
// LionHeart-iOS
//
// Created by uiskim on 2023/09/24.
//

import UIKit

enum BadgeLevel: String {
case level01 = "LEVEL_ONE"
case level02 = "LEVEL_TWO"
case level03 = "LEVEL_THREE"
case level04 = "LEVEL_FOUR"
case level05 = "LEVEL_FIVE"

var badgeLevel: Int {
switch self {
case .level01: return 1
case .level02: return 2
case .level03: return 3
case .level04: return 4
case .level05: return 5
}
}

var badgeImage: UIImage {
switch self {
case .level01: return ImageLiterals.ChallengeBadge.level01
case .level02: return ImageLiterals.ChallengeBadge.level02
case .level03: return ImageLiterals.ChallengeBadge.level03
case .level04: return ImageLiterals.ChallengeBadge.level04
case .level05: return ImageLiterals.ChallengeBadge.level05
}
}

var progreddbarLottie: String {
switch self {
case .level01: return "Level1"
case .level02: return "Level2"
case .level03: return "Level3"
case .level04: return "Level4"
case .level05: return "Level5"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ extension UIViewController {

extension UIViewController {
func presentArticleDetailFullScreen(articleID: Int) {
let articleDetailViewController = ArticleDetailViewController(serviceProtocol: BookmarkService(bookmarkAPIProtocol: BookmarkAPI(apiService: APIService())))
let articleDetailViewController = ArticleDetailViewController(manager: ArticleDetailManagerImpl(articleService: ArticleServiceImpl(apiService: APIService()), bookmarkService: BookmarkServiceImpl(apiService: APIService())))
articleDetailViewController.setArticleId(id: articleID)
articleDetailViewController.isModalInPresentation = true
articleDetailViewController.modalPresentationStyle = .fullScreen
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.000",
"blue" : "0.000",
"green" : "0.000",
"red" : "0.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// LHCollectionView.swift
// LionHeart-iOS
//
// Created by uiskim on 2023/09/24.
//

import UIKit

final class LHCollectionView: UICollectionView {

init(color: Palette? = .background, scroll: Bool = true) {
super.init(frame: .zero, collectionViewLayout: UICollectionViewFlowLayout())
self.backgroundColor = .designSystem(color!)
self.showsVerticalScrollIndicator = false
self.showsHorizontalScrollIndicator = false
self.isScrollEnabled = scroll
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// LHImageButton.swift
// LionHeart-iOS
//
// Created by uiskim on 2023/09/25.
//

import UIKit

final class LHImageButton: UIButton {
init(setImage: UIImage?) {
super.init(frame: .zero)
self.setImage(setImage, for: .normal)
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
32 changes: 32 additions & 0 deletions LionHeart-iOS/LionHeart-iOS/Global/UIComponents/LHImageView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// LHImageView.swift
// LionHeart-iOS
//
// Created by uiskim on 2023/09/24.
//

import UIKit

final class LHImageView: UIImageView {

init(in image: UIImage? = nil, contentMode: UIView.ContentMode) {
super.init(frame: .zero)
self.image = image
self.contentMode = contentMode
}

func makeRound(_ ratio: CGFloat) -> Self {
self.clipsToBounds = true
self.layer.cornerRadius = ratio
return self
}

func opacity(_ ratio: Float) -> Self {
self.layer.opacity = ratio
return self
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
30 changes: 30 additions & 0 deletions LionHeart-iOS/LionHeart-iOS/Global/UIComponents/LHLabel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// LHLabel.swift
// LionHeart-iOS
//
// Created by uiskim on 2023/09/24.
//

import UIKit

final class LHLabel: UILabel {

init(type: Font.PretendardType,
color: Palette,
backgroundColor: Palette? = nil,
alignment: NSTextAlignment = .left,
lines: Int = 1,
basicText: String? = nil) {
super.init(frame: .zero)
self.font = .pretendard(type)
self.textColor = .designSystem(color)
self.textAlignment = alignment
self.text = basicText
self.backgroundColor = .designSystem(.background)
self.numberOfLines = lines
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
20 changes: 20 additions & 0 deletions LionHeart-iOS/LionHeart-iOS/Global/UIComponents/LHLottie.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// LHLottie.swift
// LionHeart-iOS
//
// Created by uiskim on 2023/09/24.
//

import Foundation
import Lottie

final class LHLottie: LottieAnimationView {
init() {
super.init(frame: .zero)
self.contentMode = .scaleAspectFill
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,8 @@ import UIKit
final class LHNavigationBarView: UIView {

// MARK: - UI Components

private let titleLabel: UILabel = {
let label = UILabel()
label.font = .pretendard(.head4)
label.textColor = .designSystem(.white)
return label
}()
private let titleLabel = LHLabel(type: .head4, color: .white)


private let leftBarItem: UIButton = {
let button = UIButton()
Expand All @@ -40,12 +35,8 @@ final class LHNavigationBarView: UIView {
button.marginImageWithText(margin: 14)
return button
}()

private let graySepartorLine: UIView = {
let view = UIView()
view.backgroundColor = .designSystem(.gray800)
return view
}()

private let graySepartorLine = LHUnderLine(lineColor: .gray800)

private lazy var rightBarItemsStackView: UIStackView = {
let stackView = UIStackView(arrangedSubviews: [
Expand Down
22 changes: 22 additions & 0 deletions LionHeart-iOS/LionHeart-iOS/Global/UIComponents/LHStackView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// LHStackView.swift
// LionHeart-iOS
//
// Created by uiskim on 2023/09/25.
//

import UIKit

final class LHStackView: UIStackView {

init(axis: NSLayoutConstraint.Axis, spacing: CGFloat, distribution: UIStackView.Distribution = .fill) {
super.init(frame: .zero)
self.axis = axis
self.spacing = spacing
self.distribution = distribution
}

required init(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// LHToggleImageButton.swift
// LionHeart-iOS
//
// Created by uiskim on 2023/09/25.
//

import UIKit

final class LHToggleImageButton: UIButton {
init(normal normalImage: UIImage?, select selectImage: UIImage?) {
super.init(frame: .zero)
self.setImage(normalImage, for: .normal)
self.setImage(selectImage, for: .selected)
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
//
// NHUnderLine.swift
// LHUnderLine.swift
// LionHeart-iOS
//
// Created by uiskim on 2023/07/13.
//

import UIKit

final class NHUnderLine: UIView {
final class LHUnderLine: UIView {

private let lineColor: UIColor?

init(lineColor: UIColor?) {
self.lineColor = lineColor
init(lineColor: Palette) {
super.init(frame: .zero)
self.backgroundColor = self.lineColor
self.backgroundColor = .designSystem(lineColor)
}

@available(*, unavailable)
Expand Down
36 changes: 36 additions & 0 deletions LionHeart-iOS/LionHeart-iOS/Global/UIComponents/LHView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// LHView.swift
// LionHeart-iOS
//
// Created by uiskim on 2023/09/25.
//

import UIKit

final class LHView: UIView {
init(color: UIColor?) {
super.init(frame: .zero)
self.backgroundColor = color
}

func makeRound(_ ratio: CGFloat) -> Self {
self.clipsToBounds = true
self.layer.cornerRadius = ratio
return self
}

func opacity(_ ratio: Float) -> Self {
self.layer.opacity = ratio
return self
}

func maskedCorners(corners: CACornerMask) -> Self {
self.layer.maskedCorners = corners
return self
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}

3 changes: 2 additions & 1 deletion LionHeart-iOS/LionHeart-iOS/Global/Utils/Palette.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ enum Palette: String {
case gray1000 = "Gray1000"
case lionRed = "LionRed"
case componentLionRed = "ComponentLionRed"
case background = "Background"
case background = "background"
case kakao = "KakaoYellow"
case clear = "clear"
}
3 changes: 2 additions & 1 deletion LionHeart-iOS/LionHeart-iOS/Network/Base/APIService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ final class APIService: Requestable {
throw NetworkError.serverError
}

print("✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅APIService성공✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅")
print("✨✨✨✨✨✨✨✨✨✨✨✨✨API호출성공✨✨✨✨✨✨✨✨✨✨✨✨✨")
print(decodedData)
return decodedData.data
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ struct ChallengeDataResponse: DTO, Response {
let level: String
let attendances: [String]
}

extension ChallengeDataResponse {
func toAppData() -> ChallengeData {
return .init(babyDaddyName: self.babyNickname, howLongDay: self.day, daddyLevel: self.level, daddyAttendances: self.attendances)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ struct TodayArticleResponse: DTO, Response {
let day: Int
let articleId: Int
}

extension TodayArticleResponse {
func toAppData() -> TodayArticle {
return .init(fetalNickname: self.babyNickname, articleTitle: self.title, articleDescription: self.editorNoteContent, currentWeek: self.week, currentDay: self.day, mainImageURL: self.mainImageUrl, aticleID: self.articleId)
}
}
Loading