-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New InputBarAccessoryView #83
Comments
1 minor issue I found with the current inputAccessoryView is that, if you return too many times that the textView expands above the screen top, you cannot scroll to the top of the message ;) |
Yes that is not in the new one I made. There is a maxHeight variable that can be used to correct that |
Cool - or make it scrollable if beyond screen? |
Once it reaches the maxHeight the textview becomes scrollable. Same way the iMessage app works |
When the textView grows and reaches maxHeight, after sending the message it doesn't go back to the original size. |
Good catch @etoledom . I have isolated the bug to changing the This can be corrected by forcing a temp heightAnchor on the InputTextView. Set the property in setupConstraints(): |
Never mind that has bugs, call override open var intrinsicContentSize: CGSize {
let sizeToFit = textView.sizeThatFits(CGSize(width: textView.bounds.width, height: .greatestFiniteMagnitude))
var heightToFit = sizeToFit.height.rounded() + padding.top + padding.bottom + separatorLine.frame.height + tableViewHeightConstant
if heightToFit >= maxHeight {
textView.isScrollEnabled = true
heightToFit = maxHeight
} else {
textView.isScrollEnabled = false
textView.invalidateIntrinsicContentSize()
}
let size = CGSize(width: bounds.width, height: heightToFit)
if previousIntrinsicContentSize != size {
delegate?.inputBar(self, didChangeIntrinsicContentTo: size)
}
previousIntrinsicContentSize = size
return size
} |
Closing this as it is being implemented in #80 👍 Great work @nathantannar4 🎉 |
A new re-written accessory view to be used to create robust and customizable MessageInputBar's
The text was updated successfully, but these errors were encountered: