private var kakaoAddressResults: [KakaoMapAddress] = [] {
didSet {
if kakaoAddressResults.isEmpty {
self.emptyView.isHidden = false
} else {
self.emptyView.isHidden = true
}
}
}
didSet은 Init메소드를 통해 받아온 데이터에 의해 동작하지않고 그 이후에 해당 프로퍼티를 건들었을 경우에만 동작을 하는것이였다
Observable.combineLatest(reactor.state.map{ $0.addressResult }.skip(1), reactor.state.map{ $0.isEmpty })
.observe(on: MainScheduler.instance)
.subscribe(onNext: { [weak self] kakaoAddresses, isEmpty in
guard let `self` = self else { return }
let contentViewController = MapFloatingPanelViewController(floatingType: .searchResult, kakaoAddressResults: kakaoAddresses)
contentViewController.checkEmpty(isEmpty: isEmpty)
self.showFloatingPanel(contentViewController: contentViewController, self.floatingPanelVC)
})
.disposed(by: disposeBag)