BOOL sectionIsOpen = [[self.sectionsStates objectAtIndex:sectionIndex] boolValue];
[[NSNotificationCenter defaultCenter] postNotificationName:@"chooseSection" object:nil userInfo:dic];
[self closeSection:sectionIndex animated:animated];
[[NSNotificationCenter defaultCenter] postNotificationName:@"chooseSection" object:nil userInfo:dic];
[self openSection:sectionIndex animated:animated];
in Lib don't have delegate to know. 1 header is close or open.
i must add Notification Center to handle it
(void)toggleSection:(NSUInteger)sectionIndex animated:(BOOL)animated
{
if (sectionIndex >= [self.sectionsStates count])
{
return;
}
BOOL sectionIsOpen = [[self.sectionsStates objectAtIndex:sectionIndex] boolValue];
if (sectionIsOpen)
{
NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"%lu",(unsigned long)sectionIndex],@"sectionIndex",@"0",@"status", nil];
}
else
{
NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"%lu",(unsigned long)sectionIndex],@"sectionIndex",@"1",@"status", nil];
}
}