A light-weight UITextView subclass that automatically grows and shrinks.

Overview

RSKGrowingTextView Swift 5.1 Swift Package Manager Compatible Cocoapods Compatible Carthage compatible

Sample

A light-weight UITextView subclass that automatically grows and shrinks based on the size of user input and can be constrained by maximum and minimum number of lines.

Installation

Using Swift Package Manager

  1. To add the RSKGrowingTextView package to your Xcode project, select File > Swift Packages > Add Package Dependency and enter the repository URL.

     https://github.com/ruslanskorb/RSKGrowingTextView.git
    

Using CocoaPods

  1. Add the pod RSKGrowingTextView to your Podfile.

    pod 'RSKGrowingTextView'
    
  2. Run pod install from Terminal, then open your app's .xcworkspace file to launch Xcode.

Using Carthage

  1. Add the ruslanskorb/RSKGrowingTextView project to your Cartfile.

    github "ruslanskorb/RSKGrowingTextView"
    
  2. Run carthage update, then follow the additional steps required to add the iOS and/or Mac frameworks into your project.

Demo

Build and run the RSKGrowingTextViewExample project in Xcode to see RSKGrowingTextView in action. Have fun. Figure out hooks for customization.

Contact

Ruslan Skorb

License

This project is available under the Apache License, version 2.0. See the LICENSE file for more info.

Comments
  • Bug placeholder

    Bug placeholder

    version 5.0.1 I opened a issue about placeholder in RSKPlaceholderTextView. I have some misstakes. It is problem with RSKGrowingTextView. My placeholder is 2 row. Ex: "Nhap noi dung nhan xet o day. Toi thieu 50 ki tu." When i wrote 2 row and remove all, my placeholder display 1 row.

    bug 
    opened by hien352911 8
  • Problem with UITableViewCell

    Problem with UITableViewCell

    Hi, I am using this class within a UITableViewCell. Problem is it's not expanding or height is not changing after 3 lines. And TableView's cell height also does not change when I am entering texts. Any hint on how to solve it ?

    question 
    opened by ayon115 8
  • Issue resizing the textView

    Issue resizing the textView

    The textView is not resizing itself. I have tried using inputTextView.superview?.layoutIfNeeded() for forcing it to update height but it isn't.

    My project: https://github.com/chashmeetsingh/susi_iOS/blob/issue89/Susi/Controllers/MainViewController/MainViewController.swift#L141

    https://github.com/chashmeetsingh/susi_iOS/blob/issue89/Susi/Controllers/MainViewController/MainVCMethods.swift#L183

    Please let me know if something wrong with the usage or declaration. thanks! @ruslanskorb

    user bug 
    opened by chashmeetsingh 5
  • Profile.storyboard: error: IB Designables: Failed to render and update auto layout status

    Profile.storyboard: error: IB Designables: Failed to render and update auto layout status

    HI! I got this error in xcode: Profile.storyboard: error: "IB Designables: Failed to render and update auto layout status dlopen(RSKGrowingTextView.framework, 1): Library not loaded: @rpath/RSKPlaceholderTextView.framework/RSKPlaceholderTextView Referenced from: RSKGrowingTextView.framework Reason: image not found"

    It's repeats in different projects. After this error showed my storyboard stay invisible..... Fix it pls! Снимок экрана 2020-04-07 в 19 46 00

    needs more information 
    opened by fury21 4
  • Growing down

    Growing down

    Hello :) Is it possible to let the UITextView growing down and not only up?

    In my case I don't want to place the TextView at the bottom of my view. I want to place it at the top of my view and let it growing down.

    Maybe the screenshot illustrates my issue better: issue

    Best regards, Oliver

    question 
    opened by ohetzendorfer 4
  • Bottom space

    Bottom space

    Hello, I found issue with bottom space after wrote again the 6 lines.

    Steps:

    1. write 6 lines
    2. remove one line
    3. write again one line

    Now the bottom space is bigger than should.

    screenshot 2018-11-27 at 12 51 19 bug 
    opened by mGraczkowskiDigitalforms 3
  • SPM Integration error

    SPM Integration error

    I got error while tying to add library through SPM.

    "the Package.resolved file is most likely severely out-of-date and is preventing correct resolution; delete the resolved file and try again"

    Screen Shot 2020-10-29 at 3 32 04 PM

    needs more information waiting for response 
    opened by AalokParikh 2
  • Bug in keyboard dismissing

    Bug in keyboard dismissing

    I had used RSKGrowingTextView in my project as a chat or comment TextView.

    In this project, I am using IQKeyboardManager //MARK:- IQKeyboardManager IQKeyboardManager.shared.enable = true IQKeyboardManager.shared.shouldShowToolbarPlaceholder = false IQKeyboardManager.shared.shouldResignOnTouchOutside = true IQKeyboardManager.shared.disabledToolbarClasses = [CommentsTabVC.self]

    And I had disabled the toolbar to remove the done button.

    In my case when clicking on anyplace in the screen the keyboard resigned its first responder and the view goes down again. But when clicking on the textView indicator it makes weird behavior.

    I had tried to override the tap gesture by adding the below code:

    @IBOutlet weak var commentTextView: RSKGrowingTextView! commentTextView.addTapGesture { if self.commentTextView.isFirstResponder{ self.commentTextView.resignFirstResponder() }else{ self.commentTextView.becomeFirstResponder() } }

    ezgif com-video-to-gif

    opened by zaidiabbas 2
  • delegate method is not called

    delegate method is not called

    Hi,

    I have added the TextView Programmatically. None of the delegate methods are called. Is there any other way to get the delegate callbacks in Objective-C ?

    Here is the code

    self.containerView = [[UIView alloc] initWithFrame:CGRectMake(0,screenHeight-155, screenWidth, 40)];
            self.grTextView = [[RSKGrowingTextView alloc] initWithFrame:CGRectMake(45, 0, screenWidth-100, 40)];
            self.grTextView.minimumNumberOfLines = 1;
            self.grTextView.maximumNumberOfLines = 4;
            self.grTextView.delegate = self;
            self.grTextView.placeholder = NSLocalizedString(@"write_comment", nil);
            self.grTextView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
    
            [self.view addSubview:self.containerView];
            [self.view bringSubviewToFront:self.containerView];
            [self.containerView addSubview:self.grTextView];
    

    And the delegate callback method. I have added breakpoint but it's not calling

    - (void)growingTextView:(RSKGrowingTextView * _Nonnull)textView willChangeHeightFrom:(CGFloat)growingTextViewHeightBegin to:(CGFloat)growingTextViewHeightEnd {
        
        float diff = (textView.frame.size.height - growingTextViewHeightEnd);
        CGRect r = self.containerView.frame;
        r.size.height -= diff;
        r.origin.y += diff;
        self.containerView.frame = r;
    }
    
    bug 
    opened by rahulvyas 2
  • Update RSKPlaceholderTextView dependency

    Update RSKPlaceholderTextView dependency

    This PR simply updates the podspec dependency to pick up the latest version of RSKPlaceholderTextView instead of being locked at 5.0.0.

    In our project we depend on the RSKGrowingTextView pod but also use RSKPlaceholderTextView. Since the podspec is locked on 5.0.0, we can't use the latest placeholder text view 5.0.1. This PR should address that.

    opened by sroymeetup 2
  • RSK inside UIView

    RSK inside UIView

    screen shot 2019-02-14 at 2 28 26 pm Hi Hope you will be good when I put RSKTV inside a container and container is the input accessory view of UICollectionVIew in that case it is not expanding what could be reason?

    I put In viewDidLoad self.growingTextView.translatesAutoresizingMaskIntoConstraints = false

    See the picture I need something like that I made the IBOutlet of this whole container and this is the inputaccessoryview

    please guide Thanks

    question 
    opened by umair2ooo 2
Releases(6.1.0)
Owner
Ruslan Skorb
"The best way to predict the future is to create it" – Abraham Lincoln. Let's create our future together! Founder & Principal Software Engineer @ R.SK Lab
Ruslan Skorb
A light-weight UITextView subclass that adds support for placeholder.

RSKPlaceholderTextView A light-weight UITextView subclass that adds support for placeholder. Installation Using Swift Package Manager To add the RSKPl

Ruslan Skorb 220 Dec 17, 2022
DGPlaceholderTextView - A light-weight UITextView that supports for placeholder

DGPlaceholderTextView Requirements Installation Usage Properties DGPlaceholderTe

donggyu 5 Jan 26, 2022
ARAutocompleteTextView is a subclass of UITextView that automatically displays text suggestions in real-time

ARAutocompleteTextView is a subclass of UITextView that automatically displays text suggestions in real-time. This is perfect for automatically suggesting the domain as a user types an email address, #hashtag or @alexruperez.

Alex Rupérez 261 Jun 29, 2022
A UITextView subclass that adds support for multiline placeholder written in Swift.

KMPlaceholderTextView A UITextView subclass that adds support for multiline placeholder written in Swift. Usage You can set the value of the placehold

Zhouqi Mo 795 Nov 18, 2022
This project will add a done button on your UITextField and UITextView

This project will add a done button on your UITextField and UITextView

Botla Venkatesh 0 Nov 23, 2021
UITextField and UITextView subclasses with placeholders that change into floating labels when the fields are populated with text.

Deprecated Please use JVFloatLabeledTextField instead or feel free to chime in on an issue if you'd like to take over the repo. RPFloatingPlaceholders

rob phillips 1.1k Jan 5, 2023
Animated UITextField and UITextView replacement for iOS

AnimatedTextInput iOS custom text input component used in the Jobandtalent app. Installation Use cocoapods to install this custom control in your proj

jobandtalent 757 Dec 15, 2022
An UITextView in Swift. Support auto growing, placeholder and length limit.

GrowingTextView Requirements iOS 8.0 or above Installation CocoaPods GrowingTextView is available through CocoaPods. To install it, simply add the fol

Kenneth Tsang 941 Jan 5, 2023
UITextField that automatically formats text to display in the currency format

CurrencyTextField The numbers that the user enters in the field are automatically formatted to display in the dollar amount format. For example, if th

Richa Deshmukh 49 Sep 28, 2022
Animated Subclass of UITextField created with CABasicAnimation and CAShapeLayer

JDAnimatedTextField JDAnimatedTextField is animateable UITextField that can significantly enhance your user's experiences and set your app apart from

Jawad Ali 25 Dec 13, 2022
iOS - Subclass of UITextField to achieve autocompletion for Place Search like Google Places, Uber and Much more apps having maps.

MVAutocompletePlaceSearchTextField iOS - Subclass of UITextField to achieve autocompletion for Place Search like Google Places, Uber and Much more app

Mrugrajsinh Vansadia 68 May 27, 2022
An UITextField subclass to simplify country code's picking. Swift 5.0

Preview Installation NKVPhonePicker is available through CocoaPods. To install it, simply add the following line to your Podfile: pod 'NKVPhonePicker'

Nike Kov 140 Nov 23, 2022
UITextField subclass with floating labels

JVFloatLabeledTextField JVFloatLabeledTextField is the first implementation of a UX pattern that has come to be known the "Float Label Pattern". Due t

Jared Verdi 7.2k Jan 2, 2023
Subclass of UITextField that shows inline suggestions while typing.

AutocompleteField Subclass of UITextField that shows inline suggestions while typing. Plug and play replacement for UITextField. Delimiter support. Pe

Filip Stefansson 663 Dec 6, 2022
UITextfield subclass with autocomplete menu. For iOS.

MLPAutoCompleteTextField "We believe that every tap a user makes drains a tiny bit of their energy and patience. Typing is one of the biggest expendit

Eddy Borja 1.2k Nov 11, 2022
UITextField subclass with autocompletion suggestions list

SearchTextField Overview SearchTextField is a subclass of UITextField, written in Swift that makes really easy the ability to show an autocomplete sug

Alejandro Pasccon 1.1k Dec 28, 2022
UILabel subclass to perform text effects

CharacterText uses NSLayoutManager to position CATextLayers for each glyph in your string. This gives you the power to create some neat text effect using all the attributes of CATextLayer.

null 333 Sep 15, 2022
VKPinCodeView is simple and elegant UI component for input PIN. You can easily customise appearance and get auto fill (OTP) iOS 12 feature right from the box.

Features Variable PIN length Underline, border and custom styles The error status with / without shake animation Resetting the error status manually,

Vladimir Kokhanevich 95 Nov 24, 2022
A Credit Amount and EMI User Interface build in Swift and SwiftUI

App Usage An iPhone application build in swift . Overview Supported on All iPhone Screen Sizes Dynamic Data following MVVM Design Pattern Used Transit

Mohammad Yasir 4 Apr 20, 2022