A workaround solution for the render issue with MessageInputBar#99
Conversation
It seems as though when using a UINavigationController there is an issue with the rendering of an inputAccessoryView. This workaround creates a copy during the animation and then deletes it.
Codecov Report
@@ Coverage Diff @@
## v0.7.0 #99 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 3 3
Lines 77 77
=====================================
Hits 77 77Continue to review full report at Codecov.
|
| required public init?(coder aDecoder: NSCoder) { | ||
| fatalError("init(coder:) has not been implemented") | ||
| super.init(coder: aDecoder) | ||
| setup() |
There was a problem hiding this comment.
@nathantannar4 Is this part of the workaround? There was a problem with unarchiving?
| open var messageInputBar = MessageInputBar() | ||
|
|
||
| open var messageInputBar = MessageInputBar() | ||
| private var messageInputBarCopy: MessageInputBar? |
There was a problem hiding this comment.
Can we add a small comment above this explaning why we have it?
| messageInputBarCopy = messageInputBar.createCopy() | ||
| guard let copy = messageInputBarCopy else { return } | ||
| view.addSubview(copy) | ||
| copy.addConstraints(nil, left: view.leftAnchor, bottom: view.bottomAnchor, right: view.rightAnchor, topConstant: 0, leftConstant: 0, bottomConstant: 0, rightConstant: 0, widthConstant: 0, heightConstant: 0) |
There was a problem hiding this comment.
Mind splitting this up onto multiple lines?
| super.viewDidAppear(animated) | ||
| addKeyboardObservers() | ||
| messageInputBarCopy?.removeFromSuperview() | ||
| messageInputBarCopy = nil |
There was a problem hiding this comment.
Can you put these two things in its own private method removeMessageInputBarCopy()?
SD10
left a comment
There was a problem hiding this comment.
@nathantannar4 If you could just take care of a few nitty things. Mainly I want to add that comment for why we are doing it. One line should suffice
|
@nathantannar4 |
|
Thanks @SD10, sorry I didn't have a chance to get to this yesterday |
It seems as though when using a UINavigationController there is an issue with the rendering of an inputAccessoryView. This workaround creates a copy during the animation and then deletes it.