Skip to content
This repository was archived by the owner on Aug 24, 2020. It is now read-only.

Commit a778369

Browse files
committed
3.0.0 release
1 parent 5a0a17b commit a778369

File tree

12 files changed

+48
-82
lines changed

12 files changed

+48
-82
lines changed

Assets/1.gif

100755100644
-2.31 MB
Loading

Assets/1.png

-262 KB
Binary file not shown.

Assets/2.png

-386 KB
Binary file not shown.

Assets/3.png

-466 KB
Binary file not shown.

Assets/4.png

-419 KB
Binary file not shown.

Assets/5.png

-461 KB
Binary file not shown.

Assets/6.png

-51 KB
Binary file not shown.

Bohr.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "Bohr"
3-
s.version = "3.0.0-rc.2"
3+
s.version = "3.0.0"
44
s.summary = "Settings screen composing framework"
55
s.homepage = "https://github.com/DavdRoman/Bohr"
66
s.author = { "David Román" => "[email protected]" }

Bohr/BOTableViewController.m

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
@interface BOTableViewController ()
1717

18-
@property (nonatomic, copy) NSArray *lastSections;
1918
@property (nonatomic) NSArray *sections;
2019
@property (nonatomic) NSArray *footerViews;
2120

@@ -150,21 +149,47 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
150149
return cell;
151150
}
152151

153-
- (void)reloadTableView {
152+
- (void)tableView:(UITableView *)tableView willDisplayCell:(BOTableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
153+
[cell _updateAppearance];
154+
[cell updateAppearance];
155+
}
156+
157+
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
158+
BOTableViewCell *cell = (BOTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
154159

160+
if ([cell expansionHeight] > 0) {
161+
self.expansionIndexPath = ![indexPath isEqual:self.expansionIndexPath] ? indexPath : nil;
162+
163+
[self.tableView deselectRowAtIndexPath:indexPath animated:NO];
164+
[self.tableView beginUpdates];
165+
[self.tableView endUpdates];
166+
[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionMiddle animated:YES];
167+
} else if (cell.destinationViewController) {
168+
[self.navigationController pushViewController:cell.destinationViewController animated:YES];
169+
} else if ([cell respondsToSelector:@selector(wasSelectedFromViewController:)]) {
170+
[cell wasSelectedFromViewController:self];
171+
}
172+
173+
if (cell.accessoryType != UITableViewCellAccessoryDisclosureIndicator) {
174+
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
175+
}
176+
}
177+
155178
#pragma mark Dynamic options
179+
180+
- (void)reloadTableView {
156181

157182
NSMutableIndexSet *affectedIndexes = [NSMutableIndexSet new];
158183

159-
for (NSInteger s = 0; s < self.tableView.numberOfSections; s++) {
184+
for (NSInteger s = 0; s < self.sections.count; s++) {
160185
NSInteger numberOfRows = [self.tableView numberOfRowsInSection:s];
161186

162187
if (numberOfRows != [self.sections[s] cells].count) {
163188
[affectedIndexes addIndex:s];
164189
} else {
165190
for (NSInteger r = 0; r < numberOfRows; r++) {
166191
UITableViewCell *lastCell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:r inSection:s]];
167-
if (![[self.sections[s] cells] containsObject:lastCell]) {
192+
if ([self.tableView.visibleCells containsObject:lastCell] && ![[self.sections[s] cells] containsObject:lastCell]) {
168193
[affectedIndexes addIndex:s];
169194
}
170195
}
@@ -185,32 +210,6 @@ - (void)reloadTableView {
185210
}];
186211
}
187212

188-
- (void)tableView:(UITableView *)tableView willDisplayCell:(BOTableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
189-
[cell _updateAppearance];
190-
[cell updateAppearance];
191-
}
192-
193-
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
194-
BOTableViewCell *cell = (BOTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
195-
196-
if ([cell expansionHeight] > 0) {
197-
self.expansionIndexPath = ![indexPath isEqual:self.expansionIndexPath] ? indexPath : nil;
198-
199-
[self.tableView deselectRowAtIndexPath:indexPath animated:NO];
200-
[self.tableView beginUpdates];
201-
[self.tableView endUpdates];
202-
[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionMiddle animated:YES];
203-
} else if (cell.destinationViewController) {
204-
[self.navigationController pushViewController:cell.destinationViewController animated:YES];
205-
} else if ([cell respondsToSelector:@selector(wasSelectedFromViewController:)]) {
206-
[cell wasSelectedFromViewController:self];
207-
}
208-
209-
if (cell.accessoryType != UITableViewCellAccessoryDisclosureIndicator) {
210-
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
211-
}
212-
}
213-
214213
#pragma mark Dynamic footers
215214

216215
- (NSArray *)footerViews {

BohrDemo/AppDelegate.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
2626

2727
- (void)setupDefaults {
2828
[[NSUserDefaults standardUserDefaults] registerDefaults:@{
29-
@"bool_1": @YES,
29+
@"bool_1": @NO,
3030
@"bool_2": @NO,
3131
@"text": @"",
3232
@"number": @0,

0 commit comments

Comments
 (0)