This repository was archived by the owner on Oct 30, 2018. It is now read-only.
  
  
  
  
  
Description
Description
I want to increase the font of the textView if there are only emojies typed into the textView, and make it small again, when the letter is typed into.  When the textView's font gets small again, the following happens: (Please see attachments)
You can see how Send button and left button are misplaced. Am I missing something to force them to be properly layouted or is this a bug? Have to mention, that when I remove the text, and Send button gets hidden, the left button get's back into the proper place.
Reproducible in:
SlackTextViewController version: 1.9.5
iOS version(s): 10.0.2
Device(s): iPhone 6s
Steps to reproduce:
I have this override function
override func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
        super.textView(textView, shouldChangeTextIn: range, replacementText: text)
        let finalString = (textView.text! as NSString).replacingCharacters(in: range, with: text)
        if finalString.containsOnlyEmoji && finalString.glyphCount <= (UIDevice.current.userInterfaceIdiom == .pad ? 5 : 3) {
            textView.font = UIFont.preferredFont(forTextStyle: .title1, andScale: 1.7)
        } else {
            textView.font = UIFont.preferredFont(forTextStyle: .body)
        }
        return true
    }
 
Attachments
Before:

After:
