Skip to content

Commit

Permalink
[IDLE-489] ChattingListFactory구현 및 읜존성 주입
Browse files Browse the repository at this point in the history
  • Loading branch information
J0onYEong committed Nov 5, 2024
1 parent f77741c commit f859ef9
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public enum DeploymentSettings {

/// SceneDelegate를 지원하는 iOS 15이상 버전을 요구합니다.
public static let productName = "Caremeet"
public static let deployment_app_version = "1.1.0"
public static let deployment_app_version = "1.1.1"
public static let deployment_iOS_version = DeploymentTargets.iOS("15.0")
public static let platforms: Set = [Destination.iPad, Destination.iPhone]
public static let workspace_name = "idle_workspace"
Expand Down
11 changes: 11 additions & 0 deletions project/Projects/App/Sources/DIAssembly/PresentationAssembly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
//

import Foundation

import ChattingFeatureInterface
import ChattingFeature
import BaseFeature
import RootFeature

Expand All @@ -15,19 +18,27 @@ import Swinject
public struct PresentationAssembly: Assembly {
public func assemble(container: Container) {

// MARK: Remote config
container.register(RemoteConfigService.self) { _ in
DefaultRemoteConfigService()
}
.inObjectScope(.container)

// MARK: Router
container.register(RouterProtocol.self) { _ in
Router()
}
.inObjectScope(.container)

// MARK: Remote notification
container.register(RemoteNotificationHelper.self) { _ in
DefaultRemoteNotificationHelper()
}
.inObjectScope(.container)

// MARK: Chatting feature
container.register(ChattingListFeatureFactory.self) { _ in
DefaultChattingListFeatureFactory()
}
}
}
2 changes: 1 addition & 1 deletion project/Projects/App/Tests/Empty.swift
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import Foundation
import Testing
4 changes: 3 additions & 1 deletion project/Projects/Data/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ let project = Project(
sources: ["DataTests/**"],
dependencies: [
D.Testing,
D.Data.Repository,
D.Data.DataSource,
],
settings: .settings(
configurations: IdleConfiguration.dataConfigurations
Expand All @@ -83,7 +85,7 @@ let project = Project(
schemes: [
Scheme.makeTestableSchemes(
.target("Repository"),
testableTarget: .target("DataTests"),
testableTarget: .target("Data"),
configNames: [
IdleConfiguration.debugConfigName,
IdleConfiguration.releaseConfigName,
Expand Down
4 changes: 3 additions & 1 deletion project/Projects/Domain/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ let project = Project(

// for test
D.Testing,

D.Domain,
],
settings: .settings(
configurations: IdleConfiguration.domainConfigurations
Expand All @@ -56,7 +58,7 @@ let project = Project(
schemes: [
Scheme.makeTestableSchemes(
.target("Domain"),
testableTarget: .target("DomainTests"),
testableTarget: .target("Domain"),
configNames: [
IdleConfiguration.debugConfigName,
IdleConfiguration.releaseConfigName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

import UIKit

import ChattingFeature
import Core

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

var window: UIWindow?
Expand All @@ -15,12 +18,10 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {

guard let windowScene = scene as? UIWindowScene else { return }

// let vc = ChattingListViewController()
// let vm = ChattingListViewModel()
// vc.bind(viewModel: vm)
let vc = DefaultChattingListFeatureFactory().createModule()

window = UIWindow(windowScene: windowScene)
// window?.rootViewController = vc
window?.rootViewController = vc
window?.makeKeyAndVisible()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// ChattingListFeatureFactory.swift
// Chatting
//
// Created by choijunios on 11/5/24.
//

import UIKit

public protocol ChattingListFeatureFactory {

typealias Module = UIViewController

func createModule() -> Module
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// ChattingListFeatureFactory.swift
// Chatting
//
// Created by choijunios on 11/5/24.
//

import ChattingFeatureInterface
import Core

public class DefaultChattingListFeatureFactory: ChattingListFeatureFactory {

public init() { }

public func createModule() -> Module {

let viewModel: ChattingListViewModel = .init()

//

let viewController: ChattingListViewController = .init()
viewController.bind(viewModel: viewModel)

return viewController
}
}
5 changes: 4 additions & 1 deletion project/Projects/Testing/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ let project = Project(
sources: ["Sources/**"],
dependencies: [

D.Presentation.BaseFeature,

D.Data.Repository,
D.Data.DataSource,

D.Presentation.BaseFeature,
D.Domain,
],
settings: .settings(
base: ["ENABLE_TESTABILITY": "YES"],
Expand Down
Binary file modified project/graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f859ef9

Please sign in to comment.