Skip to content

Peter1119/SwiftUI-MVI-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftUI-MVI-Template

사전 작업

공통 모듈에 해당 코드를 추가해주세요.

import Foundation
import Combine

public final class MVIContainer<Intent, Model>: ObservableObject {
    public let intent: Intent
    public var model: Model
    
    private var cancellable: Set<AnyCancellable> = []
    
    public init(
        intent: Intent,
        model: Model,
        modelChangePublisher: ObjectWillChangePublisher
    ) {
        self.intent = intent
        self.model = model
        
        modelChangePublisher
            .receive(on: RunLoop.main)
            .sink(receiveValue: objectWillChange.send)
            .store(in: &cancellable)
    }
}

설치 방법

SwiftUI+MVI 템플릿입니다.

  1. 해당 repository 설치
  2. 터미널에서 저장된 파일 경로로 이동
  3. ./install-mvi-template.sh

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages