InputBarAccessoryView
InputBarAccessoryView copied to clipboard
Sometime placeholder and subviews are not loaded while pushing viewcontroller
Describe the bug Sometime placeholder and subviews (images) are not loaded while pushing viewcontroller. After pushing viewcontroller completes, placeholder and subviews are loaded correctly.
To Reproduce Push and pop viewcontroller repeatedly with example app
Expected behavior Show placeholder while pushing viewcontroller
Screenshots https://user-images.githubusercontent.com/2208643/103897885-7ac95c80-5137-11eb-8467-09c034bb1953.mp4
Environment
- iPhone 12 Pro
- iOS 14.3
I tested with example app, my own app, and MessageKit demo app.
MessageKit demo app works well only when I call scrollToBottom
after reloading.
Also comparing to my own app, MessageKit uses UICollectionView
instead of UITableView
.
So I changed to UICollectionView
and tested it with this code.
DispatchQueue.main.async {
self.data = ["a", "b", "c"]
self.collectionView.reloadData()
self.collectionView.performBatchUpdates(nil) { [weak self] _ in
}
}
Placeholder and send button are showing very well. But if data is empty, the same thing happens.🧐
And on iOS 13, there is no problem.
Another test with UITableView
func viewDidLoad() {
super.viewDidLoad()
self.data = ["a", "b", .... ]
DispatchQueue.main.async {
self.tableView.scrollToRow(at: IndexPath(row: self.data.count - 1, section: 0), at: .bottom, animated: false)
}
}
If the contentSize is big enough to scroll at first, placeholder is showing very well. If not, same thing happens.
This issue has become stale/outdated. Please re-open if desired.