I use RxSwift in my project After I called an API in Viewmodel and transferred to ViewController, I took the number of data. Then I want to change the Popup height with the number of data. How can I do it?
I try to use a variable to handle it. But it doesn't work
I init a variable to hold the height of the Popup

Then I set the height for the Popup

Strictly speaking, you have not provided enough code to answer the question, but generally I sure what is happening here is that your code is trying to read the value of
heightOfVCbefore the value has been set by thedo(onNext:)statement.The best solution would likely be to make
heightOfVC(andpopupHeight) conform to the Observable contract. Ideally, you would do this by making themObservable<CGFloat>but you could also useBehaviorSubject<CGFloat>or any of the other types that follow the contract (implement theObservableConvertibleTypeprotocol.)