Accordion - Detecting User Interaction


How can I detect that a user opened a section by touching the header and NOT opened by = YES ?

I want to do extra work if the user opens the section, but NOT if the program opens the section.

I was going to use the delegates, but they get called by both actions.

Any ideas?


Expanding upon this question, why doesn’t shouldCloseSection get called?

My delegate is working since willCloseSection is called as well as didCloseSection.

Is this a bug?  (using version 2.71-6)


Greetings Program!

Got the same result with 2.7.1-7

I’d say it was a bug.



Do I need to do anything more to report this?

Is there a work around?

Can I put a gesture recognizer on the header and decide whether or not to pass taps to the control?   Would that work?

I need to prevent closing an open header (my menu item needs to remain open and selected).


Here’s how I accomplished it:

When I create each section, I add a recognizer to the header:

    // Add a tap gesture recognizer to the header
    UITapGestureRecognizer *tapRecog = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(menuItemTapped:)];
     tapRecog.cancelsTouchesInView = YES;            // don't let the touches pass to the header

    [section.header addGestureRecognizer:tapRecog];

When a tap is detected, it calls:

- (void)menuItemTapped:(UITapGestureRecognizer*)recog {
     if (recog.state == UIGestureRecognizerStateEnded)   // wait until the recognizer is done
         NSInteger menuIndex = recog.view.tag;           // menu index is set in the header and section tags
         NSLog(@"Menu Item Tapped: %d",menuIndex);
        SEssentialsAccordionSection *section = [[myAccordion sections] objectAtIndex:menuIndex];    // get the section
        if (!
             [section setOpen:YES];  // open the section if it is closed

Since the taps don’t make it to the header, the section can’t close leaving my submenu items visible.

Mission accomplished!


Nice workaround!

I sent in a ticket to support about the issue and this thread.



Hi guys,

Just a quick post to let you know the fix for this is now available in our CRM for download, and should appear as a trial download this week!