This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DisplayCellNode: ASCellNode { | |
// UI | |
let buttonNode = ASButtonNode() | |
// Props | |
weak var interactor: InteractorLogics! | |
private var presenter: DisplayCellPresenter = .init() | |
override func didLoad() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestViewController { | |
let userInputView = InputView() | |
let displayOutputView: OutputView() | |
func bind() { | |
let state = Presenter.shared.state(type: OutputViewState.self, id: 1) | |
state.map { $0.title }.bind(to: displayOutputView.rx.title).disposed(by: bag) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ReactiveTestCellNode: ASCellNode { | |
public var viewState: ActionRelay<State> = .init() | |
func state() { | |
viewState.map { $0.title } | |
.distinguishUntilChanged() | |
.bind(to: titleNode.rx.title, setNeedsLayout: self) | |
.disposed(by: disposeBag) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol AnimalFeedInputLogics { | |
// 피드 메커니즘에 대한 비즈니스 로직만 수행할 수 있게 뷰컨으로 부터 이벤트를 받는 로직 | |
var loadAnimalItem: PublishRelay<NextPage> { get } // Load more animation cell items | |
} | |
protocol AnimalCatCellInputLogics { | |
// 오직 고양이 셀로 부터 이벤트를 받는 로직 | |
var didTapFollow: PublishRelay<Int> { get } // Int: Cat identifier | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Cell: ASCellNode { | |
let messageCountNode = ASButtonNode() | |
let likeCountNode = ASButtonNode() | |
func engageAreaLayoutSpec() -> ASLayoutSpec { | |
let stackLayout = ASStackLayoutSpec(children: [message....like]) | |
return ASInsetLayoutSpec(insets: .init(top: 0, left: .inf, bottom: 0, right: 0, child: stackLayout) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CellNode: ASCellNode { | |
let contentNode = ASDisplayNode() | |
override init() { | |
super.init() | |
self.ASM = true | |
self.contentNode.ASM = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Interactor의 input과 output에 대한 RxTest진행 | |
어떠한 Request 이벤트 발생시 기대하는 Response 이벤트를 받는지? | |
Worker는 Stub으로 생성하여 Interactor에 주입 | |
*/ | |
class InteractorTests: XCTestCase { | |
var interactor: Interactor! | |
var disposeBag: DisposeBag! | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MonkeyModel { | |
struct Request { | |
} | |
struct Response { | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol MonkeyInteractorLogic: class { | |
var request: PublishRelay<MonkeyModel.Request> { get set } | |
} | |
class MonkeyInteractor: MonkeyInteractorLogic { | |
var presenter: MonkeyPresenterLogic? { | |
get { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Interactor | |
import UIKit | |
import RxSwift | |
import RxCocoa | |
protocol UserInteractorInputLogic { | |
var input: PublishRelay<UserModels.Model.Request> { get } | |
} |