Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into refactor/#114-Onbo…
Browse files Browse the repository at this point in the history
…arding
  • Loading branch information
kim-seonwoo committed Nov 25, 2024
2 parents 77e793b + df150b6 commit 09e81d5
Show file tree
Hide file tree
Showing 8 changed files with 217 additions and 206 deletions.
152 changes: 82 additions & 70 deletions HMH_Tuist_iOS/Projects/App/Derived/InfoPlists/HMH-iOS-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,75 +2,87 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BASE_URL</key>
<string>$(BASE_URL)</string>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>com.HMH.dailyTask</string>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>kakao$(KAKAO_API_KEY)</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>KAKAO_API_KEY</key>
<string>$(KAKAO_API_KEY)</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>kakaokompassauth</string>
<string>kakaolink</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UIAppFonts</key>
<array>
<string>Pretendard-Regular.otf</string>
<string>Pretendard-SemiBold.otf</string>
<string>Pretendard-Medium.otf</string>
</array>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict/>
</dict>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>BASE_URL</key>
<string>$(BASE_URL)</string>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>com.HMH.dailyTask</string>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>kakao$(KAKAO_API_KEY)</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>KAKAO_API_KEY</key>
<string>$(KAKAO_API_KEY)</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>kakaokompassauth</string>
<string>kakaolink</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UIAppFonts</key>
<array>
<string>Pretendard-Regular.otf</string>
<string>Pretendard-SemiBold.otf</string>
<string>Pretendard-Medium.otf</string>
</array>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
</dict>
</array>
</dict>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct SplashView: View {
.background(DSKitAsset.blackground.swiftUIColor, ignoresSafeAreaEdges: .all)
.onAppear {
DispatchQueue.main.asyncAfter(deadline: .now() + 3.5, execute: {
viewModel.handleSplashScreen()
// viewModel.handleSplashScreen()
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public enum OAuthProviderType {
case kakao
case apple
public enum OAuthProviderType: String {
case kakao = "KAKAO"
case apple = "APPLE"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
//
// LoginUseCase.swift
// LoginFeature
//
// Created by Seonwoo Kim on 11/8/24.
// Copyright © 2024 HMH-iOS. All rights reserved.
//

import Foundation
import Combine

import Domain
import Core

public enum LoginResponseType {
case loginSuccess
case loginFailure
case onboardingNeeded
}

public protocol LoginUseCaseType {
func login(provider: OAuthProviderType) -> AnyPublisher<LoginResponseType, AuthError>
}

public final class LoginUseCase: LoginUseCaseType {

private let repository: AuthRepositoryType

public init(repository: AuthRepositoryType) {
self.repository = repository
}

public func login(provider: OAuthProviderType) -> AnyPublisher<LoginResponseType, Domain.AuthError> {
repository.authorize(provider)
.handleEvents(receiveOutput: { socialToken in
UserManager.shared.socialToken = socialToken
})
.flatMap { [weak self] _ -> AnyPublisher<LoginResponseType, AuthError> in
guard let self = self else {
return Fail(error: AuthError.appleAuthrizeError).eraseToAnyPublisher()
}

return self.repository.socialLogin(socialPlatform: provider.rawValue)
.map { _ in LoginResponseType.loginSuccess }
.catch { error -> AnyPublisher<LoginResponseType, AuthError> in
switch error {
case .unregisteredUser:
return Just(.onboardingNeeded)
.setFailureType(to: AuthError.self)
.eraseToAnyPublisher()
default:
return Just(.loginFailure)
.setFailureType(to: AuthError.self)
.eraseToAnyPublisher()
}
}
.eraseToAnyPublisher()
}
.eraseToAnyPublisher()
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
//

import SwiftUI
import AuthenticationServices

import DSKit
import Domain

public struct LoginView: View {
@ObservedObject var viewModel: LoginViewModel
Expand All @@ -23,15 +23,13 @@ public struct LoginView: View {
.ignoresSafeArea()
VStack(spacing: 10) {
//TODO: 이미지 타입 문제거 같은데 지금 해결하기엔 싱싱미역
// SwipeView(imageNames: [.onboardingFirst, .onboardingSecond, .onboardingThird])
// .padding(.bottom, 75)
LoginButton(loginProvider: .kakao, viewModel: viewModel)
LoginButton(loginProvider: .apple, viewModel: viewModel)
SwipeView(swipeImages: [DSKitAsset.onboardingFirst.swiftUIImage, DSKitAsset.onboardingSecond.swiftUIImage, DSKitAsset.onboardingThird.swiftUIImage], viewModel: viewModel)
.padding(.bottom, 75)
LoginButton(loginProvider: OAuthProviderType.kakao, viewModel: viewModel)
LoginButton(loginProvider: OAuthProviderType.apple, viewModel: viewModel)
}
}
.frame(maxHeight: .infinity)
.padding(.vertical, 22)
}
}


Loading

0 comments on commit 09e81d5

Please sign in to comment.