Skip to content

Commit df34dab

Browse files
committed
Refactored some internal naming.
1 parent 07f0b93 commit df34dab

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

FZAccordionTableView/FZAccordionTableView.m

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ - (id)initWithCoder:(NSCoder *)aDecoder {
123123
}
124124

125125
- (void)initializeVars {
126-
_numberOfSectionsCalled = NO;
127126
_sectionInfos = [NSMutableArray new];
127+
_numberOfSectionsCalled = NO;
128128
_allowMultipleSectionsOpen = NO;
129129
_enableAnimationFix = NO;
130130
_keepOneSectionOpen = NO;
@@ -140,12 +140,8 @@ - (BOOL)isAlwaysOpenedSection:(NSInteger)section {
140140
return [self.sectionsAlwaysOpen containsObject:@(section)];
141141
}
142142

143-
- (void)addOpenedSection:(NSInteger)section { // KRIS TODO: Rename this to markSectionOpen
144-
[self.sectionInfos[section] setOpen:YES];
145-
}
146-
147-
- (void)removeOpenedSection:(NSInteger)section {
148-
[self.sectionInfos[section] setOpen:NO];
143+
- (void)markSection:(NSInteger)section open:(BOOL)open {
144+
[self.sectionInfos[section] setOpen:open];
149145
}
150146

151147
- (NSArray *)getIndexPathsForSection:(NSInteger)section {
@@ -345,7 +341,7 @@ - (void)openSection:(NSInteger)section withHeaderView:(FZAccordionTableViewHeade
345341
}
346342
}
347343

348-
[self addOpenedSection:section];
344+
[self markSection:section open:YES];
349345
[self beginUpdates];
350346
[CATransaction setCompletionBlock:^{
351347
if ([self.subclassDelegate respondsToSelector:@selector(tableView:didOpenSection:withHeader:)]) {
@@ -361,7 +357,7 @@ - (void)closeSection:(NSInteger)section withHeaderView:(FZAccordionTableViewHead
361357
[self.subclassDelegate tableView:self willCloseSection:section withHeader:sectionHeaderView];
362358
}
363359

364-
[self removeOpenedSection:section];
360+
[self markSection:section open:NO];
365361
[self beginUpdates];
366362
[CATransaction setCompletionBlock: ^{
367363
if ([self.subclassDelegate respondsToSelector:@selector(tableView:didCloseSection:withHeader:)]) {
@@ -404,7 +400,7 @@ - (void)autoCollapseAllSectionsExceptSection:(NSInteger)section {
404400

405401
// Delete the cells for section that is closing
406402
NSArray *indexPathsToDelete = [self getIndexPathsForSection:sectionToClose.integerValue];
407-
[self removeOpenedSection:sectionToClose.integerValue];
403+
[self markSection:sectionToClose.integerValue open:NO];
408404

409405
[self beginUpdates];
410406
[CATransaction setCompletionBlock:^{
@@ -453,7 +449,6 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
453449
// There is some potential UITableView bug where
454450
// 'tableView:numberOfRowsInSection:' gets called before
455451
// 'numberOfSectionsInTableView' gets called.
456-
NSLog(@"ENCOUNTERED UITABLEVIEW BUG");
457452
return 0;
458453
}
459454

0 commit comments

Comments
 (0)