Skip to content

Commit

Permalink
Merge pull request #9 from Pepsi-Club/feat/#8
Browse files Browse the repository at this point in the history
Feat/#8
  • Loading branch information
gnksbm authored Jan 22, 2024
2 parents eb20dce + f475cf3 commit cce2f60
Show file tree
Hide file tree
Showing 62 changed files with 664 additions and 77 deletions.
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ included:
excluded: # 린트 과정에서 무시할 파일 경로. `included`보다 우선순위 높음
- Projects/App/Sources/AppDelegate.swift
- Projects/App/Sources/SceneDelegate.swift
- Projects/Feature/**/AppDelegate.swift
- Tuist
- Derived
- Plugins
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ import ProjectDescription

public extension Array<TargetDependency> {
enum Presentation: String, CaseIterable {
case home, alarm, settings
case home, alarm, settings, busStop, search, nearMap

public var dependency: TargetDependency {
var name = rawValue.map { $0 }
name.removeFirst()
name.insert(Character(rawValue.first!.uppercased()), at: 0)
return presentationModule(name: String(name))
return presentationModule(name: "\(String(name))Feature")
}

private func presentationModule(name: String) -> TargetDependency {
.project(
target: "\(name)",
path: .relativeToRoot("Projects/Presentation/\(name)")
path: .relativeToRoot("Projects/Feature/\(name)")
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ import ProjectDescription

public extension TargetDependency {
static let app: Self = .module(name: "App")
static let mainPresentation: Self = .module(name: "MainPresentation")
static let feature: Self = .moduleWithAdditionalPath(
name: "Feature",
path: "Presentation"
)
static let presentationDependency: Self = .module(name: "PresentationDependency")
static let mainFeature: Self = .module(name: "MainFeature")
static let featureDependency: Self = .module(name: "FeatureDependency")
static let core: Self = .module(name: "Core")
static let data: Self = .module(name: "Data")
static let domain: Self = .module(name: "Domain")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ import ProjectDescription

public extension Array<TargetDependency> {
enum ThirdPartyExternal: CaseIterable {
case rxSwift, rxCocoa, kakaoMap
case rxCocoa, kakaoMap

public var name: String {
switch self {
case .rxSwift:
return "RxSwift"
case .rxCocoa:
return "RxCocoa"
case .kakaoMap:
Expand Down
3 changes: 1 addition & 2 deletions Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ let project = Project.makeProject(
moduleType: .app,
hasResource: true,
dependencies: [
.mainPresentation,
.mainFeature,
.data,
.domain,
]
)
1 change: 1 addition & 0 deletions Projects/App/Sources/AppDelegate+Appearance.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit

import DesignSystem

extension AppDelegate {
Expand Down
4 changes: 2 additions & 2 deletions Projects/App/Sources/Coordinator/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

import UIKit

import PresentationDependency
import MainPresentation
import FeatureDependency
import MainFeature

final class AppCoordinator: Coordinator {
var childCoordinators: [Coordinator] = []
Expand Down
17 changes: 17 additions & 0 deletions Projects/Feature/AlarmFeature/Demo/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import UIKit

@main
final class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}

// MARK: UISceneSession Lifecycle

func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}

func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
}
}
39 changes: 39 additions & 0 deletions Projects/Feature/AlarmFeature/Demo/SceneDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import UIKit

import AlarmFeature

final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?

func scene(
_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions
) {
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: windowScene)
let navigationController = UINavigationController()
window?.rootViewController = navigationController
window?.makeKeyAndVisible()

let alarmCoordinator = DefaultAlarmCoordinator(
navigationController: navigationController
)
alarmCoordinator.start()
}

func sceneDidDisconnect(_ scene: UIScene) {
}

func sceneDidBecomeActive(_ scene: UIScene) {
}

func sceneWillResignActive(_ scene: UIScene) {
}

func sceneWillEnterForeground(_ scene: UIScene) {
}

func sceneDidEnterBackground(_ scene: UIScene) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import ProjectDescription
import ProjectDescriptionHelpers

let project = Project.makeProject(
name: "Home",
moduleType: .presentation,
name: "AlarmFeature",
moduleType: .feature,
dependencies: [
.feature
.featureDependency
]
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

import PresentationDependency
import FeatureDependency

public protocol AlarmCoordinator: Coordinator {
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import UIKit

import PresentationDependency
import FeatureDependency

public final class DefaultAlarmCoordinator: AlarmCoordinator {
public var childCoordinators: [Coordinator] = []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

import Domain
import PresentationDependency
import FeatureDependency

import RxSwift

Expand Down
17 changes: 17 additions & 0 deletions Projects/Feature/BusStopFeature/Demo/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import UIKit

@main
final class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}

// MARK: UISceneSession Lifecycle

func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}

func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
}
}
39 changes: 39 additions & 0 deletions Projects/Feature/BusStopFeature/Demo/SceneDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import UIKit

import BusStopFeature

final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?

func scene(
_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions
) {
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: windowScene)
let navigationController = UINavigationController()
window?.rootViewController = navigationController
window?.makeKeyAndVisible()

let busstopCoordinator = DefaultBusStopCoordinator(
navigationController: navigationController
)
busstopCoordinator.start()
}

func sceneDidDisconnect(_ scene: UIScene) {
}

func sceneDidBecomeActive(_ scene: UIScene) {
}

func sceneWillResignActive(_ scene: UIScene) {
}

func sceneWillEnterForeground(_ scene: UIScene) {
}

func sceneDidEnterBackground(_ scene: UIScene) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import ProjectDescription
import ProjectDescriptionHelpers

let project = Project.makeProject(
name: "Settings",
moduleType: .presentation,
name: "BusStopFeature",
moduleType: .feature,
dependencies: [
.presentationDependency
.featureDependency
]
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Foundation

import FeatureDependency

public protocol BusStopCoordinator: Coordinator {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import UIKit

import FeatureDependency

public final class DefaultBusStopCoordinator: BusStopCoordinator {
public var childCoordinators: [Coordinator] = []
public var navigationController: UINavigationController

public init(navigationController: UINavigationController) {
self.navigationController = navigationController
}

public func start() {
let busstopViewController = BusStopViewController(
viewModel: BusStopViewModel()
)
navigationController.setViewControllers(
[busstopViewController],
animated: false
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import UIKit

import RxSwift

public final class BusStopViewController: UIViewController {
private let viewModel: BusStopViewModel

public init(viewModel: BusStopViewModel) {
self.viewModel = viewModel
super.init(nibName: nil, bundle: nil)
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

public override func viewDidLoad() {
super.viewDidLoad()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import Foundation

import Domain
import FeatureDependency

import RxSwift

public final class BusStopViewModel: ViewModel {
private let disposeBag = DisposeBag()

public init() {
}

public func transform(input: Input) -> Output {
let output = Output()
return output
}
}

extension BusStopViewModel {
public struct Input {
}

public struct Output {
}
}
17 changes: 17 additions & 0 deletions Projects/Feature/HomeFeature/Demo/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import UIKit

@main
final class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}

// MARK: UISceneSession Lifecycle

func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}

func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
}
}
39 changes: 39 additions & 0 deletions Projects/Feature/HomeFeature/Demo/SceneDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import UIKit

import HomeFeature

final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?

func scene(
_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions
) {
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: windowScene)
let navigationController = UINavigationController()
window?.rootViewController = navigationController
window?.makeKeyAndVisible()

let homeCoordinator = DefaultHomeCoordinator(
navigationController: navigationController
)
homeCoordinator.start()
}

func sceneDidDisconnect(_ scene: UIScene) {
}

func sceneDidBecomeActive(_ scene: UIScene) {
}

func sceneWillResignActive(_ scene: UIScene) {
}

func sceneWillEnterForeground(_ scene: UIScene) {
}

func sceneDidEnterBackground(_ scene: UIScene) {
}
}
Loading

0 comments on commit cce2f60

Please sign in to comment.