nathantannar4 / InputBarAccessoryView

A simple and easily customizable InputAccessoryView for making powerful input bars with autocomplete and attachments
MIT License
1.17k stars 229 forks source link

Sometime placeholder and subviews are not loaded while pushing viewcontroller #184

Closed mlight3 closed 2 years ago

mlight3 commented 3 years ago

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

mlight3 commented 3 years ago

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.

mlight3 commented 3 years ago

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.

nathantannar4 commented 2 years ago

This issue has become stale/outdated. Please re-open if desired.