File tree Expand file tree Collapse file tree
Presentation/BoxOfficeScene Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ final class BoxOfficeViewController: UIViewController {
1111
1212 private let viewModel : BoxOfficeViewModel
1313 private var refreshAction : Observable < Void > = Observable ( ( ) )
14+ private var viewDidLoaded : Observable < Void > = Observable ( ( ) )
1415 private var boxOfficeList : [ BoxOfficeEntity ] = [ ]
1516
1617 init ( viewModel: BoxOfficeViewModel ) {
@@ -106,10 +107,12 @@ final class BoxOfficeViewController: UIViewController {
106107
107108 private func bindViewModel( ) {
108109 let input = BoxOfficeViewModel . Input (
109- viewDidLoad: Observable ( ( ) ) ,
110+ viewDidLoad: viewDidLoaded ,
110111 refreshAction: refreshAction)
111112 let output = viewModel. transform ( input: input)
112113
114+ viewDidLoaded. value = ( )
115+
113116 output. boxOfficeData. subscribe { [ weak self] result in
114117 self ? . boxOfficeList = result
115118 self ? . collectionView. reloadData ( )
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ final class Observable<T> {
2222 }
2323
2424 func subscribe( _ closure: @escaping ( T ) -> Void ) {
25- closure ( value)
2625 self . listener = closure
2726 }
2827}
You can’t perform that action at this time.
0 commit comments