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 8082425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:05:30+00:00 2026-06-05T17:05:30+00:00

I want to have an insert tab button for my UITextView so that users

  • 0

I want to have an insert tab button for my UITextView so that users be able to insert a tab at beginning of the current line.
No matter where the cursor is in the line, the tab should be inserted at the beginning of the line, and after that the cursor must go to the end of the line.

Is it possible ?

  • 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-05T17:05:38+00:00Added an answer on June 5, 2026 at 5:05 pm

    I have no luck with positionFromPosition:inDirection:offset: and characterRangeByExtendingPosition:inDirection:.

    But this works fine for me:

    UITextRange *range = [textView selectedTextRange];
    CGRect rect = [textView caretRectForPosition:range.start];
    UITextPosition *start = [textView closestPositionToPoint:CGPointMake(0, rect.origin.y)];
    [textView setSelectedTextRange:[textView textRangeFromPosition:start toPosition:start]];
    

    UPD: the code above is tested on iOS7 and earlier. And can no longer work with iOS9. Actually, I have some bugs in my text-editing app running on iOS9-devices. I’ll update my answer after fixing my app.

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

Sidebar

Related Questions

I have 2 textBox and 1 button! I want to insert text to one
I have a tab delimeted file that I want to convert into a mysql
I have a tab bar application and I want to display those views that
I have a web page that should insert new DB records and show them
I want to have an 'updateinfo' table in order to record every update/insert/delete operations
I have the following table: I want to insert values from the MySQL workbench.
So i have a foreach and i want to insert a bit of html
I have a little question I want to click on my smileys and insert
I have a custom control and I want to dynamically insert a link to
I have a QList list. I want to insert it on the database. I

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.