Skip to content
Open
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ SMASHING iOS Assignment 레포입니다 🌀🧪
- GitHub 같이 망쳐보기 (아요 과제)
- 코딩 컨벤션 지키기
- 코리 규칙 설정해보기
- 머지하면서 망해보기
- 머지하면서 망해보기

# 2주차
39 changes: 33 additions & 6 deletions Smashing-Assignment.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
1ECDD5532EFDB564005A9325 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = 1ECDD5522EFDB564005A9325 /* SnapKit */; };
1ECDD5562EFDB56C005A9325 /* Then in Frameworks */ = {isa = PBXBuildFile; productRef = 1ECDD5552EFDB56C005A9325 /* Then */; };
637B44262F03AC26008C1F7C /* Moya in Frameworks */ = {isa = PBXBuildFile; productRef = 637B44252F03AC26008C1F7C /* Moya */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -43,6 +44,7 @@
files = (
1ECDD5532EFDB564005A9325 /* SnapKit in Frameworks */,
1ECDD5562EFDB56C005A9325 /* Then in Frameworks */,
637B44262F03AC26008C1F7C /* Moya in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -87,6 +89,7 @@
packageProductDependencies = (
1ECDD5522EFDB564005A9325 /* SnapKit */,
1ECDD5552EFDB56C005A9325 /* Then */,
637B44252F03AC26008C1F7C /* Moya */,
);
productName = "Smashing-Assignment";
productReference = 633612112EFBCE6100228B88 /* Smashing-Assignment.app */;
Expand Down Expand Up @@ -119,6 +122,7 @@
packageReferences = (
1ECDD5512EFDB564005A9325 /* XCRemoteSwiftPackageReference "SnapKit" */,
1ECDD5542EFDB56C005A9325 /* XCRemoteSwiftPackageReference "Then" */,
637B44242F03AC26008C1F7C /* XCRemoteSwiftPackageReference "Moya" */,
);
preferredProjectObjectVersion = 77;
productRefGroup = 633612122EFBCE6100228B88 /* Products */;
Expand Down Expand Up @@ -163,8 +167,7 @@
INFOPLIST_FILE = "Smashing-Assignment/Global/Info.plist";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
IPHONEOS_DEPLOYMENT_TARGET = 26.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -174,17 +177,23 @@
PRODUCT_BUNDLE_IDENTIFIER = "iseungjun.Smashing-Assignment";
PRODUCT_NAME = "$(TARGET_NAME)";
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_APPROACHABLE_CONCURRENCY = YES;
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
};
633612262EFBCE6200228B88 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReferenceAnchor = 633612132EFBCE6100228B88 /* Smashing-Assignment */;
baseConfigurationReferenceRelativePath = Global/Config.xcconfig;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
Expand All @@ -195,8 +204,7 @@
INFOPLIST_FILE = "Smashing-Assignment/Global/Info.plist";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
IPHONEOS_DEPLOYMENT_TARGET = 26.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -206,17 +214,23 @@
PRODUCT_BUNDLE_IDENTIFIER = "iseungjun.Smashing-Assignment";
PRODUCT_NAME = "$(TARGET_NAME)";
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_APPROACHABLE_CONCURRENCY = YES;
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
};
633612272EFBCE6200228B88 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReferenceAnchor = 633612132EFBCE6100228B88 /* Smashing-Assignment */;
baseConfigurationReferenceRelativePath = Global/Config.xcconfig;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
Expand Down Expand Up @@ -376,6 +390,14 @@
minimumVersion = 3.0.0;
};
};
637B44242F03AC26008C1F7C /* XCRemoteSwiftPackageReference "Moya" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/Moya/Moya.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 15.0.3;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
Expand All @@ -389,6 +411,11 @@
package = 1ECDD5542EFDB56C005A9325 /* XCRemoteSwiftPackageReference "Then" */;
productName = Then;
};
637B44252F03AC26008C1F7C /* Moya */ = {
isa = XCSwiftPackageProductDependency;
package = 637B44242F03AC26008C1F7C /* XCRemoteSwiftPackageReference "Moya" */;
productName = Moya;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 633612092EFBCE6100228B88 /* Project object */;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions Smashing-Assignment/Application/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,20 @@ import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

let factory: SceneFactory = AppSceneFactory()
var window: UIWindow?


func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let windowScene = (scene as? UIWindowScene) else { return }

window = UIWindow(windowScene: windowScene)
window?.rootViewController = TabBarController()
window?.makeKeyAndVisible()

let window = UIWindow(windowScene: windowScene)
let initialVC = factory.makeScene(for: .login)
window.rootViewController = initialVC
self.window = window
window.makeKeyAndVisible()
}

func sceneDidDisconnect(_ scene: UIScene) {
Expand Down
20 changes: 0 additions & 20 deletions Smashing-Assignment/Extension/UITextField+.swift

This file was deleted.

13 changes: 13 additions & 0 deletions Smashing-Assignment/Global/Environment.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// Environment.swift
// Smashing-Assignment
//
// Created by 이승준 on 12/30/25.
//

import Foundation

enum Environment {
static let baseURL: String = Bundle.main.infoDictionary?["BaseURL"] as! String
static let movie_API_Key: String = Bundle.main.infoDictionary?["MOVIE_API_KEY"] as! String
}
34 changes: 34 additions & 0 deletions Smashing-Assignment/Global/Factory/AppSceneFactory.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// AppSceneFactory.swift
// Smashing-Assignment
//
// Created by 이승준 on 12/29/25.
//

import UIKit

enum SceneType {
case login
case signup
case main
}

protocol SceneFactory {
func makeScene(for type: SceneType) -> UIViewController
}

final class AppSceneFactory: SceneFactory {
func makeScene(for type: SceneType) -> UIViewController {
switch type {
case .login:
let loginVC = LoginViewController()
return UINavigationController(rootViewController: loginVC)
case .signup:
let signUpVC = SignUpViewController()
return UINavigationController(rootViewController: signUpVC)
case .main:
let mainVC = TabBarController()
return UINavigationController(rootViewController: mainVC)
}
}
}
31 changes: 31 additions & 0 deletions Smashing-Assignment/Global/Factory/RootViewSwitcher.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// RootViewSwitcher.swift
// Smashing-Assignment
//
// Created by 이승준 on 12/29/25.
//

import UIKit

final class RootViewSwitcher {
static let shared = RootViewSwitcher()
private init() {}

func setRoot(_ viewController: UIViewController, animated: Bool = true) {
guard let window = UIApplication.shared.connectedScenes
.compactMap({ $0 as? UIWindowScene })
.first?.windows.first else { return }

window.rootViewController = viewController

if animated {
UIView.transition(with: window,
duration: 0.3,
options: .transitionCrossDissolve,
animations: nil,
completion: nil)
}

window.makeKeyAndVisible()
}
}
4 changes: 4 additions & 0 deletions Smashing-Assignment/Global/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BaseURL</key>
<string>$(BaseURL)</string>
<key>MOVIE_API_KEY</key>
<string>$(MOVIE_API_KEY)</string>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
Expand Down
29 changes: 29 additions & 0 deletions Smashing-Assignment/Networks/Base/BaseTargetType.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// BaseTarget.swift
// Smashing-Assignment
//
// Created by 이승준 on 12/30/25.
//

import Foundation
import Moya

protocol BaseTargetType: TargetType { }

extension BaseTargetType{

var baseURL: URL {
return URL(string: Environment.baseURL)!
}

var headers: [String : String]? {
let header = [
"Content-Type": "application/json"
]
return header
}

var sampleData: Data {
return Data()
}
}
18 changes: 18 additions & 0 deletions Smashing-Assignment/Networks/Base/NetworkError.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// NetworkError.swift
// Smashing-Assignment
//
// Created by 이승준 on 12/30/25.
//

import Foundation

public enum NetworkError: Error {
case decoding
case unauthorized
case forbidden
case notFound
case serverError(String)
case networkFail
case unknown
}
Loading