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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:53:41+00:00 2026-06-17T08:53:41+00:00

Our designers have come up with a nice design that involves the index on

  • 0

Our designers have come up with a nice design that involves the index on the right side of the UITableView to be taller than the UITableView itself. It also has some custom images for search and better font/color than the default implementation. However, since UITableView does not support customizing its index (that I know of) I’ve been trying to get this going manually. The UI looks like this:

enter image description here

This should be a simple task, but I’m having a hell of a time making it work. I have set up a UIView to the right of the table with UIButtons lined up from top to bottom to represent my index. The goal being as the user drags in/out of the UIButtons, I would jump the UITableView to the right section.

I have searched around and it seems that the thing to do this would be to listen to the UIControlEventTouchDragOutside and UIControlEventTouchDragEnter events to know when I’m in/out of one of the UIButtons.

To this end, I have set up the entire list of buttons as an IBOutletCollection which I init in ViewDidLoad like so:

@property (retain, nonatomic) IBOutletCollection(UIButton) NSArray* indexButtons;


@implementation ViewBeerListViewController
...
@synthesize indexButtons = _indexButtons;

- (void)viewDidLoad
{
    [super viewDidLoad];

    ...

    // Go through the index buttons and set the change function
    for (int i = 0; i < [self.indexButtons count]; ++i)
    {
        UIButton* button = [self.indexButtons objectAtIndex:i];
        [button addTarget:self action:@selector(touchDragOutside:) forControlEvents:UIControlEventTouchDragOutside];
        [button addTarget:self action:@selector(touchDragEnter:) forControlEvents:UIControlEventTouchDragEnter];
    }
}

The functions touchDragOutside and touchDragEnter look like this:

- (IBAction)touchDragOutside:(UIButton*)sender
{
    NSLog(@"Button %@ touch dragged outside", [sender titleLabel].text);
}

- (IBAction)touchDragEnter:(UIButton*)sender
{
    NSLog(@"Button %@ touch dragged enter", [sender titleLabel].text);
}

This all builds and runs. However, it appears that I only ever get events for the button on which I initiated a touch. E.G. if I touch down on the letter “G”, and start dragging up and down, I will only see logs for touch dragging out of “G” and into “G”. I get no events for any of the other UIButtons as I go over them.

Any help with resolving this issue will be immensely appreciated. I’ve been stuck on what seems to be a very trivial problem for a very long time.

Thanks!

  • 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-17T08:53:42+00:00Added an answer on June 17, 2026 at 8:53 am

    Instead of making them with UIButtons, try creating a custom UIView that contains UILabels with each letter. Then in the custom UIView class, override the following:

    – touchesBegan:withEvent:
    – touchesMoved:withEvent:
    – touchesEnded:withEvent:
    

    and use those to determine which labels are being touched. Within touchesMoved, for example, you could have:

    UITouch * touch = [touches anyObject];
    CGPoint point = [touch locationInView:self];
    for(UIView * indexView in self.indexViews) {
        if(CGRectContainsPoint(indexView.frame,point)) {
            //indexView was touched. do something here
            break;
        }
    }
    

    Note that you can also use a UIImageView for the top one instead of UILabels and this will still work.

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

Sidebar

Related Questions

I have a couple of design/architectural questions that always come up in our shop.
More often than I like when designers edit some of our sites' pages, they
When I asked our DB designers why our Fact table do not have a
We are currently developing a few web applications and are letting our designers convert
One of our web designers is working on a site at the moment and
I designed the data access portion of our framework so that every time a
We are deploying sharepoint MOSS 2007 at our work. I'm trying to come up
We are currently in the process of upgrading our rails version and I have
We're not doing real web development. We get our HTMLs from our designers, and
We have a legacy VB6 app, which is critical to our business. We're working

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.