Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7493979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:16:14+00:00 2026-05-29T17:16:14+00:00

I have an UITextView for entering the comments for the photos. When the user

  • 0

I have an UITextView for entering the comments for the photos. When the user enters their text in UITextView the entered last text should be in Dark gray color other texts should be in normal color. Once the user entered Space the last entered word/text should change to black(normal) color.

UITextView text eg: iPhone is an apple product. Product should be in Dark gray color others in black color. Once user enter space the all entire words in black color.

How can i detect the last entered word and how can i change the particular last entered word text color?

EDITED :

I am trying this source code.

-(void) textViewDidChange:(UITextView *)textView
{
   NSArray *lastTextArray = [textView.text componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

   lastStringInTextView = [lastTextArray objectAtIndex:lastTextArray.count - 1];
   NSLog(@"LastText : %@", lastStringInTopTextView);

   textView.textColor = [UIColor orangeColor];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T17:16:15+00:00Added an answer on May 29, 2026 at 5:16 pm

    I think you need to define a listener(from the text field you entered) and it will look for a white space character(mean ' ') in your text enter. The text color&type can be somethink like yourTextField.font=[UIFont boldSystemFontOfSize:24] untill the listener detects a space, and when it detects the space must change to normal(and the new string must get started be typed as yourTextField.font=[UIFont boldSystemFontOfSize:24] …)
    Note: This is may be not a true aproach to start answering with I think.. but you have asked for any idea. I hope this helps

    EDIT: This needs a good algorithm, also using blocks in the same method which will do this work. The algorithm must be designed in order to accept any ' ' character as the beginning of text field.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UITextView for the user to enter som text. When the UITextView
I have a UITextView(not editable). When user tries to select text I want to
I have an UITextView. Magnifying glass will appear if I select some text. Magnifying
I'm writing iPhone/iPad application. I have UITextView in which I automatically appending text. How
I have a UITextView that is supposed to have one line of text. The
I have one UITextView which is on the bottom of view. When user tap
I have UITextView, which is left aligned. When last word does not fit on
I have a UITextView, and when i type in text, the keyboard will eventually
I have UITextView and I want to use scroll bar when text is longer
In a UITextView have a text which is for readonly and dont want any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.