-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xcode11 exhibits warnings if you bind in viewDidLoad #331
Comments
Can confirm. This is a warning that was introduced in Xcode 11 when views are laid out before the viewController is added to the view hierarchy. The warning in the console is this:
Adding the symbolic breakpoint breaks on DelegateProxyType line 329. The workaround is to bind your dataSource after the view was added to the view hierarchy. In a Since the |
This isn't even the worst aspect. You can visually see the UI change if your labels have placeholder values from a storyboard, etc. It's just way too late in the lifecycle to do this. |
Bump. I got the same issue. Any update ? 😄 |
In case you don't want to manage the Disposable manually, as you would lose, for example, the position in your tableView if you are binding to it. You could use a way to execute this only once. For now, and with some time pressure, I have come to use:
Not proud of it ...but it's a way to circumvent the issue with minimal changes for now until it's fixed in the library. Another way, cleaner, but not exactly clear as to how robust can it be, is to place inside the viewDidLoad() a call to setupRX() using an async block:
The other is to ignore the warning... but ...that doesn't seem right. |
Hey guys, any update on this? |
This pull request fixes this issue: ReactiveX/RxSwift#2076. |
Any idea when the next RxSwift release is coming out? :) |
in viewDidLoad or loadView func where you bind dataSource,delay a little while then do the bind task. the waring goes away,but I don`t think this a good way. Observable<Int>.timer(RxTimeInterval.milliseconds(10), scheduler: MainScheduler.instance).subscribe(onNext:{ e in
self.itemsSub.bind(to: self.addressTabelView.rx.items(dataSource: dataSource)).disposed(by: self.disposeBag)
self.itemsSub.onNext(self.dataList)
}).disposed(by: disposeBag) |
same issue for me. I am using RxFeedback:
i tried here to replace my data
|
Has anyone found the decent fix since? None of the fixes above satisfied my needs. |
I have been encountering this issue and believe I may have a fix. By setting a symbolic breakpoint for UITableViewAlertForLayoutOutsideViewHierarchy I determined the following call to layoutIfNeeded in DelegateProxyType was being called before the tableView is added to window:
The check for window resolves the error but I am uncertain if this modification has any other ramifications. Also, this is checking that the object is UITableView, should we consider this for all UIViews? |
Since Xcode11 we're seeing the warnings that were addressed in #75 return. The example project exhibits this warning also if you tap the
Customization using table view delegate
in the example app. Obviously this happens a lot more in a large application with lots of screens.It's not clear to me if this is a UIKit bug or something that needs addressing in RxDatasources. It feels like the former as I can't imagine how the toolkit can complain that a view isn't in the hierarchy in viewDidLoad but I wanted to log something to track the issue as this beta season develops.
The text was updated successfully, but these errors were encountered: