GrowingTextView | Support auto growing , placeholder and length limit | Chat library

 by   KennethTsang Swift Version: 0.7.2 License: MIT

kandi X-RAY | GrowingTextView Summary

kandi X-RAY | GrowingTextView Summary

GrowingTextView is a Swift library typically used in Messaging, Chat applications. GrowingTextView has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

An UITextView in Swift. Support auto growing, placeholder and length limit.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              GrowingTextView has a medium active ecosystem.
              It has 951 star(s) with 121 fork(s). There are 18 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 20 open issues and 26 have been closed. On average issues are closed in 16 days. There are 3 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of GrowingTextView is 0.7.2

            kandi-Quality Quality

              GrowingTextView has no bugs reported.

            kandi-Security Security

              GrowingTextView has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              GrowingTextView is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              GrowingTextView releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of GrowingTextView
            Get all kandi verified functions for this library.

            GrowingTextView Key Features

            No Key Features are available at this moment for GrowingTextView.

            GrowingTextView Examples and Code Snippets

            No Code Snippets are available at this moment for GrowingTextView.

            Community Discussions

            QUESTION

            Firestore Cocoapod not installing
            Asked 2020-Aug-11 at 17:01

            When I run "pod install" I'm getting the error message

            "[!] Error installing BoringSSL-GRPC [!] /usr/bin/git clone https://github.com/google/boringssl.git /var/folders/4p/459gq24124v89blbhvwjh7hc0000gn/T/d20200811-19278-1druayd --template=

            Cloning into '/var/folders/4p/459gq24124v89blbhvwjh7hc0000gn/T/d20200811-19278-1druayd'... error: RPC failed; curl 18 transfer closed with outstanding read data remaining fatal: the remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed"

            I know that the "Firebase/firestore" is the problem. Why is this?

            Podfile:

            ...

            ANSWER

            Answered 2020-Aug-11 at 17:01

            This is most likely the result of a transient network failure. Please retry.

            Source https://stackoverflow.com/questions/63359559

            QUESTION

            Error in installing the 'Firebase/Crashlytics' pod in Swift
            Asked 2020-May-13 at 15:33

            I am installing the pod 'Firebase/Crashlytics' into my Xcode project. the project configuration is: XCode: 10.3 Swift Version: 4.2 Pod Version: 1.8.0.beta.2

            Error after pod install:

            ...

            ANSWER

            Answered 2020-Apr-10 at 13:20

            This is issue was coming due to diff version of pods because the old firebase pods were not updated and the default new pod are installed with a higher version.

            To install new pod and update the old pods 1) we have to update the cocoa-pods 2) update specific pods so that other pods won't be disturbed

            Source https://stackoverflow.com/questions/61138984

            QUESTION

            Swift: Continuous resizing of tableViewCell while user types in a UITextView
            Asked 2020-Mar-10 at 06:26
            Introduction

            Context:

            I'm creating one of my first apps but I've ran into an issue I cannot figure out.

            • I have tableView with cells packed with quite a few UIElements. All constraints are done using the EasyPeasy library which basically just sets auto layout constraints ( I have tried setting them manually also). The UITextView in question is constrained by various numbers to the left, right, top and bottom, I have no constraints on it for height or width.

            • in cellForRowAt indexPath: I set the textView delegate for each cells textView to self, using a delegate property declared within the cells custom class. I also tag every textView with its cells indexPath.row (gives textView.tag integer in textViewDidChange method).

            Issue/acknowledgments:

            • After browsing SO a lot I've found a few questions alike this but I have not been able to make them work for me, I have implemented parts of them that felt logic to my case. I believe the problem differencing my situation from those questions lies in that for my cell design to work the cells has to have a height of itemHeight or higher.
            • I have noticed that as I type into the textview the textview itself increases in height (even below the cells border but its not visible as it reaches that point), however the cell itself doesn't resize.
            • I've tried with a cell that only contains a textView so the problem must lie in the textViewDidchange or heightForRowAt indexPath methods.

            Question:

            What am I doing wrong here? Why doesn't the cells height change dynamically as I type in the textView?

            Code: ...

            ANSWER

            Answered 2020-Mar-10 at 06:26
            • The constraints that determine the height should be laid out in such a way that the textView is attached directly to the top and bottom of the contentView or to views which are connected to the top and bottom of the contentView, so that autolayout can make out the height by connecting the constraints.
            • Make sure that you do not mention a height for the textView and disable scrolling. Let automatic dimension take care of all that.
            • Now all you need to do is call tableView.beginUpdates() and tableView.endUpdates() on textViewDidChange

            Here is my repo which demonstrates the same.

            OP Edit:

            • You should store the additional height that you add in a variable in the cell class so the cells can reload an appropriate height when the tableVIew is reloaded.

            • You should also change textViewDidChange method

            Source https://stackoverflow.com/questions/51731451

            QUESTION

            UITextView text color doesn't reset after setting attributed text
            Asked 2020-Feb-14 at 07:02

            I am using UITextView in my app and I'm having a strange behaviour. My UITextView has white colour as text colour. I am setting some attributed text with blue colour in my UITextView and it works as expected, But as soon as I delete the text and type next time, text colour turns blue. I have tried setting text colour again to white but no luck. See screenshots attached for better understanding of the issue.

            UPDATE

            ...

            ANSWER

            Answered 2019-Nov-09 at 09:15

            Fixed the issue by setting typing attributes to textView

            Source https://stackoverflow.com/questions/58766757

            QUESTION

            Getting Ambiguous use of 'reachabilityChanged' error after installing third party framework through cocoa pods?
            Asked 2020-Jan-29 at 15:59

            I have following internet connectivity checking code using rechability to notify when internet connection status changes in my app.

            ...

            ANSWER

            Answered 2020-Jan-29 at 15:59

            When i changed notification reachabilityChanged name in ReachabilitySwift pod library files to other name, then i was not getting build error and when network status changed checkForReachability method was also getting called.

            But as changing something in podfile is not good solution because if pod is updated each time we need to do it, so i removed ReachabilitySwift pod file and used network manager of alamofire library.

            It seems like reachability used by both almorfire and externally was causing the issue.

            Source https://stackoverflow.com/questions/59897179

            QUESTION

            Swift adding view above keyboard getting Error Cannot assign to property: 'inputAccessoryView' is a get-only property
            Asked 2019-Jul-30 at 09:18

            My scenario, I am trying to add UIView on top of the keyboard for toolbar. here, I am using below code for growing textview

            https://github.com/muukii/NextGrowingTextView

            I added additionally UIView in Viewcontroller top side and added below code into Viewcontroller

            ...

            ANSWER

            Answered 2019-Jul-30 at 07:01

            To answer your question: The error occurs because class NextGrowingTextView is of type UIScrollView and you simply cannot change a scroll view's inputAccessoryView. You can see that in NextGrowingTextView.swift.

            You should - though - be able to modify self.growingTextView.textView.inputAccessoryView.

            Source https://stackoverflow.com/questions/57265846

            QUESTION

            iOS build setup fails on Azure with file exists error
            Asked 2019-Jun-16 at 09:04

            I am running Azure build pipeline for iOS with Xcode 9 version. I have cocoapods step which does pod install. Then in the build step, I am getting the below error. I have clean build option enabled. Also I tried running a bash script with rm -rf Pods before running cocoapods step, but I still get the same file exits error, but sometimes, with different file. Any idea how to fix this?

            ...

            ANSWER

            Answered 2019-Jun-16 at 09:04

            Most of the time, on Azure Pipelines, error 65 with cocoapods is related to Signing and Certificates while XCode tries to sign the Pod projects which do not support signing.

            Have you enabled or disabled the useXcpretty: 'false'? I would recommend disabling it as it potentially hides the real XCode error in the Pipeline's logs.

            I had to add the following at the end of my Podfile to force disabling signing in the pods:

            Source https://stackoverflow.com/questions/56598423

            QUESTION

            How to set minimum height for UITextView that grows dynamically?
            Asked 2019-Apr-11 at 10:56

            I have a GrowingTextView which increases its height when content size increases.

            ...

            ANSWER

            Answered 2019-Apr-11 at 10:56

            Using the library that you mentioned GrowingTextView in your comment you can use the parameter minHeight = 200.

            Source https://stackoverflow.com/questions/55629847

            QUESTION

            Swift: Checkbox insertion in UITextView of a UITableViewCell and using UITapGestureRecognizer to recognize taps on the checkbox
            Asked 2018-Aug-16 at 23:29
            Introduction

            Context:

            I am working on one of my first own apps, a sort of note-taking app.

            The basic framework is simple: I have a UITableView with cells in them with a few design elements and a large UITextView which the user can write their notes into.

            Issue:

            • I would like to implement the checkbox feature, similarly to what Apple has in their app "Notes". I want it to be a "part" of the text, so its erasable by hitting the erase on the keyboard.

            • I have checked posts on SO about inserting a character to a UITextView, which works (see code below), but they differ in their goal when it comes to the actual tap recognition. But I cant figure out how to check if the tap is on my NSAttributedString or not.

            Question:

            1. How do I swap out the characters that make up the checkbox when a user taps on them? 2. How do I get the UITapGestureRecognizer to work properly on my TextView? See edit also

            Edit:

            Old edited issues: (solved through silicon_valleys answer)

            • My UITapGestureRecognizer doesn't work as intended, it doesn't seem to respond to the taps.
            • How can I check if my checkbox is tapped on and replace the characters with the checkmark?
            • How do I insert the checkbox only at the beginning of the line which the user's cursor is on?

            Smaller new issues:

            • The tap recognizer now works perfectly. But I cant find a way to 1. Convert the NSRange to a UITextRange so I can replace the characters or 2. use the NSRange to insert a character in the TextView.
            Code:
            • checkbox insertion method toolbarCheckbox(sender: UIBarButtonItem)

              ...

            ANSWER

            Answered 2018-Aug-15 at 20:15

            It is not possible to add a UIButton or other UIControl in the middle of the text of a UITextView. What you could do though, is using the attributedString property of the UITextView to render a checkbox character. You can do this by using a custom font with a character that matches the checkbox (checked and unchecked). You will need to add a UITapGestureRecognizer to the UITextView and then convert the point of the touch to detect if a checkbox was tapped and change the checkbox character from a selected checkbox to unselected and vice versa. You also need to bear in mind that you will have to set a delegate on the UITapGestureRecognizer to make sure it allows simultaneous touches with the normal touches for moving the cursor and only intercept the tap when it is on a checkbox symbol.

            You can add a button in a toolbar above the keyboard which will add the checkbox symbol to the text (see this solution: How can I add a toolbar above the keyboard?).

            I hope this helps.

            Answer to your further questions

            • My UITapGestureRecognizer doesn't work as intended, it doesn't seem to respond to the taps.

              This is because you try to use a single gesture recognizer on all of your textviews. You should create a new UITapGestureRecognizer for each UITextView. Now it will be removed from the previous views as you are adding the to the later views (so it will only detect the tap on the last cell that is dequeued).

            • How can I check if my checkbox is tapped on and replace the characters with the checkmark?

              The code you have inside checkboxTapDone(sender:) should deal with that. You are mostly there, but the range you are creating should only be 1 character, not 9. You then need to compare the substring value with the value of a checked and unchecked character. Then update the eventText.attributedText with the opposite character.

            • How do I insert the checkbox only at the beginning of the line which the user's cursor is on?

              The following code snippet should help you determine the range where you can insert the checkbox character.

            Source https://stackoverflow.com/questions/51803423

            QUESTION

            Swift: Using didSelectItemAt indexPath func to only select the cell even if I tap on a UI element within it
            Asked 2018-Aug-01 at 21:00

            Good afternoon. I am creating a simple little app and I have a simple "feature" in mind that I cannot figure out how to implement, being rather new to programming. I have a UICollectionView with cells within a cell of another UICollectionView and when I tap one of those cells they trigger the following didselect and diddeselect methods:

            ...

            ANSWER

            Answered 2018-Jul-31 at 12:23
            func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
            
                if let cell = collectionView.cellForItem(at: indexPath) {
            
                    cell.yourTextView.isUserInteractionEnbled = true //1
            
            
                    cell.layer.borderColor = UIColor.flatBlack.cgColor
                    cell.layer.borderWidth = 3
                    cell.layer.cornerRadius = 7
                    cell.backgroundColor = GradientColor(.topToBottom, frame: cell.frame, colors: [UIColor.flatRed.withAlphaComponent(0.2), UIColor.white])
            
            
                } else {return}
            
            }
            
            func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) {
            
                if let cell = collectionView.cellForItem(at: indexPath) {
                    cell.layer.borderColor = UIColor.clear.cgColor
                    cell.layer.borderWidth = 0
                    cell.layer.cornerRadius = 0
                    cell.backgroundColor = .white
                } else {return}
            
            }
            
            override func viewWillAppear(_ animated: Bool) {        
                NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillDisappear), name: Notification.Name.UIKeyboardWillHide, object: nil)
            }
            
            
            @objc func keyboardWillDisappear() {
            
                cell.yourTextView.isUserInteractionEnbled = false //2
            }
            

            Source https://stackoverflow.com/questions/51613110

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install GrowingTextView

            GrowingTextView is available through CocoaPods. To install it, simply add the following line to your Podfile:. Swift 2.3 (Stopped update since Sep 2016).

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/KennethTsang/GrowingTextView.git

          • CLI

            gh repo clone KennethTsang/GrowingTextView

          • sshUrl

            git@github.com:KennethTsang/GrowingTextView.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link