FAQ Database Discussion Community


Change text color in specific situation

ios,objective-c,iphone,uitextview,nsattributedstring
I'm using this method to change color to few chars of my UITextView +(void)changeColorToTextObject : (UITextView *)textView ToColor : (UIColor *)color FromLocation : (int)location WithLength : (int)length { NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithAttributedString: textView.attributedText]; [text addAttribute:NSForegroundColorAttributeName value:color range:NSMakeRange(location, length)]; [textView setAttributedText: text]; } It works great but after I...

Naming or Tagging UITextViews in Swift?

ios,swift,uitextview
I need to specify one textView in which I want to update the text. I have tried the following: func updateView(message: String) { var textView2 = UITextView.viewWithTag(2) textView2.text = message } but I receive this error: type 'UIView' does not conform to protocol 'IntegerLiteralConvertable...

iOS 8 Tap on UITextView freezes the app

ios,objective-c,uitableview,ios8,uitextview
I have an old code, without ARC, without Autolayout and I am constructing theUITableViewCell programmatically. TheUITableViewCell contains aUITextView. The cell is constructed properly but when I tap on theUITextView for editing the app freezes and after some time it exists (I think it's because it's taking a lot of CPU...

UITextView in UITableView disappears when run on simulator

ios,objective-c,uitableview,uitextview
I have a UITableView with a UITextView inside. When I run it on the simulator, the textView disapears. Here are some pictures to illustrate what's going on: Stroyboard: (The textView is in green.) (textViews constraints) When I run it on the simulator: (The textView disapears.) The textView's height will be...

Whitespace at the top of a UIViewController [duplicate]

ios,uiviewcontroller,uinavigationcontroller,storyboard,uitextview
This question already has an answer here: Blank space at top of UITextView in iOS 7 9 answers I have a UIViewController embedded in a UINavigationController. The UIViewController contains a UITextView (which takes up the entire screen except for the nav bar and menu area. For some reason there...

Textview Frame is become squeez and cannot come back to its original form?

ios,objective-c,iphone,xcode6,uitextview
keyboardWillShow method implementation : - (void)keyboardWillShow:(NSNotification *)notification { [UIView beginAnimations:nil context:nil]; CGRect endRect = [[notification.userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; CGRect newRect = txtNotes.frame; //Down size your text view newRect.size.height -= endRect.size.height; txtNotes.frame = newRect; [UIView commitAnimations]; } keyboardWillHide method implementation : - (void)keyboardWillHide:(NSNotification *)notification { // Resize your textview when keyboard...

Swift Dismiss UITextView Keyboard

swift,uitextview
I am having trouble dismissing the keyboard of a text view in swift. i was able to dismiss a textfield with the following @IBAction func DismissKeyboard(sender: AnyObject) { self.resignFirstResponder() } But im not sure how i go about it with a textview...

iOS, Keyboard Predictive bar visibility

ios,uikit,uitextview,uikeyboard
I have some instance of UITextView and I want this textView to occupy all empty vertical space when keyboard is shown. The problem is that I do not know what height will keyboard take as it has predictive bar in iOS 8 and its actual height can be changed by...

UIText view not starting from the beginning

ios,swift,textview,uitextview
i have a UIText View on my ios app, and when i open the app, the text view text starts from the middle. How do i get the text to start from the beginning?

How to get selected URL when clicked on UITextView?

ios,uitextview
My problem is I want to get the URL string from UITextView when I cliked on any URL that contained in it.

Newline and / or Carriage Return in Swift String

ios,swift,uitextview,newline,carriage-return
I am attempting to add a Newline or Carriage return in a UITextView. var text = UITextField() text.text = "This is a text \r\n This is a text" The result shows the entire text on one line: This is a text This is a text Is it not possible to...

Change UITextView Font w/o Removing Bold/Underline/Italics Formatting

ios,swift,uitextview,nsattributedstring
I have a UITextView in an iOS app, and I want to allow the user to bold/italicize/underline/etc at will, so I gave set the allowsEditingTextAttributes property to true on the text view. However, I would also like to allow the user to change things like font and color. Currently, it...

Duplicated UITextView doesn't show all text from the original

ios,objective-c,uitextview,nsattributedstring
I'm trying to make a duplicate UITextView based on another UITextView for sharing purposes. This text view is added as a subview to viewToShare. There is an issue however, the duplicated text view doesn't show all of the original text from the text view I'm copying from. I'm using attributed...

TextView inside ScrollView stick to keyboard

ios,swift,uiscrollview,uitextview,uikeyboard
I have a UIScrollView and content inside it. Inside content there is a UITextView. When user presses the UITextView I want the UITextView stick to the keyboard. In the image: Whole thing is UIScrollView Bottom black area is the visible screen Red area is content Blue area is UITextView Green...

How to detect taps on UITextView?

ios,swift,uitextview,uigesturerecognizer
I have a view that looks like this: When the user tries to enter information the keyboard covers the UITextViews I thought trying to detect a tap on the UITextView using a UIGestureRecognizer that I added to the UITextView, and then change the constraints according to the view which was...

UITextView always scrolls from the beginning when using scrollRangeToVisible()

ios,uiscrollview,uitextview
I'm debugging a UITextView which logs my operation. e.g. If I press a special button on the screen, this UITextView will show which button I just pressed. It will log more as I pressed more buttons, so I can easily scroll the UITextView to see my past operation. Because the...

How to retrieve photo from UITextView after adding it using NSAttributedString?

ios,objective-c,uitextview,nsattributedstring
I am using the next code to add an image to a UITextView: UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(200,200,140,140)]; textView.font = [UIFont systemFontOfSize:20.0f]; NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:@"Test with emoji"]; NSTextAttachment *textAttachment = [[NSTextAttachment alloc] init]; textAttachment.image = [UIImage imageNamed:@"Angel.png"]; //for the padding inside the textView textAttachment.image = [UIImage...

iOS: Swipe to select text without long press

ios,cocoa-touch,uitextview
I need to select text by swiping gesture without long press. There seems two way: One is to subclass UITextView or do something about UITextView, the other is to use Core Text to make a new UI component. What should I do?...

UITextView do not insert line break here

objective-c,uitextview
I have UITextView. It contains some math formulas. For example, "In triangle ABC side AB = 5". Sometimes UITextView breaks line after "=". It becomes like this In triangle ABC side AB = 5 But I want "AB = 5" to be together always: In triangle ABC side AB =...

NSAttributedString from RTF works only with iOS 8, not with iOS 7

ios,uitextview,rtf,nsattributedstring
I'm trying to load an RTF-File in a UITextView with the following Code: NSURL * filePath = [[NSBundle mainBundle] URLForResource:_fileName withExtension:@"rtf"]; NSAttributedString *stringWithRTFAttributes = [[NSAttributedString alloc] initWithFileURL:filePath options:@{NSDocumentTypeDocumentAttribute:NSRTFTextDocumentType} documentAttributes:nil error:nil]; myTextView.attributedText = stringWithRTFAttributes; With iOS 8 it works perfectly, but on iOS 7 it doesn't work, it only displays the...

Find CGPoint Location of substring in TextView

ios,swift,sprite-kit,uitextview,nsattributedstring
I'm looking to create a SpriteKit Node positioned at the location of a substring inside a UITextView. How would I retrieve the CGPoint location so I can position the SKNode there? let textFont = [NSFontAttributeName: UIFont(name: "GillSansMT", size: 30.0) ?? UIFont.systemFontOfSize(18.0)] attrString1 = NSMutableAttributedString(string: "My name is Dug.", attributes: textFont)...

Use AutoLayout to scale down UIImageView height

ios,objective-c,uiimageview,autolayout,uitextview
So, In my app I have an UIView (it resizes keeping the same aspect ratio so that it always touches the sides of the screen) and in that view I have an UIImageView and an UITextView on top of it. Visually (the pink rectangle is the textview): What I want...

Keep text in UITextView highlighted when the popover is dismissed

ios,objective-c,uitextview,highlight,uipopover
I have a UIPopover that shows up a plain view containing a UITextView filled with some text. I have managed to highlight the text. When the popover is dismissed, and re-opened, the highlight disappears. I want to keep the text highlighted even if if the application is closed. Any ideas...

Detect when taps are outside of a UITextView

ios,swift,uitextview
I am working on a program where I have various UITextViews. The problem I am having is that I cannot detect when the user has tapped outside of the UITextView so that I can hide the keyboard. I have tried various actions, but none of them work. Code I am...

UITextview selected text

swift,uitabbarcontroller,uitextview
I've an UITabBarController. In my UIViewController a UItextView where I can select the text but when I change the View, text is kept selected. I've tried to add that code but doesn't work: var range:NSRange = textView.selectedRange range.length = 0 range.location = NSNotFound ...

Displaying Rich Text File in UITextView Causes Choppy/Slow Scrolling

ios,uitextview,rtf
Im currently loading a non-english (hebrew) Rich Text File into a UITextView like so. self.textView.attributedText = [NSAttributedString.alloc initWithFileURL:[ NSBundle.mainBundle URLForResource:@"TextFile" withExtension:@"rtf" ] options:nil documentAttributes:nil error:NULL ]; Everything get loaded correctly and the file scrolls, just it gets very choppy on the way down. I assume this is a rendering issue...

Move up subviews based on size of UITextView swift

ios,swift,uitextview
I have a UITextView that changes height when the user types in multiple lines of text. My problem is that when the user types in enough lines, the UITextView gets covered up by the UITableView that is located above the textview. Is there any way to move the tableview up...

How to make UIScrollView scrolling all content inside it

swift,uiscrollview,uitextview
I have UITextView, UIImageView, UILabel inside UIScroll View. I made that UITextView height equals its content and made scrollEnabled = false. UIScrollView scrolling not all content. I want that UIScrollView scrolling all content inside it. I want to make DetailViewController as in news applications. How do I make it?

UITextView not resizing correctly on iPad only

ios,objective-c,ipad,autolayout,uitextview
I have a static UITableView with 3 rows in 1 section. Each row contains a UITextView that should resize based on the content. Each of the UITextView objects has scrolling disabled to force it to grow. Each is pinned on all 4 sides to the cell's contentView and has no...

Scroll UITextView to bottom without animation

ios,objective-c,uitextview
I have the following code which scrolls a textview to the bottom with animation. - (void)scrollTextViewToBottom:(UITextView *)textView { [_logTextView scrollRangeToVisible:NSMakeRange([_logTextView.text length], 0)]; } I've seen some other examples that use contentOffset but that may have a bug? as it gives inconsistent results....

Is it possible to adjust textview with small picture inside it?

ios,swift,uiimageview,uitextview
I moved from android to Swift. In android we could assign a drawable to the left or right of the text, we could do this in XML. for example this XML for a textView with picture on the left: <TextView android:id="@+id/myTextView" android:layout_width="match_parent" android:text="This is test text view and it is...

Attributed Text View that opens address in new map view

ios,uitextview,apple-maps
I'm working on an app that uses parse as the backend and allows users to post their address via text view. I enabled the "Addresses" attribute and addresses open in the Apple maps app. Instead I'd like to keep my users in my app by opening a new view with...

Plain text in UITextView

ios,objective-c,iphone,cocoa-touch,uitextview
I can understand how to remove next padding: I was created Navigation controller (with hidden bar) Add UITextView (with blue border) Into UiTextView.text add simple text "Вопрос". (red border was added by cmd+hover) Could you please explain where did this indentation appear? and how to remove it? ...

What's the equivalent of Android's “ClickableSpan” class in Swift/Objective-C?

ios,swift,uilabel,uitextview
So I'm trying to create a view where part of the entered text becomes a link to another UIView. I was searching a lot and found the ClickableSpan class that enabled to click on part of the text. It's like in Instagram where when a user types @username or #hashtag...

Prevent user from entering more characters into uitextview

ios7,xcode6,uitextview,edit
How could I prevent the user from entering any more characters into a uitextview after the textview has reached a given height? Here is the code I thought would work but does not. I can't put in any more characters but for some reason I can't even delete any.. -...

How can I modify the display rect in UITextView?

ios,uitextview
As the pic above,I want to make the text left-aligned with the label,how to do that?...

Controlling UITextView's auto scroll speed

ios,uitextview,uislider,autoscroll
i am trying to make an app to view txt files in uitextview. So far i got no problems about fetching the data and stuff. In my app i have 2 uisliders. one to control font size and the other one to control the speed of textviews autoscroll. My problem...

UITextView after CATransform3D: scrolling all out of whack

ios,objective-c,uitextview,core-animation,catransform3d
So I have a UITextView, and in viewDidLoad I rotate its layer so it appears to be slanted back into the screen (sort of like the Star Wars opening crawl). The problem is that scrolling is all messed up. Dragging up will scroll for a bit, then jump backward or...

How to save NSAttributedString to CoreData

ios,swift,core-data,uitextview,nsattributedstring
I want to save the attributedString of my UItextview'text. I tried to convert to string and save. But when I back to set the text'attributedString,it not work. This is how I convert to String: var a = String(stringInterpolationSegment: text.attributedText) Data.setValue(a, forKey: "font") Data.managedObjectContext?.save(nil) This is how I back to set:...

HTML Format in UITextView

ios,swift,hyperlink,format,uitextview
i'm quite new to iOS Development and right now working on an app which receive some kind of JSON Data. But some Backend Experts thought, that it would be better for the User if they just copy the Information straight out of Word and paste it into the information System....

UItextview cursor position

swift,uitextview
I've a UITextview with these constraints: Align Center x,y and width and height equals. When I click the UItextview for the first time the cursor is like: When I write inside: When I delete characters: what happened?...

UITextView with magnifying-glass and no keyboard

ios,uitextview,uitextviewdelegate
When using a UITextView one usually gets a keyboard to edit the contents; and by touching it one also gets a magnifying glass to help bring the cursor in the desired position. Is it possible to get the magnifying glass to position the cursor but at the same time eliminate...

How can I get the length of text entered into UITextView as the user types?

ios,objective-c,xcode6,uitextview,uitextviewdelegate
I have aUITextView. I would like to have a way of updating aUILabel as the user times to indicate how many remaining characters are permitted? In theViewController theUITextView is referenced as IBOutlet UITextView *message; I have tried looking at the show connections inspector and I don't see an edit changed...

Swift Increase font size of the UITextview,how?

ios,swift,fonts,uitextview
I am trying to add two buttons to my app to set the font size of a UITextview,and i found this function textview.font.increaseSize(...) //and decreaseSize(...) But i don't understand what I have to put inside the parentheses,i want to increase and decrease the font size by one point Thanks for...

UITextView in For Loop missing argument

xcode,swift,for-loop,uitextview
Xcode is throwing a missing argument for parameter textContainer in call for the textShown1 = CustomTextView line. I'm curious as to why it throws the error only inside the for loop, but outside it doesn't. for i in 1...paragraphCount { // Missing 'argument textContainer in call below', various other errors...

Cannot select text in UITextView

ios,uitextview
I have an UITextView. Then I've added double tap gesture recognizer to the UITextView. Therefore I can't select text in UITextView when i double tap in UITextView. How i can select text and get double tap event at the same time? Thank in advance This is my code: UITapGestureRecognizer *doubleTapRecognizer...

Programmatically add UITextView as UITableView header

ios,iphone,uitableview,header,uitextview
I am trying to add a TextView as the header of a table view. My code is below. The code runs, as I see the log message printed. But there is no header in my table/scene. Does anyone know why the header is not showing? I am making the call...

Remove “Copy” menu item from programatically created UITextView IOS

ios,uitextview,uimenuitem
I create my UITextView programmatically in my viewDidLoad. When i select a text, the menu shows me the following : As it shows, i have added two custom buttons the highlight and unhighlight. I would like to remove the " copy " option and keep all others, so i cannot...

How do I resize a UITableViewCell according to the size of a UITextView subView?

ios,uitableview,swift,uitextview
Currently I can successfully resize my UITextView according to the amount of text within it. My problem is that this UITextView is within a UITableViewCell. What I've tried to do is use the height of the resized UITextView to resize the cell by accessing it's frame and setting the height...

Change Colour of Small Words ('in') in UITextView using NSMutableAttributedString

ios,objective-c,cocoa-touch,uitextview,nsattributedstring
I'm using NSMutableAttributedString to change the text in a UITextView as the user types. When the user types '#HELLO#' or "#TEST#" or '#test#', those strings should be red (just an example). - (void)textViewDidChange:(UITextView *)textView { NSString *textViewText = textView.text; NSMutableAttributedString * string = [[NSMutableAttributedString alloc]initWithString:textViewText]; NSString *space = @" ";...

iOS: how to display a long text in a UIScrollView?

ios,objective-c,uiscrollview,uitextview
EDITED I have a UIScrollView, it has an ImageView at the top, under that there is a UIlabel, and under that i want to put a long text. I tried to put a UITextView inside of a UIScrollView, but UITextView has its own scroll bar, i need to put a...

Limit characters by UITextView height

ios,swift,uitextview,cgrect
Using the following code I'm attempting to limit the height of my UITextView by disallowing the user to enter characters once the UITextView is beyond a certain content size. But the problem is that with the current code, the last character after the height limit is written anyway such that...

Email id in textview is clicked in ios

ios,uitextview,mfmailcomposeviewcontroll
I have an UITextView contains large string in which it contains Email Id's.When an email id is clicked i have to open MFMailComposeViewController and the email id should be under lined in the UITextView I Tried as below textview.dataDetectorTypes = UIDataDetectorTypeAddress; textview.dataDetectorTypes = UIDataDetectorTypeLink; ...

Do I use NSAttributedString or UIWebView Swift

ios,swift,uiwebview,uitextview,nsattributedstring
I'm getting different strings that occupy "busDescriptio" depending on what business you choose from a website database. This string contains html tags, images, and links. I was told to use NSAttributedString instead of UIWebView because UIWebView was giving me all sorts of problems such as images in wrong place, text...

Add UITapGestureRecognizer to UITextView without blocking textView touches

ios,swift,uitextview,uitapgesturerecognizer
How can I add a UITapGestureRecognizer to a UITextView but still have the touches getting through to the UITextView as normal? Currently as soon as I add a custom gesture to my textView it blocks the tap for UITextView default actions like positioning the cursor. var tapTerm:UITapGestureRecognizer = UITapGestureRecognizer() override...

How to do a live UITextField count while typing (Swift)?

ios,swift,uitextfield,uitextview
I would like to count the character when user keep typing in UITextField with swift. Image of Field and Label: I have already placed UITextField and UILabel, just haven't found any information on Stack overflow, also if you can do one in UITextView I also appreciate it....

Avoiding multiple Scroll when textview is used inside Scrollview ios

ios,swift,uiscrollview,uitextview
I added a textview inside a ScrollView. The problem happens when I increase the size of the textView. The first scroll happens until the end of the view. The second scroll happens in the textview for scrolling it to the end of the text. For reading the whole text the...

Subview content being mysteriously offset in Interface Builder?

xcode,interface-builder,uicollectionview,uitextview,offset
I'm experiencing a weird behavior in Interface Builder. I almost feel like it's a glitch, but I'm hoping that I'm just misunderstanding something, or that someone knows what weird AutoLayout behavior I'm experiencing, or something. I'll try to describe it as best I can... I've got a ViewController in Interface...

UITextView contentOffset changes between viewDidLoad and viewDidAppear

ios,objective-c,cocoa-touch,uitextview
On iOS 8 (I have not tested on iOS 7) I have a UITextView that has its text set in the storyboard. When the view actually appears, the text appears scrolled and I do not want it scrolled. In fact, I have no idea why anyone would. Can anyone explain...

iOS UITextView recognize wrong link

ios,objective-c,uitextview
I have a textview in my cell. I have NSTimer that every 5 seconds changes a content of a cell. First time everything is ok. For example: This is test text find out on www.example.com. This is ok. But on timer I animate the cell and in my animation I'm...

UITextView with DatePicker

ios,objective-c,iphone,uitextview,uidatepicker
I have an UITextView and one of my methods requires to change the UITextView inputView to an UIDatePicker, so the user can select a date for a reminder. Here is the code I used self.datePicker = [[UIDatePicker alloc] init]; self.noteTextView.inputView = self.datePicker; [self.noteTextView becomeFirstResponder]; everything works perfectly, but I can't...

ios 8 UITextView UIDataDetectorTypeLink not working

ios,ios8,uitextview
I am setting html text to UITextView and set UIDataDetectorTypeLink to DataDetectorTypes but its not working.below is code:` self.dictHelp =[NSMutableDictionary dictionaryWithDictionary:response]; [self.txtView setValue:[self.dictHelp valueForKey:@"HelpText"] forKey:@"contentToHTMLString"]; self.txtView.userInteractionEnabled = YES; [self.txtView setDataDetectorTypes:UIDataDetectorTypeLink];` Text value is "If you need assistance please contact XXXX at [email protected]" what am i doing wrong?...

textView with truncation swift

ios,swift,uitextview,truncation
I have a text view with a set height on a table view. As the content of my text view is greater than what fits in the set height, the content is truncated. That is fine, but my issue is that I would like the text view to contain the...

dismissing a textview that is added as subview programmatically in scene

ios,objective-c,sprite-kit,uitextview,skscene
as the title suggests i have added a UITextView to my scene and it works fine. the only issue i have is when i use the back button to go back to the main menu the text view remains on the screen. for the life of me i can't figure...

Create a textview in a for loop in Objective-C

ios,objective-c,json,uitextview
I am retrieving data from a mysql database and want to display it in a textview. So, I created a for loop for each piece of data. The problem is it only creates one textview and therefore only displays the first piece of retrieved data. My code is below: -(void)...

Keyboard autocorrection height (with/without the autocorrection)

ios,iphone,uitextfield,uitextview,uikeyboard
I get the keyboard height like this: - (void)keyboardNotification:(NSNotification*)notification { NSDictionary* keyboardInfo = [notification userInfo]; NSValue* keyboardFrameBegin = [keyboardInfo valueForKey:UIKeyboardFrameEndUserInfoKey]; CGRect keyboardFrameBeginRect = [keyboardFrameBegin CGRectValue]; } Now, I have the keyboard height. But without the autocorrection height: If the UITextAutocorrectionType is YES / NO the keyboard height stay the same....

KVO notifications with textView.text

ios,uitextview,key-value-observing
I need notifications with textView.text, but the do not work. My code: Add a KVO: [textView addObserver:self forKeyPath:@"text" options:NSKeyValueObservingOptionNew context:nil]; Observing method -(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context I am trying change contentSize. KVO is working......

Objective c keyboard opens unwillingly

ios,uiview,keyboard,uitextfield,uitextview
I have a "layer builder" object which creates different views and returns them after initialising them. The problem is, whenever i press on one of these created views, the keyboard opens up and i can't understand why. This is how my layer builder is coded: @interface LayerBuilder : NSObject <VENTokenFieldDelegate,...

Using UITextViews as UITextFields

ios,swift,uitextfield,uitextview
This is my first question. I'm currently working on an iOS app in Swift. I was previously using three UITextFields for users to enter their data (it's a journaling app), but I hadn't realized that UITextField was limited to one line. I've worked on getting three UITextViews to behave like...

Delete a word of attributedtext on textview

ios,objective-c,uitextview
I am implementing something like facebook mention. User can type their text message into the textview and mention user names. User name will be highlighted using NSAttributedString. When user wants to delete the text on the textview, I want to delete the mention name as a whole if the text...

Is it possible to have a UITextView scroll through text automatically, and repeatedly in Xcode?

objective-c,xcode6,uitextview
Is it possible to have a UITextView scroll through text automatically, and repeatedly? Like, I have a UITextView, and the text just scrolls, and scrolls, and when it has reached the end, repeats itself, over and over, without the user having to scroll?

UITextView (in UITableViewCell) collapse itself when run on simulator

ios,objective-c,uitableview,uitextview
I have a UITableView with a empty UITextView (and other objects, like UILabel) inside. I'm using auto layout, and UITableViewAutomaticDimension. When I run it on the simulator the textView collapse itself. Meaning, its height becomes like 1 px or something. The other views, like the label stays the right size....

Dynamically adjust the height of the UITextView depending on its content? [duplicate]

ios,swift,uitextview
This question already has an answer here: How do I size a UITextView to its content? 26 answers I have an UITextView that loads different text depending on the route the user has taken in order to get to the view with the text on it. How do I...

How to clear UITextView upon Editing?

swift,uitextview
I currently have the following code: class NewPostController: UIViewController { @IBOutlet weak var MessageField: UITextView! override func viewDidLoad() { super.viewDidLoad() MessageField.text = "What's on your mind?" MessageField.textColor = UIColor.lightGrayColor() } func textViewDidBeginEditing(MessageField: UITextView) { if MessageField.textColor == UIColor.lightGrayColor() { MessageField.text = "" MessageField.textColor = UIColor.blackColor() } } However, whenever I...

Dismiss Keypad when clicking UITextView or by clicking return/done?

ios,swift,uitextview
I'm in the process of programming my first application and I'm having trouble dismissing the numeric keypad when I click off of it. When I click on the background it dismisses, but when I try to click on a UITextView, it doesn't dismiss. Also, there is no "Done" or "Return"...

ios screen flickering after magnifying glass hover

ios,uitextview
I got this app with a text field (actually a UITextView) for entering text. Above this text field is a tableView list of chat messages. There is this very odd behaviour whereby I long press on my text field to edit my existing text and after hovering the magnifying glass...

UIAlertView + UITextView [duplicate]

objective-c,uitextview,uialertview
This question already has an answer here: iOS UIAlertview with uitextview editable 1 answer I'm looking for some help. I need to know how to achieve multiline text input on a UIAlertView. I'm not looking to use a UITextField, that has single line input. Before UIAlertViews were deprecated I...

UILabel with UIButtons

ios,objective-c,uibutton,uilabel,uitextview
Is there a way to have UILabels or UITextViews with UIButtons? Example1: "This Car is yellow and has 4 wheels." Where Car is the UIButton and can be anywhere in the sentence....

How to remove line spaces in UITextView in ios

ios,objective-c,json,uitextview
I have a textView, in that I am entering the data and I pressed on the enter it is going to next line and I entered some other data and I saved it. The result I am getting is : And it is stored in services like : {"PersonID":9416,"PeriodID":59130,"Notes":"tyyyttyt ttrtrtrt...

How do I save the text that the user enters into a UITextView

ios,swift,uitextview
I am basically making a simple notes application. In myViewController I have a UITextView. I want the text that the user types in the UITextView to be saved so that the next time the user opens the app it is still there. How would I go about doing that? I...

Stop inputted text from one UITextView within a prototype cell adding to another

ios,objective-c,uitableview,xcode6,uitextview
I have a weird issue, I can't get to the bottom of. I have a UITableView with various prototype cells depending on content stored in a mutable array. It works something like this: if([currentHandout.content[indexPath.row - 3] isKindOfClass: [objHandoutSubtitle class]]){ cellId [email protected]"CellHandoutSubtitle"; cell = [tableView dequeueReusableCellWithIdentifier:cellId forIndexPath:indexPath]; .. } else if([currentHandout.content[indexPath.row...

UITableView Scrolls to Top on Cell Refresh

ios,objective-c,uitableview,uiscrollview,uitextview
I have a UITableView with a cell that is dynamically sized to fit a UITextView inside it. Whenever a key is typed, the cell checks to see if the calculated height has increased, as with a newline, so it can tell the table the the cell's height needs to be...