-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Refactor [#95] OAuthService 리펙토링
- Loading branch information
Showing
41 changed files
with
942 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...Tuist_iOS/Projects/Data/Demo/Resources/Assets.xcassets/AccentColor.colorset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
98 changes: 98 additions & 0 deletions
98
HMH_Tuist_iOS/Projects/Data/Demo/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "2x", | ||
"size" : "20x20" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "3x", | ||
"size" : "20x20" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "2x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "3x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "2x", | ||
"size" : "40x40" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "3x", | ||
"size" : "40x40" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "2x", | ||
"size" : "60x60" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "3x", | ||
"size" : "60x60" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "1x", | ||
"size" : "20x20" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "20x20" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "1x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "1x", | ||
"size" : "40x40" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "40x40" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "1x", | ||
"size" : "76x76" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "76x76" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "83.5x83.5" | ||
}, | ||
{ | ||
"idiom" : "ios-marketing", | ||
"scale" : "1x", | ||
"size" : "1024x1024" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
HMH_Tuist_iOS/Projects/Data/Demo/Resources/Assets.xcassets/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
76 changes: 76 additions & 0 deletions
76
HMH_Tuist_iOS/Projects/Data/Derived/InfoPlists/DataDemo-Info.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?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>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> | ||
</dict> | ||
</plist> |
93 changes: 93 additions & 0 deletions
93
HMH_Tuist_iOS/Projects/Data/Derived/Sources/TuistAssets+DataDemo.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
// swiftlint:disable all | ||
// swift-format-ignore-file | ||
// swiftformat:disable all | ||
// Generated using tuist — https://github.com/tuist/tuist | ||
|
||
#if os(macOS) | ||
import AppKit | ||
#elseif os(iOS) | ||
import UIKit | ||
#elseif os(tvOS) || os(watchOS) | ||
import UIKit | ||
#endif | ||
#if canImport(SwiftUI) | ||
import SwiftUI | ||
#endif | ||
|
||
// swiftlint:disable superfluous_disable_command file_length implicit_return | ||
|
||
// MARK: - Asset Catalogs | ||
|
||
// swiftlint:disable identifier_name line_length nesting type_body_length type_name | ||
public enum DataDemoAsset { | ||
public static let accentColor = DataDemoColors(name: "AccentColor") | ||
} | ||
// swiftlint:enable identifier_name line_length nesting type_body_length type_name | ||
|
||
// MARK: - Implementation Details | ||
|
||
public final class DataDemoColors { | ||
public fileprivate(set) var name: String | ||
|
||
#if os(macOS) | ||
public typealias Color = NSColor | ||
#elseif os(iOS) || os(tvOS) || os(watchOS) | ||
public typealias Color = UIColor | ||
#endif | ||
|
||
@available(iOS 11.0, tvOS 11.0, watchOS 4.0, macOS 10.13, *) | ||
public private(set) lazy var color: Color = { | ||
guard let color = Color(asset: self) else { | ||
fatalError("Unable to load color asset named \(name).") | ||
} | ||
return color | ||
}() | ||
|
||
#if canImport(SwiftUI) | ||
private var _swiftUIColor: Any? = nil | ||
@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *) | ||
public private(set) var swiftUIColor: SwiftUI.Color { | ||
get { | ||
if self._swiftUIColor == nil { | ||
self._swiftUIColor = SwiftUI.Color(asset: self) | ||
} | ||
|
||
return self._swiftUIColor as! SwiftUI.Color | ||
} | ||
set { | ||
self._swiftUIColor = newValue | ||
} | ||
} | ||
#endif | ||
|
||
fileprivate init(name: String) { | ||
self.name = name | ||
} | ||
} | ||
|
||
public extension DataDemoColors.Color { | ||
@available(iOS 11.0, tvOS 11.0, watchOS 4.0, macOS 10.13, *) | ||
convenience init?(asset: DataDemoColors) { | ||
let bundle = DataDemoResources.bundle | ||
#if os(iOS) || os(tvOS) | ||
self.init(named: asset.name, in: bundle, compatibleWith: nil) | ||
#elseif os(macOS) | ||
self.init(named: NSColor.Name(asset.name), bundle: bundle) | ||
#elseif os(watchOS) | ||
self.init(named: asset.name) | ||
#endif | ||
} | ||
} | ||
|
||
#if canImport(SwiftUI) | ||
@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *) | ||
public extension SwiftUI.Color { | ||
init(asset: DataDemoColors) { | ||
let bundle = DataDemoResources.bundle | ||
self.init(asset.name, bundle: bundle) | ||
} | ||
} | ||
#endif | ||
|
||
// swiftlint:enable all | ||
// swiftformat:enable all |
24 changes: 24 additions & 0 deletions
24
HMH_Tuist_iOS/Projects/Data/Derived/Sources/TuistBundle+DataDemo.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// swiftlint:disable all | ||
// swift-format-ignore-file | ||
// swiftformat:disable all | ||
import Foundation | ||
|
||
// MARK: - Swift Bundle Accessor | ||
|
||
private class BundleFinder {} | ||
|
||
extension Foundation.Bundle { | ||
/// Since DataDemo is a application, the bundle for classes within this module can be used directly. | ||
static let module = Bundle(for: BundleFinder.self) | ||
} | ||
|
||
// MARK: - Objective-C Bundle Accessor | ||
|
||
@objc | ||
public class DataDemoResources: NSObject { | ||
@objc public class var bundle: Bundle { | ||
return .module | ||
} | ||
} | ||
// swiftlint:enable all | ||
// swiftformat:enable all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
HMH_Tuist_iOS/Projects/Data/Sources/Factory/OAuthServiceFactory.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// OAuthServiceFactory.swift | ||
// Data | ||
// | ||
// Created by 류희재 on 11/2/24. | ||
// Copyright © 2024 HMH-iOS. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
import Domain | ||
import Networks | ||
|
||
public protocol OAuthServiceFactoryType { | ||
func makeOAuthService(for providerType: OAuthProviderType) -> OAuthServiceType | ||
} | ||
|
||
public class OAuthServiceFactory: OAuthServiceFactoryType { | ||
public init() {} | ||
|
||
public func makeOAuthService(for providerType: OAuthProviderType) -> OAuthServiceType { | ||
switch providerType { | ||
case .kakao: | ||
return OAuthKakaoService() | ||
case .apple: | ||
return OAuthAppleService() | ||
} | ||
} | ||
} |
Oops, something went wrong.