GrowingTextView | Support auto growing , placeholder and length limit | Chat library
kandi X-RAY | GrowingTextView Summary
kandi X-RAY | GrowingTextView Summary
An UITextView in Swift. Support auto growing, placeholder and length limit.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of GrowingTextView
GrowingTextView Key Features
GrowingTextView Examples and Code Snippets
Community Discussions
Trending Discussions on GrowingTextView
QUESTION
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:01This is most likely the result of a transient network failure. Please retry.
QUESTION
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:20This 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
QUESTION
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 thecontentView
or to views which are connected to the top and bottom of thecontentView
, 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()
andtableView.endUpdates()
ontextViewDidChange
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
QUESTION
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:15Fixed the issue by setting typing attributes to textView
QUESTION
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:59When 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.
QUESTION
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:01To 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
.
QUESTION
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:04Most 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:
QUESTION
I have a GrowingTextView
which increases its height when content size increases.
ANSWER
Answered 2019-Apr-11 at 10:56Using the library that you mentioned GrowingTextView
in your comment you can use the parameter minHeight = 200
.
QUESTION
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.
checkbox insertion method
...toolbarCheckbox(sender: UIBarButtonItem)
ANSWER
Answered 2018-Aug-15 at 20:15It 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 eachUITextView
. 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 thesubstring
value with the value of a checked and unchecked character. Then update theeventText.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.
QUESTION
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:23func 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
}
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install GrowingTextView
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page