Skip to content

Commit

Permalink
[Feat] #388 - DailySoptuneMain 인터페이스 및 뷰모델 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
yungu0010 committed Sep 27, 2024
1 parent f64cdcd commit 2e66c3f
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ import Domain

public protocol DailySoptuneFeatureBuildable {
func makeDailySoptuneResultVC() -> DailySoptuneResultViewControllable
func makeDailySoptuneMainVc() -> DailySoptuneMainViewControllable
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// DailySoptuneMainPresentable.swift
// DailySoptuneFeatureInterface
//
// Created by 강윤서 on 9/26/24.
// Copyright © 2024 SOPT-iOS. All rights reserved.
//

import BaseFeatureDependency
import Core

public protocol DailySoptuneMainViewControllable: ViewControllable {}

public protocol DailySoptuneMainCoordinatable {}

public typealias DailySoptuneMainViewModelType = ViewModelType & DailySoptuneMainCoordinatable
public typealias DailySoptuneMainPresentable = (vc: DailySoptuneMainViewControllable, vm: any DailySoptuneMainViewModelType)
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,10 @@ extension DailySoptuneBuilder: DailySoptuneFeatureBuildable {
let dailySoptuneResultVC = DailySoptuneResultVC(viewModel: viewModel)
return dailySoptuneResultVC
}

public func makeDailySoptuneMainVc() -> DailySoptuneMainViewControllable {
let viewModel = DailySoptuneMainViewModel()
let dailySoptuneMainVC = DailySoptuneMainVC(viewModel: viewModel)
return dailySoptuneMainVC
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@ import DSKit
import SnapKit
import Then

public final class DailySoptuneMainVC: UIViewController {
import BaseFeatureDependency

public final class DailySoptuneMainVC: UIViewController, DailySoptuneMainViewControllable {

// MARK: - Properties

public var viewModel: DailySoptuneMainViewModel
private var cancelBag = CancelBag()

// MARK: - UI Components

private let backButton = UIButton().then {
Expand Down Expand Up @@ -46,6 +53,19 @@ public final class DailySoptuneMainVC: UIViewController {
private let checkTodayFortuneButton = AppCustomButton(title: I18N.DailySoptune.checkTodayFortune)
.setFontColor(customFont: DSKitFontFamily.Suit.semiBold.font(size: 18))

// MARK: - Initialization

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

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

// MARK: - View Life Cycle

public override func viewDidLoad() {
super.viewDidLoad()

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// DailySoptuneMainViewModel.swift
// DailySoptuneFeatureInterface
//
// Created by 강윤서 on 9/26/24.
// Copyright © 2024 SOPT-iOS. All rights reserved.
//

import Foundation
import Core

public class DailySoptuneMainViewModel: DailySoptuneMainViewModelType {

// MARK: - Properties

private var cancelBag = CancelBag()

// MARK: - Inputs

public struct Input {
}

// MARK: - Outputs

public struct Output {
}

// MARK: - Initialization

public init() {

}
}

extension DailySoptuneMainViewModel {
public func transform(from input: Input, cancelBag: CancelBag) -> Output {
let output = Output()
return output
}
}

0 comments on commit 2e66c3f

Please sign in to comment.