Add warnings to MessageInputBar

This commit is contained in:
Nathan Tannar
2019-02-28 22:33:04 -08:00
parent 50ce463f49
commit 6eff119a5e
8 changed files with 61 additions and 18 deletions
@@ -328,10 +328,7 @@ extension AdvancedExampleViewController: MessagesDisplayDelegate {
func configureAccessoryView(_ accessoryView: UIView, for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) {
// Cells are reused, so only add a button here once. For real use you would need to
// ensure any subviews are removed if not needed
// The following code doesn't work properly. Use forEach method instead.
// guard accessoryView.subviews.isEmpty else { return } // not working
accessoryView.subviews.forEach{$0.removeFromSuperview()} // works
accessoryView.subviews.forEach { $0.removeFromSuperview() }
let button = UIButton(type: .infoLight)
button.tintColor = .primaryColor