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

  • Home
  • SEARCH
  • 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 7842107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:14:34+00:00 2026-06-02T16:14:34+00:00

I currently have a UITextField with default text and set to clear when editing

  • 0

I currently have a UITextField with default text and set to clear when editing begins. I’m trying to make it so that if the field is empty or nil when editing is done the text value will be the default text again. I’m having trouble detecting when either editing is done or the keyboard is dismissed. Could anyone tell me which detection method I would want to use and how to implement it? Thanks so much!


Edit


A placeholder can’t be used in my case

  • 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-06-02T16:14:35+00:00Added an answer on June 2, 2026 at 4:14 pm

    I think you don’t need to handle “default text” yourself. Check placeholder property of UITextField class.

    Update

    So placeholder is not good for your case. Did you try to implement UITextFieldDelegate methods for your UITextField and change the text in textViewDidEndEditing:?

    To do so, implement UITextFieldDelegate methods those look useful for your scenario in your view controller, and set delegate of your UITextField to the view controller (either by Interface Builder or programmatically). Set the default text in textViewDidEndEditing: method.

    You can refer to the “Getting the Entered Text and Setting Text” section of Text, Web, and Editing Programming Guide for iOS.

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

Sidebar

Related Questions

I currently have a query that looks like this: SELECT NON EMPTY ([Measures].[TOTAL]) ON
I currently have links w/ class=ajax that I want to retrieve the element with
I currently have a UINavigationController based application that works just fine. I'd like to
Currently I have a UITextField in a custom cell and I want to get
I'm currently developing an iPhone app where I have two UITextField's in one View
I have a application that allows the user to tap and move a UITextField
I have a UIButton and I am trying to develop an editable UITextField onclick
I have a popover that accepts input into a UITextField. Depending on the input,
I have a view based application which has some textboxes that I'm trying to
Currently have a solution that was created in VS2003 went to VS2005 and now

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.