Git Product home page Git Product logo

growingtextview's Introduction

GrowingTextView

Version License Platform Language Language Language Language

Requirements

iOS 8.0 or above

Installation

CocoaPods

GrowingTextView is available through CocoaPods. To install it, simply add the following line to your Podfile:

Swift 5.0

pod 'GrowingTextView', '0.7.2'

Swift 4.2

pod 'GrowingTextView', '0.6.1'

Swift 4.1

pod 'GrowingTextView', '~> 0.5'

Swift 3

pod 'GrowingTextView', '~> 0.4'

Swift 2.3 (Stopped update since Sep 2016)

pod 'GrowingTextView', :git => 'https://github.com/KennethTsang/GrowingTextView.git', :branch => 'swift2'

Carthage

GrowingTextView is also available through Carthage. To install it, add the following line to your Cartfile:

Swift 5.0

github "KennethTsang/GrowingTextView" ~> 0.7

Swift 4.2

github "KennethTsang/GrowingTextView" ~> 0.6

Swift 4.1

github "KennethTsang/GrowingTextView" ~> 0.5

Swift 3

github "KennethTsang/GrowingTextView" ~> 0.4

Swift 2.3 (Stopped update since Sep 2016)

github "KennethTsang/GrowingTextView" "swift2"

Manually

Copy GrowingTextView.swift into your project.

Usage

Example

GrowingTextview is just a textview, download the example to see how to use it as a input toolbar like other instant messaging apps.

Using GrowingTextview programmatically

let textView = GrowingTextView()
textView.delegate = self
addSubview(textView)

Using GrowingTextview in Storyboard

  1. Drag a TextView into Storyboard.
  2. Set class to "GrowingTextView".
  3. Set delegate to it's view controller.
automaticallyAdjustsScrollViewInsets

Sometime the view controller may incorrectly adjust the inset of textview automatically. To avoid this, set automaticallyAdjustsScrollViewInsets to false

override func viewDidLoad() {
	super.viewDidLoad()
	automaticallyAdjustsScrollViewInsets = false
}

Customization

Parameter Type Description Default
maxLength Int Maximum text length. Exceeded text will be trimmed. 0 means no limit. 0
trimWhiteSpaceWhenEndEditing Bool Trim white space and new line characters when textview did end editing. true
placeholder String? Placeholder text. nil
placeholderColor UIColor Placeholder text color. UIColor(white: 0.8, alpha: 1.0)
attributedPlaceholder NSAttributedString? Attributed Placeholder text. nil
minHeight CGFloat Minimum height of textview. 0.0
maxHeight CGFloat Maximum height of textview. 0.0

Examples

textView.maxLength = 140
textView.trimWhiteSpaceWhenEndEditing = false
textView.placeholder = "Say something..."
textView.placeholderColor = UIColor(white: 0.8, alpha: 1.0)
textView.minHeight = 25.0
textView.maxHeight = 70.0
textView.backgroundColor = UIColor.whiteColor()
textView.layer.cornerRadius = 4.0

Animation

  1. Adopt GrowingTextViewDelegate instead of UITextViewDelegate.
  2. Implement textViewDidChangeHeight.
  3. Call layoutIfNeeded() on superview inside the animation.
class ViewController: UIViewController, GrowingTextViewDelegate {
	func textViewDidChangeHeight(_ textView: GrowingTextView, height: CGFloat) {
	   UIView.animate(withDuration: 0.2) {
	       self.view.layoutIfNeeded()
	   }
	}
}

Delegate

GrowingTextViewDelegate is inherited from UITextViewDelegate. You may use it's delegate function as a normal UITextView.

class ViewController: UIViewController, GrowingTextViewDelegate {
    func textViewDidChange(_ textView: UITextView) {
    	...
    }
    func textViewDidEndEditing(_ textView: UITextView) {
    	...
    }
}

Check out UITextViewDelegate here: https://developer.apple.com/reference/uikit/uitextviewdelegate

Author

Kenneth Tsang, [email protected]

License

GrowingTextView is available under the MIT license. See the LICENSE file for more info.

growingtextview's People

Contributors

alexsteinerde avatar bchrobot avatar cp-satish-v avatar kennethtsang avatar levidahl avatar nerosnm avatar netizen01 avatar phpmaple avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

growingtextview's Issues

Using non-default textContainerInset value, initial text is misplaced

Thanks for fixing the previous issue so quickly! Here is another one...

In GrowingTextView-Example, Example2.viewDidLoad(), add this line:
textView.textContainerInset = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)

See the first screen shot for the result. The placeholder text is closer to the top than bottom, it is expected to be centered.

The second screenshot shows the results after typing text until the line wraps, then backspacing to clear all text. The placeholder location is correct.

screen shot 2017-10-31 at 9 43 11 am

screen shot 2017-10-31 at 9 43 24 am

Working with Tableview

I have tried it with the controller where it is below a table view. Upon showing keyboard it pushes the table view behind the navbar by some offset and you cannot scroll to that area.

Example 2 & 3 failed under iOS 11

Built directly on top of example storyboard, example 1 runs fine, but both 2 & 3 failed.

Both would complain of height constraints missing. Yet after resolving conflicts by adding missing constraints, textView wouldn't grow as expected. Wondering whether we need to do something more for iOS 11.

Swift 3,Xcode 8 seems no work anymore

i temp change here,and it seems work:

// Limit the length of text
func textDidChange(notification: NSNotification) {
    if notification.object === self {
        if maxLength > 0 && text.characters.count > maxLength {
            let endIndex = text.startIndex.advancedBy(maxLength)
            text = text.substringToIndex(endIndex)
            undoManager?.removeAllActions()
        }
        setNeedsLayout() //For Xcode 8,works
    }
}

Ambiguous use of 'attributedPlaceholder'

I want to add attributed placeholder to textView which if type GrowingTextView. But it shows error "Ambiguous use of "attributedPlaceholder".
Screenshot 2020-08-11 at 5 13 15 PM
I guess the name of the placeholder attribute should be changed to something different as UItextView already has placeholder attribute.

Constraint Error Storyboard Xcode 9.3

Hello,

I tried with GrowingTextView examples and working as expected, but if try by creating a new project with Xcode 9.3 and i apply same constraint giving an error Input Toolbar (need constraint for: Y position or Height).
screen shot 2018-04-30 at 8 35 23 am
Please have a look on it. Appreciate your work.
Thanks,
Narendra.

Not animating at line change

Hi
I put it in inputAccessoryView
When I change line by return key
It is not animating as UICollectionView animate

And one more thing, I run the demo App
see below screen
TextView size is not as expected
iOS version = 10.3.2
Device = iPhone 6 Plus
img_3364

Kindly help me
Thanks

Text overrides placeholder Swift 3

Hey,

First of all, many many thanks for your contribution to this pod. It works amazing ;)

I have a case, when I need to EDIT account description, so in edit case, I have to fill description, but it overrides placeholder text.
screen shot 2017-02-28 at 10 49 50 am

Any idea how to solve this?

//>> Set textview properties
txvBio.maxLength = 250
txvBio.placeHolder = "Short bio (up to 250 characters)"

if isEditingAccount {
self.txvBio.text = curAccount.descriptionDetails
}

If self.txvBio.placeHolder = nil then when delete all text, placeholder no longer appear.

Any ideas ?

Thanks in advance!

Andy

Use inside UITableViewCell

Hello, thanks for the great library!

I'm trying to use it inside UITableViewCell with all edges pinned to edges of cell, so tableviewcell should grow height with textview size change.
I've adopted self sizing textview, as described here
http://candycode.io/self-sizing-uitextview-in-a-uitableview-using-auto-layout-like-reminders-app/

While it works fine with regular UITextView, when I change it to GrowingTextView - I constantly receive following error with constraints (it seems GrowingTextView tries to update height costraint before it should do so):

[LayoutConstraints] Unable to simultaneously satisfy constraints.
	Probably at least one of the constraints in the following list is one you don't want. 
	Try this: 
		(1) look at each constraint and try to figure out which you don't expect; 
		(2) find the code that added the unwanted constraint or constraints and fix it. 
(
    "<NSLayoutConstraint:0x60000009da10 UILabel:0x7fa954e23b00'\U0421\U043e\U0445\U0440\U0430\U043d\U0438\U0442\U044c \U0432 \U0448\U0430\U0431\U043b\U043e\U043d\U044b'.height == 30   (active)>",
    "<NSLayoutConstraint:0x61000009f1d0 V:[UILabel:0x7fa954e23b00'\U0421\U043e\U0445\U0440\U0430\U043d\U0438\U0442\U044c \U0432 \U0448\U0430\U0431\U043b\U043e\U043d\U044b']-(7)-|   (active, names: '|':UITableViewCellContentView:0x7fa954e224c0 )>",
    "<NSLayoutConstraint:0x61000009e0a0 V:|-(7)-[UILabel:0x7fa954e23b00'\U0421\U043e\U0445\U0440\U0430\U043d\U0438\U0442\U044c \U0432 \U0448\U0430\U0431\U043b\U043e\U043d\U044b']   (active, names: '|':UITableViewCellContentView:0x7fa954e224c0 )>",
    "<NSLayoutConstraint:0x61800009afe0 'UIView-Encapsulated-Layout-Height' UITableViewCellContentView:0x7fa954e224c0.height == 43.5   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x60000009da10 UILabel:0x7fa954e23b00'Сохранить в шаблоны'.height == 30   (active)>

Need to add support for paste image handling like whatsapp input field

Hi there

Just noticed that your code do not support paste image to input field is used in messaging app.
Like in whatsapp copy image from any place (check in iphone) and try long press on input field of any chat screen, paste option will appear and on selecting that.. it will allow you to paste, image copied will be shown in other view..

for such handling in you code i modified the class ""

added two new delegates and two methods

Delegates:

@objc optional func textViewPasteImage(_ pastedImage:UIImage)
   @objc optional func textViewPasteText(_ pastedText:String)

methods

override open func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
        
        if (action == #selector(paste(_:))) {
            return true
        }
        else if self.text.characters.count > 0 {
            if (action == #selector(select(_:)) || action == #selector(selectAll(_:)) || action == #selector(cut(_:)))
            {
                return true
            }
        }
        
        return false
    }
    
    override open func paste(_ sender: Any?) {
        //
        if (UIPasteboard.general.string != nil) {
            
            if let delegate = delegate as? GrowingTextViewDelegate {
                delegate.textViewPasteText!(UIPasteboard.general.string!)
            }
        }
        else if UIPasteboard.general.image != nil {
            
            if let delegate = delegate as? GrowingTextViewDelegate {
                    delegate.textViewPasteImage!(UIPasteboard.general.image!)
            }
        }
    }

These might not be a perfect solution.... i request please can you add such type for handling
to you code also...

its not working

i set it as a GrowingTextView but the height is not changing dynamically textview just has the default function....

NSRangeException for multiple GrowingTextView

I have a table view and each cell has a UITextView. After I changed the UITextView to GrowingTextView, I got this exception when I have several cells in the table:

Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 6 beyond bounds [0 .. 5]'
*** First throw call stack:
(0x181be9d04 0x180e38528 0x181b82bd4 0x181ab29a0 0x18b33b774 0x18b33c3b8 0x18b0f1508 0x18b01e304 0x185bd7ec8 0x185bdbfa8 0x185b4aa98 0x185b70eb4 0x185b71cf4 0x181b91848 0x181b8f200 0x181b8f7bc 0x181aaffb8 0x183947f84 0x18b0842f4 0x1010f2678 0x1815d256c)
libc++abi.dylib: terminating with uncaught exception of type NSException

The first throw call stack is not very helpful because it doesn't specify which line of code is causing the issue. But I don't have this exception under the same circumstances if I just use the native UITextView.

Failed to Render Issue

I just installed via CocoaPods and when I open .xcworkspace I get the following error:

.../Base.lproj/Main.storyboard: error: IB Designables: Failed to render and update auto layout status for TaskListTableViewController (Ywj-qX-LYh): dlopen(GrowingTextView.framework, 1): no suitable image found.  Did find:
	GrowingTextView.framework: required code signature missing for 'GrowingTextView.framework'

I am unable to proceed.

App crashed on XCode 11.2

I have app crashed by using this library, the reason is "Could not instantiate class named _UITextLayoutView because no class named _UITextLayoutView was found; the class needs to be defined in source code or linked in from a library (ensure the class is part of the correct target)". If there is any body have same issue please let me know how to resolved this issue, thanks

Ambiguous use of 'attributedPlaceholder'

I want to assign an attributedPlaceholder to growingTextView (here : replyTextView) but it keeps on giving the error :
"Ambiguous use of 'attributedPlaceholder".
`if let userName = UserDefaults.standard.value(forKey: "username") as? String {
let text = "Hi (userName) start posting your opinion here."

        let attrStringOfContent : NSMutableAttributedString = NSMutableAttributedString(string: text)

        let rangeOfContent = (text as NSString).range(of: userName, options: .caseInsensitive)

        attrStringOfContent.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor(hex:  "4A5667"), range: rangeOfContent)

attrStringOfContent.addAttribute(NSAttributedString.Key.font, value: UIFont.boldSystemFont(ofSize: 16), range: rangeOfContent)

        replyTextView.attributedPlaceholder = attrStringOfContent
        }`

Not Compatible with Swift 4.2

When I update pod with pod 'GrowingTextView', '~> 0.6' it gives me error like below.

screen shot 2018-09-22 at 2 15 46 pm

How to fix this?
Thanks in advance.

Top and bottom insets sometimes appear to be incorrect.

Using the sample app, when the GrowingTextView expands from one line to two lines, there is way too much padding underneath the text, and way too little above it. If you keep typing and expand to three lines, the padding is still off, but not as badly. What is really interesting though is that if you backspace back to two lines, the padding is perfect. See attached screenshots.

My initial thought was that this had to do with the UITextView.textContainerInset, or setting the scroll position. However, if you use Xcode to Debug View Hierarchy you can see what is going on. The TextView has a subview of type _UITextContainerView, and that is obviously offset by about 10 pixels above where it should be. However, using the inspector, that view claims that its frame is at 0,0.

Unfortunately I have no idea how to fix this -- it seems like an iOS bug. I am seeing it building with Xcode 9 on iOS 11 and iOS 10 devices.

screen shot 2017-10-27 at 2 01 04 pm
screen shot 2017-10-27 at 2 02 59 pm

EXC_BAD_ACCESS when setting properties on GrowingTextView referenced from Storyboard (IBOutlet)

Code looks like this:

import UIKit
import GrowingTextView

class CommentsViewController: UIViewController {
    @IBOutlet var commentTextView: GrowingTextView!
    
    // MARK:- View lifecycle
    override func viewDidLoad() {
        super.viewDidLoad()
        
        customizeCommentTextView()
    }
    
    func customizeCommentTextView() {
        commentTextView.maxLength = 255
        commentTextView.trimWhiteSpaceWhenEndEditing = true
        commentTextView.minHeight = 40.0
        commentTextView.delegate = self
    }
}

when trying to run any of the lines inside customizeCommentTextView() it gives me Thread 1: EXC_BAD_ACCESS (code=257, address=0x1d4474082).

Any idea what might be happening? I followed the README instructions for Storyboard usage and I am using Carthage 0.29.0 to install GrowingTextView 0.5.

Thanks!

ReadMe says Swift 5 Podspec sets Swift 4

It's mentioned in Readme.md file that for Swift 5 you need to use 0.7 version. But if i use that version. It's settings still shows Swift 4 as language and compiler throws error that Swift 5 conversion is available

Subclassing

Hello,

First off, awesome class. I've been finding it very useful.

I had a question about subclassing. I am having a hard time figuring out how to subclass GrowingTextView. The designated initializer is to init?(coder aDecoder: NSCoder) but I'm not using the class within a xib.

I was thinking that perhaps you could make commonInit a public class and that could be overwritten. Otherwise I'm not sure if there is a way to subclass without using a coder. Any suggestions would be appreciated.

Thanks!

Toolbar remains fixed while dismissing keyboard interactively

If you add a scroll view into the view and set the keyboard dismissal behavior to interactive, when you drag down starting above the toolbar containing the text view, it remains fixed in place while the keyboard is pulled down interactively.

not work GrowingTextViewDelegate

I change this code and reemplace this

` @objc func textDidChange(notification: Notification) {
if let sender = notification.object as? GrowingTextView, sender == self {
if maxLength > 0 && text.count > maxLength {
let endIndex = text.index(text.startIndex, offsetBy: maxLength)
text = String(text[..<endIndex])
undoManager?.removeAllActions()
}

     -->     setNeedsLayout() /// with this line work
   --->   //  setNeedsDisplay() // remove this line
    }
}`

Scroll to correct position

This function should not scroll to the end or to the top. It should scroll to the cursor position.

I added a workaround for myself:

func textViewDidChangeHeight(_ textView: GrowingTextView, height: CGFloat) {
    UIView.setAnimationsEnabled(false)
    let caret = tableView.convert(textView.caretRect(for: textView.selectedTextRange!.start), from: textView)
    let keyboardTopBorder = textView.bounds.size.height - tableView.frame.width
    if caret.origin.y > keyboardTopBorder && textView.isFirstResponder {
        tableView.scrollRectToVisible(caret, animated: true)
    }
    UIView.setAnimationsEnabled(true)
}

Autolayout Failed to Render

error: IB Designables: Failed to render and update auto layout status for UIView (i5M-Pr-FkT): dlopen(GrowingTextView.framework, 1): no suitable image found. Did find:
GrowingTextView.framework: required code signature missing for 'GrowingTextView.framework'

getting this error for days and nothing could fix it , any idea ?

Adjusting Text View Inset

Having an issue when wanting to adjust the inset of the text. I'd like to add a padding to the inside so the text starts further away from the edge of the text view. Currently the text indicator is too close to edge.

Current
Screen Shot 2019-04-01 at 9 48 35 PM

Trying to change the content inset gives this outcome:

messageField.textContainerInset = UIEdgeInsets(top: 0, left: 0.5, bottom: 0, right: 0)

Screen Shot 2019-04-01 at 9 43 02 PM

Ideas?

Not able to use globe button to change keyboard

In my case, I have chat screen which supports arabic and english language and when I am using your lib, it doesn't showing globe button to change keyboard. Is there some settings to change? Also can't paste arabic or emoji in textview.

download

Dynamic Text View - Lines of text shifting up

I have some sample code below where I try to mimic the dynamic text view calculation like your code. My question is how is the top inset addressed with respect to the text container? When I get to about the second line, my first line shifts up pretty much to very edge of the top frame of Text View. I want the text to stay center to the line height.

import UIKit

class ViewController: UIViewController, UITextViewDelegate {

    @IBOutlet weak var textView: UITextView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.textView.delegate = self
        self.textView.backgroundColor = .lightGray
    }
    
    func textViewDidChange(_ textView: UITextView) {
        self.calculateSize()
    }

    func calculateSize() {
        let fixedWidth = textView.frame.size.width
        textView.sizeThatFits(CGSize(width: fixedWidth, height: CGFloat.greatestFiniteMagnitude))
        let newSize = textView.sizeThatFits(CGSize(width: fixedWidth, height: CGFloat.greatestFiniteMagnitude))
        var newFrame = textView.frame
        newFrame.size = CGSize(width: max(newSize.width, fixedWidth), height: newSize.height)
        textView.frame = newFrame
    }
}

Would not work unless I added setNeedsLayout

I've been using your library for years without problems. Recently I had to resume a project which I haven't touched in several months, so I'm not sure if this is now an iOS 13.3 issue or what, but the textview would just not work.

Until I went into the soucecode of the GrowingTextView and added setNeedsLayout here:

    // Limit the length of text
    @objc func textDidChange(notification: Notification) {
        if let sender = notification.object as? GrowingTextView, sender == self {
            if maxLength > 0 && text.count > maxLength {
                let endIndex = text.index(text.startIndex, offsetBy: maxLength)
                text = String(text[..<endIndex])
                undoManager?.removeAllActions()
            }
            setNeedsDisplay()
            setNeedsLayout() <-- HERE
        }
    }

Then everything works as expected. Is this normal? If not, why could it be happening?

[Bug] Crashes every time TextView grows if you don't declare textViewDidChangeHeight from the Delegate

If you don't define the textViewDidChangeHeight "optional" method from the delegate, it crashes. So i don't actually need that method from the delegate. So for now, i'm calling the method, but leave it empty.

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Vilger.MessageViewController textViewDidChangeHeight:height:]: unrecognized selector sent to instance 0x7fc978d23720'
*** First throw call stack:
(
0 CoreFoundation 0x0000000109357d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000108db921e objc_exception_throw + 48
2 CoreFoundation 0x00000001093c7f04 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00000001092dce1e forwarding + 526
4 CoreFoundation 0x00000001092dcb88 _CF_forwarding_prep_0 + 120
5 GrowingTextView 0x000000010574bcf6 TFC15GrowingTextView15GrowingTextView14layoutSubviewsfT_T + 1958
6 GrowingTextView 0x000000010574bf62 TToFC15GrowingTextView15GrowingTextView14layoutSubviewsfT_T + 34
7 UIKit 0x0000000106ca0ab8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1237
8 QuartzCore 0x0000000105d5dbf8 -[CALayer layoutSublayers] + 146
9 QuartzCore 0x0000000105d51440 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
10 QuartzCore 0x0000000105d512be _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
11 QuartzCore 0x0000000105cdf318 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 280
12 QuartzCore 0x0000000105d0c3ff _ZN2CA11Transaction6commitEv + 475
13 QuartzCore 0x0000000105c677f7 _ZN2CA7Display11DisplayLink14dispatch_itemsEyyy + 611
14 CoreFoundation 0x00000001092e9db4 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 20
15 CoreFoundation 0x00000001092e9a43 __CFRunLoopDoTimer + 1075
16 CoreFoundation 0x00000001092e95ca __CFRunLoopDoTimers + 250
17 CoreFoundation 0x00000001092e12f1 __CFRunLoopRun + 2065
18 CoreFoundation 0x00000001092e0884 CFRunLoopRunSpecific + 420
19 GraphicsServices 0x000000010c4fea6f GSEventRunModal + 161
20 UIKit 0x0000000106bdbc68 UIApplicationMain + 159
21 Vilger 0x000000010363e58f main + 111
22 libdyld.dylib 0x000000010aee568d start + 1
)

Not working on os11 ?

Just copied the source into my project, dropped a textview onto my viewcontroller, changed the class to GrowingTextView and when I run, the keyboard overlays the textview?

So in my case I have a tableview and want to add this at the bottom. I created a view, dropped a textview in it (just as in the example 2). What I don't understand is how this resizes the tableview while the keyboard is open?

Keyboard shown over textView [Translucent false]

Hello,

When we have navigationController?.navigationBar.isTranslucent = false
The keyboard is shown over the textView, textView does not appear for the user to type

Any hint for that?
Thanks

Updating maxHeight should cause layoutSubviews to be called immediately

Hi @KennethTsang! 😄 First off, great job with this library! As the title suggests, I am suggesting that when the maxHeight is updated, that layoutSubviews be called immediately to update the heightConstraint. For my use case, I am working on something where the maxHeight of the text view is constantly changing depending on certain factors within my app.

Line 100 in GrowingTextView.swift will need to be removed because even though the text and width may be the same, the maxHeight may not be.

Let me know what you think! 👍

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.