Fix side effect of inputAccessoryView rendering bug fix

This commit is contained in:
Eduardo Toledo
2017-08-31 12:22:18 +03:00
parent d839400378
commit 73ea751dac
2 changed files with 3 additions and 2 deletions
+3
View File
@@ -49,6 +49,9 @@ open class MessagesCollectionView: UICollectionView {
override public init(frame: CGRect, collectionViewLayout layout: UICollectionViewLayout) {
super.init(frame: frame, collectionViewLayout: layout)
backgroundColor = .white
// https://stackoverflow.com/questions/31049651/uitextview-as-inputaccessoryview-doesnt-render-text-until-after-animation
// Calling this here avoids a side effect where the inputAccessoryView dissapears after tap
snapshotView(afterScreenUpdates: true)
}
required public init?(coder aDecoder: NSCoder) {
-2
View File
@@ -58,8 +58,6 @@ open class MessagesViewController: UIViewController {
registerReusableViews()
setupDelegates()
// https://stackoverflow.com/questions/31049651/uitextview-as-inputaccessoryview-doesnt-render-text-until-after-animation
inputAccessoryView?.snapshotView(afterScreenUpdates: true)
}
override open func viewDidLayoutSubviews() {