-
Notifications
You must be signed in to change notification settings - Fork 24
박스오피스 앱 [STEP3] Harry, Sajae #51
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
base: main
Are you sure you want to change the base?
Changes from 88 commits
6d5f518
01b3890
2f96fe3
ecc306e
53a0c23
e4a9f20
977ca6d
40efade
d6af27e
fdf8d7c
02bd755
73121b0
6f7cb09
b445c48
67a73db
b2d8792
e2a557f
eafdd5c
a618128
b412f62
3fbc5e3
eb6c77b
46b0b2d
2ec57b3
feaced2
bc334f5
e6bb32e
e882527
3a05091
ae9e940
f7cbba9
506e9ba
a955aa4
091e3ed
9566e5d
e373045
bb249fc
cff01c0
633d111
a97b9a0
0c97abe
4789830
45af001
1b1f3af
a1ac95d
b70e580
1cfb86d
2c9079a
c561df7
e484df7
5545f25
f6ac24c
555ae74
c4015cc
9780552
871e3c8
9ffabf3
ebe63a5
90f491c
ceb6e48
0caedf6
37fc1b7
cafce2e
a3a501a
b8b1835
edf367f
ca65fec
95878ee
efdf9d2
6486599
630ea9d
d1d664e
9fbfc05
4150155
4f1d498
b780823
098dba2
8879a75
6400fbb
330f0f4
7d51d1b
70488b1
1861366
5a89206
573f503
ab8fc39
91cd1ea
755992e
e913271
795a82a
ea5a624
bf1468c
05b38f2
dab8c27
002e961
636d994
a38b6e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| # Created by https://www.toptal.com/developers/gitignore/api/macos,swift,xcode | ||
| # Edit at https://www.toptal.com/developers/gitignore?templates=macos,swift,xcode | ||
|
|
||
| ### macOS ### | ||
| # General | ||
| .DS_Store | ||
| .AppleDouble | ||
| .LSOverride | ||
|
|
||
| # Icon must end with two \r | ||
| Icon | ||
|
|
||
|
|
||
| # Thumbnails | ||
| ._* | ||
|
|
||
| # Files that might appear in the root of a volume | ||
| .DocumentRevisions-V100 | ||
| .fseventsd | ||
| .Spotlight-V100 | ||
| .TemporaryItems | ||
| .Trashes | ||
| .VolumeIcon.icns | ||
| .com.apple.timemachine.donotpresent | ||
|
|
||
| # Directories potentially created on remote AFP share | ||
| .AppleDB | ||
| .AppleDesktop | ||
| Network Trash Folder | ||
| Temporary Items | ||
| .apdisk | ||
|
|
||
| ### macOS Patch ### | ||
| # iCloud generated files | ||
| *.icloud | ||
|
|
||
| ### Swift ### | ||
| # Xcode | ||
| # | ||
| # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore | ||
|
|
||
| ## User settings | ||
| xcuserdata/ | ||
|
|
||
| ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) | ||
| *.xcscmblueprint | ||
| *.xccheckout | ||
|
|
||
| ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) | ||
| Private/ | ||
| build/ | ||
| DerivedData/ | ||
| *.moved-aside | ||
| *.pbxuser | ||
| !default.pbxuser | ||
| *.mode1v3 | ||
| !default.mode1v3 | ||
| *.mode2v3 | ||
| !default.mode2v3 | ||
| *.perspectivev3 | ||
| !default.perspectivev3 | ||
|
|
||
| ## Obj-C/Swift specific | ||
| *.hmap | ||
|
|
||
| ## App packaging | ||
| *.ipa | ||
| *.dSYM.zip | ||
| *.dSYM | ||
|
|
||
| ## Playgrounds | ||
| timeline.xctimeline | ||
| playground.xcworkspace | ||
|
|
||
| # Swift Package Manager | ||
| # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. | ||
| # Packages/ | ||
| # Package.pins | ||
| # Package.resolved | ||
| # *.xcodeproj | ||
| # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata | ||
| # hence it is not needed unless you have added a package configuration file to your project | ||
| # .swiftpm | ||
|
|
||
| .build/ | ||
|
|
||
| # CocoaPods | ||
| # We recommend against adding the Pods directory to your .gitignore. However | ||
| # you should judge for yourself, the pros and cons are mentioned at: | ||
| # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control | ||
| # Pods/ | ||
| # Add this line if you want to avoid checking in source code from the Xcode workspace | ||
| # *.xcworkspace | ||
|
|
||
| # Carthage | ||
| # Add this line if you want to avoid checking in source code from Carthage dependencies. | ||
| # Carthage/Checkouts | ||
|
|
||
| Carthage/Build/ | ||
|
|
||
| # Accio dependency management | ||
| Dependencies/ | ||
| .accio/ | ||
|
|
||
| # fastlane | ||
| # It is recommended to not store the screenshots in the git repo. | ||
| # Instead, use fastlane to re-generate the screenshots whenever they are needed. | ||
| # For more information about the recommended setup visit: | ||
| # https://docs.fastlane.tools/best-practices/source-control/#source-control | ||
|
|
||
| fastlane/report.xml | ||
| fastlane/Preview.html | ||
| fastlane/screenshots/**/*.png | ||
| fastlane/test_output | ||
|
|
||
| # Code Injection | ||
| # After new code Injection tools there's a generated folder /iOSInjectionProject | ||
| # https://github.com/johnno1962/injectionforxcode | ||
|
|
||
| iOSInjectionProject/ | ||
|
|
||
| ### Xcode ### | ||
|
|
||
| ## Xcode 8 and earlier | ||
|
|
||
| ### Xcode Patch ### | ||
| *.xcodeproj/* | ||
| !*.xcodeproj/project.pbxproj | ||
| !*.xcodeproj/xcshareddata/ | ||
| !*.xcodeproj/project.xcworkspace/ | ||
| !*.xcworkspace/contents.xcworkspacedata | ||
| /*.gcno | ||
| **/xcshareddata/WorkspaceSettings.xcsettings | ||
|
|
||
| # End of https://www.toptal.com/developers/gitignore/api/macos,swift,xcode |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <Scheme | ||
| LastUpgradeVersion = "1530" | ||
| version = "1.7"> | ||
| <BuildAction | ||
| parallelizeBuildables = "YES" | ||
| buildImplicitDependencies = "YES" | ||
| buildArchitectures = "Automatic"> | ||
| <BuildActionEntries> | ||
| <BuildActionEntry | ||
| buildForTesting = "YES" | ||
| buildForRunning = "YES" | ||
| buildForProfiling = "YES" | ||
| buildForArchiving = "YES" | ||
| buildForAnalyzing = "YES"> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "63DF20EA2970E1A0005DF7D1" | ||
| BuildableName = "BoxOffice.app" | ||
| BlueprintName = "BoxOffice" | ||
| ReferencedContainer = "container:BoxOffice.xcodeproj"> | ||
| </BuildableReference> | ||
| </BuildActionEntry> | ||
| </BuildActionEntries> | ||
| </BuildAction> | ||
| <TestAction | ||
| buildConfiguration = "Debug" | ||
| selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
| selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
| shouldUseLaunchSchemeArgsEnv = "YES" | ||
| shouldAutocreateTestPlan = "YES"> | ||
| <Testables> | ||
| <TestableReference | ||
| skipped = "NO" | ||
| parallelizable = "YES"> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "08DCFEDB2B7C59D7002E22EA" | ||
| BuildableName = "BoxOfficeUnitTests.xctest" | ||
| BlueprintName = "BoxOfficeUnitTests" | ||
| ReferencedContainer = "container:BoxOffice.xcodeproj"> | ||
| </BuildableReference> | ||
| </TestableReference> | ||
| </Testables> | ||
| </TestAction> | ||
| <LaunchAction | ||
| buildConfiguration = "Debug" | ||
| selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
| selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
| launchStyle = "0" | ||
| useCustomWorkingDirectory = "NO" | ||
| ignoresPersistentStateOnLaunch = "NO" | ||
| debugDocumentVersioning = "YES" | ||
| debugServiceExtension = "internal" | ||
| allowLocationSimulation = "YES"> | ||
| <BuildableProductRunnable | ||
| runnableDebuggingMode = "0"> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "63DF20EA2970E1A0005DF7D1" | ||
| BuildableName = "BoxOffice.app" | ||
| BlueprintName = "BoxOffice" | ||
| ReferencedContainer = "container:BoxOffice.xcodeproj"> | ||
| </BuildableReference> | ||
| </BuildableProductRunnable> | ||
| </LaunchAction> | ||
| <ProfileAction | ||
| buildConfiguration = "Release" | ||
| shouldUseLaunchSchemeArgsEnv = "YES" | ||
| savedToolIdentifier = "" | ||
| useCustomWorkingDirectory = "NO" | ||
| debugDocumentVersioning = "YES"> | ||
| <BuildableProductRunnable | ||
| runnableDebuggingMode = "0"> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "63DF20EA2970E1A0005DF7D1" | ||
| BuildableName = "BoxOffice.app" | ||
| BlueprintName = "BoxOffice" | ||
| ReferencedContainer = "container:BoxOffice.xcodeproj"> | ||
| </BuildableReference> | ||
| </BuildableProductRunnable> | ||
| </ProfileAction> | ||
| <AnalyzeAction | ||
| buildConfiguration = "Debug"> | ||
| </AnalyzeAction> | ||
| <ArchiveAction | ||
| buildConfiguration = "Release" | ||
| revealArchiveInOrganizer = "YES"> | ||
| </ArchiveAction> | ||
| </Scheme> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
|
|
||
| import UIKit | ||
|
|
||
| @main | ||
| class AppDelegate: UIResponder, UIApplicationDelegate { | ||
| func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | ||
| return true | ||
| } | ||
|
|
||
| func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { | ||
| return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) | ||
| } | ||
| } | ||
|
|
||
| /// 배포/디버깅 환경에 따라 키값 글로벌 선언 | ||
| var ENV: APIKey { | ||
| #if DEBUG | ||
| return DebugEnvironment() | ||
| #else | ||
| return ProdEnvironment() | ||
| #endif | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
|
|
||
| import Foundation | ||
|
|
||
| final class DependencyEnvironment { | ||
| /// 디코더 설정 셋팅 예시 | ||
| private let jsonDecoder: JSONDecoder = { | ||
| let jsonDecoder = JSONDecoder() | ||
| jsonDecoder.dateDecodingStrategy = .iso8601 | ||
| return jsonDecoder | ||
| }() | ||
|
|
||
| private lazy var decodeProvider: JsonDecodeProtocol = JsonDecoder(jsonDecoder: jsonDecoder) | ||
|
|
||
| private lazy var sessionProvider: SessionProvidable = SessionProvider() | ||
|
||
|
|
||
| private lazy var requestBuidler: RequestBuilderProtocol = RequestBuilder() | ||
|
|
||
| private lazy var networkManager: NetworkManagerProtocol = NetworkManager(sessionProvider: sessionProvider, decoder: decodeProvider) | ||
|
|
||
| private lazy var movieRepository: MovieRepositoryProtocol = MovieRepository(networkManager: networkManager, requestBuilder: requestBuidler) | ||
|
|
||
| private lazy var boxOfficeUseCase: BoxOfficeUseCaseProtocol = BoxOfficeUseCase(moviesRepository: movieRepository) | ||
| } | ||
|
|
||
| extension DependencyEnvironment: ViewControllerFactoryProtocol { | ||
| func makeBoxOfficeCollectionViewController() -> BoxOfficeViewController { | ||
| BoxOfficeViewController(boxOfficeUseCase: boxOfficeUseCase) | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
|
|
||
| import UIKit | ||
|
|
||
| class SceneDelegate: UIResponder, UIWindowSceneDelegate { | ||
| var window: UIWindow? | ||
| private let viewControllerFactory:ViewControllerFactoryProtocol = DependencyEnvironment() | ||
|
|
||
| func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { | ||
|
|
||
| guard let windowScene = (scene as? UIWindowScene) else { return } | ||
|
|
||
| let mainViewController = UINavigationController(rootViewController: viewControllerFactory.makeBoxOfficeCollectionViewController()) | ||
|
|
||
| window = UIWindow(windowScene: windowScene) | ||
| window?.makeKeyAndVisible() | ||
| window?.rootViewController = mainViewController | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
|
|
||
| protocol ViewControllerFactoryProtocol { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Protocol을 통해 범용성 있는 FactoryProtocol을 만들었지만
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 수정커밋: e913271 프로토콜 메서드의 리턴타입을 |
||
| func makeBoxOfficeCollectionViewController() -> BoxOfficeViewController | ||
| } | ||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
|
|
||
| import Foundation | ||
|
|
||
| extension Date { | ||
| static var yesterday: Date { return Date().dayBefore } | ||
|
|
||
| var dayBefore: Date { | ||
| return Calendar.current.date(byAdding: .day, value: -1, to: noon)! | ||
| } | ||
|
|
||
| var noon: Date { | ||
| return Calendar.current.date(bySettingHour: 12, minute: 0, second: 0, of: self)! | ||
| } | ||
|
|
||
| func formattedDate(withFormat format: String) -> String { | ||
| let formatter = DateFormatter() | ||
| formatter.dateFormat = format | ||
| return formatter.string(from: self) | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
현재 debug와 production이 나눠질 필요가 없는 것으로 보여요.
삭제되어야할 부분으로 보입니다. 삭제한다면
ENV는 어떻게 관리 되는 것이 좋을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug와 production이 나눌필요가 없어 get으로 받는 프로토콜만 남겼습니다!
해당 파일은 깃이그노어로 숨겨줄 수 있습니다! (학습용이라 판단하여 따로 숨김처리는 하지 않았습니다)