Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions Modules/App/App.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.applesignin</key>
<array>
<string>Default</string>
</array>
</dict>
</plist>
393 changes: 161 additions & 232 deletions Modules/App/App.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<key>isShown</key>
<true/>
<key>orderHint</key>
<integer>30</integer>
<integer>32</integer>
</dict>
</dict>
</dict>
Expand Down
12 changes: 12 additions & 0 deletions Modules/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ let project = Project(
infoPlist: .extendingDefault(
with: [
"API_BASE_URL": "$(API_BASE_URL)",
"KAKAO_NATIVE_APP_KEY": "$(KAKAO_NATIVE_APP_KEY)",
"CFBundleDisplayName": "$(APP_DISPLAY_NAME)",
"CFBundleShortVersionString": "$(MARKETING_VERSION)",
"CFBundleVersion": "$(CURRENT_PROJECT_VERSION)",
Expand Down Expand Up @@ -68,13 +69,24 @@ let project = Project(
[
"CFBundleURLName": "$(PRODUCT_BUNDLE_IDENTIFIER)",
"CFBundleURLSchemes": ["newdok"]
],
[
"CFBundleURLName": "kakao",
"CFBundleURLSchemes": ["kakao$(KAKAO_NATIVE_APP_KEY)"]
]
],
"LSApplicationQueriesSchemes": [
"kakaokompassauth",
"kakaotalk",
"kakaolink",
"kakaoplus"
],
"ITSAppUsesNonExemptEncryption": false
]
),
sources: ["Sources/**"],
resources: ["Resources/**"],
entitlements: "App.entitlements",
dependencies: [
// Infrastructure
.networkKit,
Expand Down
6 changes: 6 additions & 0 deletions Modules/App/Sources/DI/AppContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,29 +90,35 @@
authBuilder.makeOnboardingView(onSignup: onSignup, onLogin: onLogin)
}

func makeLoginView(

Check warning on line 93 in Modules/App/Sources/DI/AppContainer.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Function should have 5 parameters or less: it currently has 6 (function_parameter_count)
canGoBack: Bool,
onBack: @escaping () -> Void,
onRecovery: @escaping () -> Void,
onSignup: @escaping () -> Void,
onNeedSignup: @escaping (String, String?) -> Void,
onAuthenticated: @escaping () -> Void
) -> some View {
authBuilder.makeLoginView(
canGoBack: canGoBack,
onBack: onBack,
onRecovery: onRecovery,
onSignup: onSignup,
onNeedSignup: onNeedSignup,
onAuthenticated: onAuthenticated
)
}

func makeSignupView(

Check warning on line 111 in Modules/App/Sources/DI/AppContainer.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Function should have 5 parameters or less: it currently has 6 (function_parameter_count)
signupToken: String,
nickname: String?,
onBack: @escaping () -> Void,
onLogin: @escaping () -> Void,
onRecovery: @escaping () -> Void,
onAuthenticated: @escaping () -> Void
) -> some View {
authBuilder.makeSignupView(
signupToken: signupToken,
nickname: nickname,
onBack: onBack,
onLogin: onLogin,
onRecovery: onRecovery,
Expand All @@ -136,7 +142,7 @@
)
}

func makeExploreView(

Check warning on line 145 in Modules/App/Sources/DI/AppContainer.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Function should have 5 parameters or less: it currently has 7 (function_parameter_count)
exploreTrigger: UUID,
onConsumePending: @escaping () -> (day: Int?, tab: Int)?,
onSearch: @escaping () -> Void,
Expand Down
14 changes: 10 additions & 4 deletions Modules/App/Sources/Navigation/AuthFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,26 @@ struct AuthFlow: View {
private func routeView(_ route: AuthRoute) -> some View {
switch route {
case .onboarding:
// 소셜 로그인: 직접 회원가입 진입 없음 — 회원가입 버튼도 로그인 화면으로
container.makeOnboardingView(
onSignup: { router.push(.signup) },
onSignup: { router.push(.login) },
onLogin: { router.push(.login) }
)
case .login:
container.makeLoginView(
canGoBack: !router.path.isEmpty,
onBack: { router.pop() },
onRecovery: { router.push(.recovery) },
onSignup: { router.push(.signup) },
onSignup: { router.push(.login) },
onNeedSignup: { token, nickname in
router.push(.signup(signupToken: token, nickname: nickname))
},
onAuthenticated: { coordinator.finishAuth() }
)
case .signup:
case let .signup(token, nickname):
container.makeSignupView(
signupToken: token,
nickname: nickname,
onBack: { router.pop() },
onLogin: { router.push(.login) },
onRecovery: { router.push(.recovery) },
Expand All @@ -42,7 +48,7 @@ struct AuthFlow: View {
case .recovery:
container.makeRecoveryView(
onBack: { router.pop() },
onSignup: { router.push(.signup) },
onSignup: { router.push(.login) },
onLogin: { router.push(.login) },
onServiceFeedback: { router.push(.serviceFeedback) }
)
Expand Down
2 changes: 1 addition & 1 deletion Modules/App/Sources/Navigation/AuthRoute.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
enum AuthRoute: Hashable, Identifiable {
case onboarding
case login
case signup
case signup(signupToken: String, nickname: String?)
case recovery
case serviceFeedback

Expand Down
2 changes: 1 addition & 1 deletion Modules/App/Sources/Tabs/BookmarkStack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct BookmarkStack: View {
container.makeBrandDetailView(
id: id,
onBack: { coordinator.bookmarkRouter.pop() },
onSignup: { coordinator.presentAuth(.signup) },
onSignup: { coordinator.presentAuth(.login) },
onGoHome: { coordinator.goHome() },
onArticleTap: { coordinator.bookmarkRouter.push(.articleDetail(id: $0, isPast: true)) }
)
Expand Down
4 changes: 2 additions & 2 deletions Modules/App/Sources/Tabs/ExploreStack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct ExploreStack: View {
exploreTrigger: coordinator.exploreTrigger,
onConsumePending: { coordinator.consumeExploreParams() },
onSearch: { coordinator.exploreRouter.push(.search) },
onSignup: { coordinator.presentAuth(.signup) },
onSignup: { coordinator.presentAuth(.login) },
onLogin: { coordinator.presentAuth(.login) },
onEditProfile: { coordinator.openEditProfile() },
onBrandTap: { coordinator.exploreRouter.push(.brandDetail(id: $0)) }
Expand All @@ -36,7 +36,7 @@ struct ExploreStack: View {
container.makeBrandDetailView(
id: id,
onBack: { coordinator.exploreRouter.pop() },
onSignup: { coordinator.presentAuth(.signup) },
onSignup: { coordinator.presentAuth(.login) },
onGoHome: { coordinator.goHome() },
onArticleTap: { coordinator.exploreRouter.push(.articleDetail(id: $0, isPast: true)) }
)
Expand Down
4 changes: 2 additions & 2 deletions Modules/App/Sources/Tabs/HomeStack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct HomeStack: View {
container.makeHomeView(
onArticleTap: { coordinator.homeRouter.push(.articleDetail(id: $0, isPast: false)) },
onSearch: { coordinator.homeRouter.push(.search) },
onSignup: { coordinator.presentAuth(.signup) },
onSignup: { coordinator.presentAuth(.login) },
onLogin: { coordinator.presentAuth(.login) },
onGoToExplore: { day, tab in coordinator.moveToExplore(day: day, tab: tab) }
)
Expand All @@ -38,7 +38,7 @@ struct HomeStack: View {
container.makeBrandDetailView(
id: id,
onBack: { coordinator.homeRouter.pop() },
onSignup: { coordinator.presentAuth(.signup) },
onSignup: { coordinator.presentAuth(.login) },
onGoHome: { coordinator.goHome() },
onArticleTap: { coordinator.homeRouter.push(.articleDetail(id: $0, isPast: true)) }
)
Expand Down
2 changes: 1 addition & 1 deletion Modules/App/Sources/Tabs/SubscribeStack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct SubscribeStack: View {
container.makeBrandDetailView(
id: id,
onBack: { coordinator.subscribeRouter.pop() },
onSignup: { coordinator.presentAuth(.signup) },
onSignup: { coordinator.presentAuth(.login) },
onGoHome: { coordinator.goHome() },
onArticleTap: { coordinator.subscribeRouter.push(.articleDetail(id: $0, isPast: true)) }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public enum DesignSystemAsset: Sendable {
public static let font = DesignSystemImages(name: "font")
public static let highlight = DesignSystemImages(name: "highlight")
public static let home = DesignSystemImages(name: "home")
public static let kakaoBubble = DesignSystemImages(name: "kakaoBubble")
public static let letter = DesignSystemImages(name: "letter")
public static let logo = DesignSystemImages(name: "logo")
public static let mailbox = DesignSystemImages(name: "mailbox")
Expand Down
74 changes: 32 additions & 42 deletions Modules/DesignSystem/Derived/Sources/TuistBundle+DesignSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,49 @@ public import Foundation
#else
import Foundation
#endif
// MARK: - Swift Bundle Accessor for Static Frameworks
// MARK: - Swift Bundle Accessor - for SPM
private class BundleFinder {}
extension Foundation.Bundle {
/// Since DesignSystem is a static framework, a cut down framework is embedded, with all the resources but only a stub Mach-O image.
/// Since DesignSystem is a static framework, the bundle containing the resources is copied into the final product.
static let module: Bundle = {
class BundleFinder {}
let hostBundle = Bundle(for: BundleFinder.self)
var candidates: [URL?] = [
hostBundle.privateFrameworksURL,
hostBundle.bundleURL.appendingPathComponent("Frameworks"),
hostBundle.bundleURL,
hostBundle.bundleURL.deletingLastPathComponent(),
hostBundle.resourceURL,
Bundle.main.privateFrameworksURL,
Bundle.main.bundleURL.appendingPathComponent("Frameworks"),
Bundle.main.bundleURL,
Bundle.main.resourceURL,
// App extensions are placed under PlugIns/ in the host app bundle.
// Navigate up from the extension to the containing app's Frameworks directory.
hostBundle.bundleURL.deletingLastPathComponent().deletingLastPathComponent().appendingPathComponent("Frameworks"),
].map({ $0?.appendingPathComponent("DesignSystem.framework") })

for candidate in candidates {
if let bundle = candidate.flatMap(Bundle.init(url:)) {
return bundle
}
}

var bundleCandidates: [URL?] = [
hostBundle.resourceURL,
hostBundle.bundleURL,
hostBundle.privateFrameworksURL,
hostBundle.bundleURL.appendingPathComponent("Frameworks"),
hostBundle.bundleURL.deletingLastPathComponent(),
let bundleName = "DesignSystem_DesignSystem"
let bundleFinderResourceURL = Bundle(for: BundleFinder.self).resourceURL
var candidates = [
Bundle.main.resourceURL,
bundleFinderResourceURL,
Bundle.main.bundleURL,
Bundle.main.privateFrameworksURL,
Bundle.main.bundleURL.appendingPathComponent("Frameworks"),
hostBundle.bundleURL.deletingLastPathComponent().deletingLastPathComponent().appendingPathComponent("Frameworks"),
]
if ProcessInfo.processInfo.processName == "xctest"
|| ProcessInfo.processInfo.processName == "swift-testing"
{
bundleCandidates.append(hostBundle.bundleURL.appendingPathComponent(".."))
// This is a fix to make Previews work with bundled resources.
// Logic here is taken from SPM's generated `resource_bundle_accessors.swift` file,
// which is located under the derived data directory after building the project.
if let override = ProcessInfo.processInfo.environment["PACKAGE_RESOURCE_BUNDLE_PATH"] {
candidates.append(URL(fileURLWithPath: override))
// Deleting derived data and not rebuilding the frameworks containing resources may result in a state
// where the bundles are only available in the framework's directory that is actively being previewed.
// Since we don't know which framework this is, we also need to look in all the framework subpaths.
if let subpaths = try? Foundation.FileManager.default.contentsOfDirectory(atPath: override) {
for subpath in subpaths {
if subpath.hasSuffix(".framework") {
candidates.append(URL(fileURLWithPath: override + "/" + subpath))
}
}
}
}

for candidate in bundleCandidates {
let bundlePath = candidate?.appendingPathComponent("DesignSystem_DesignSystem.bundle")
// This is a fix to make unit tests work with bundled resources.
// Making this change allows unit tests to search one directory up for a bundle.
// More context can be found in this PR: https://github.com/tuist/tuist/pull/6895
#if canImport(XCTest)
candidates.append(bundleFinderResourceURL?.appendingPathComponent(".."))
#endif

for candidate in candidates {
let bundlePath = candidate?.appendingPathComponent(bundleName + ".bundle")
if let bundle = bundlePath.flatMap(Bundle.init(url:)) {
return bundle
}
}

return Bundle.main
fatalError("unable to find bundle named DesignSystem_DesignSystem")
}()
}
// MARK: - Objective-C Bundle Accessor
Expand Down
Loading
Loading