Skip to content

Commit 578a1a8

Browse files
authored
Merge pull request #24 from YAPP-Github/design/#18-Home
Design/#18 home
2 parents b541997 + 7612920 commit 578a1a8

126 files changed

Lines changed: 4936 additions & 1514 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Plugins/DependencyPlugin/ProjectDescriptionHelpers/Dependency+Project.swift

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ import ProjectDescription
99

1010
public extension TargetDependency {
1111
struct Features {
12+
public struct Main {}
1213
public struct Home {}
1314
public struct TabBar {}
1415
public struct Follow {}
1516
public struct Travel {}
17+
public struct Search {}
18+
public struct Setting {}
19+
public struct PopularTravel {}
1620
}
1721

1822
struct Modules {}
@@ -63,3 +67,27 @@ public extension TargetDependency.Features.Travel {
6367

6468
static let feature = TargetDependency.Features.project(name: "Feature", group: group)
6569
}
70+
71+
public extension TargetDependency.Features.Search {
72+
static let group = "Search"
73+
74+
static let feature = TargetDependency.Features.project(name: "Feature", group: group)
75+
}
76+
77+
public extension TargetDependency.Features.Setting {
78+
static let group = "Setting"
79+
80+
static let feature = TargetDependency.Features.project(name: "Feature", group: group)
81+
}
82+
83+
public extension TargetDependency.Features.Main {
84+
static let group = "Main"
85+
86+
static let feature = TargetDependency.Features.project(name: "Feature", group: group)
87+
}
88+
89+
public extension TargetDependency.Features.PopularTravel {
90+
static let group = "PopularTravel"
91+
92+
static let feature = TargetDependency.Features.project(name: "Feature", group: group)
93+
}

Plugins/EnvPlugin/ProjectDescriptionHelpers/Target+Extension.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ public extension Target {
4848
dependencies: [TargetDependency],
4949
scripts: [TargetScript],
5050
isStatic: Bool = false,
51-
hasResources: Bool = true
51+
hasResources: Bool = true,
52+
settings: Settings? = nil
5253
) -> Target {
5354
return .target(
5455
name: name,
@@ -61,7 +62,7 @@ public extension Target {
6162
resources: hasResources ? ["Resources/**"] : nil,
6263
scripts: scripts,
6364
dependencies: dependencies,
64-
settings: .frameworkSettings
65+
settings: settings ?? .frameworkSettings
6566
)
6667
}
6768
}

Projects/App/Project.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ let project = Project.makeModule(
2121
scripts: [.swiftLint],
2222
dependencies: [
2323
.data,
24-
.Modules.networks,
25-
.Features.rootFeature,
24+
.Features.rootFeature
2625
],
2726
settings: .appSettings()
2827
)

Projects/App/Sources/Application/AppComponent.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@
88

99
import Data
1010
import Domain
11-
import RIBs
1211
import RootFeature
1312

13+
import RIBs
14+
1415
final class AppComponent: Component<EmptyDependency>, RootDependency {
16+
var homeUsecase: HomeUsecaseProtocol {
17+
let homeRepository = HomeRepository(homeService: makeHomeService(tokenProvider: tokenProvider))
18+
return HomeUsecase(repository: homeRepository)
19+
}
1520

1621
var tokenProvider: TokenProviding {
1722
shared { TokenRepositoryFactory.makeTokenProvider() }
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//
2+
// String+.swift
3+
// Core
4+
//
5+
// Created by 최안용 on 1/31/26.
6+
// Copyright © 2026 NDGL-iOS. All rights reserved.
7+
//
8+
9+
import Foundation
10+
11+
public extension String {
12+
func toFlag() -> String {
13+
guard self.count == 2 else { return "🏳️" }
14+
15+
let base: UInt32 = 127397
16+
var flagString = ""
17+
18+
for uni in self.uppercased().unicodeScalars {
19+
if let scalar = UnicodeScalar(base + uni.value) {
20+
flagString.append(String(scalar))
21+
} else {
22+
return "🏳️"
23+
}
24+
}
25+
return flagString
26+
}
27+
28+
func toKoreanCountryName() -> String {
29+
guard self.count == 2 else { return "알 수 없음" }
30+
31+
let locale = Locale(identifier: "ko_KR")
32+
return locale.localizedString(forRegionCode: self) ?? "알 수 없음"
33+
}
34+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// UICollectionReusableView+.swift
3+
// Core
4+
//
5+
// Created by 최안용 on 2/3/26.
6+
// Copyright © 2026 NDGL-iOS. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
public extension UICollectionReusableView {
12+
static var reusableViewIdentifier : String {
13+
return String(describing: self)
14+
}
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// UICollectionViewCell+.swift
3+
// Core
4+
//
5+
// Created by 최안용 on 1/30/26.
6+
// Copyright © 2026 NDGL-iOS. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
public extension UICollectionViewCell {
12+
static var cellIdentifier : String {
13+
return String(describing: self)
14+
}
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// UITableViewCell+.swift
3+
// Core
4+
//
5+
// Created by 최안용 on 2/10/26.
6+
// Copyright © 2026 NDGL-iOS. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
public extension UITableViewCell {
12+
static var cellIdentifier: String {
13+
return String(describing: self)
14+
}
15+
}

Projects/Data/Sources/Adapter/TokenProviderAdapter.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public final class TokenProviderAdapter: TokenProviding, @unchecked Sendable {
1818
}
1919

2020
public func accessToken() -> String? {
21-
tokenRepository.get(.accessToken)
21+
// tokenRepository.get(.accessToken)
22+
"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJiYmE3ODIwYS0wMDUzLTQxZDctODdhYi00Zjk2ZWM3ZDI1MTMiLCJpYXQiOjE3NzA5NjQzMDUsImV4cCI6MTc3MTA1MDcwNX0.Sn8wNhZ1Ac-ETZDsOiSMMHHaALJNXxNKrbN_-4xD5REcVa2tJ0NiafhTKlbIuYafL1Acd9dDMIHjx3H33c5w8w"
2223
}
2324
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// HomeServiceFactory.swift
3+
// Data
4+
//
5+
// Created by 최안용 on 2/10/26.
6+
// Copyright © 2026 NDGL-iOS. All rights reserved.
7+
//
8+
9+
import Domain
10+
import Networks
11+
12+
import Moya
13+
14+
public func makeHomeService(tokenProvider: TokenProviding) -> HomeServiceProtocol {
15+
let provider: MoyaProvider<HomeAPI> = NetworkProviderFactory.makeAuthenticatedProvider(tokenProvider: tokenProvider)
16+
return HomeService(provider: provider)
17+
}

0 commit comments

Comments
 (0)