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

Commit

Permalink
3.0.0-alpha.3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
davdroman committed Aug 29, 2015
1 parent 28b11c1 commit 9da76aa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Bohr.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Bohr"
s.version = "3.0.0-alpha.2"
s.version = "3.0.0-alpha.3"
s.summary = "Settings screen composing framework"
s.homepage = "https://github.com/DavdRoman/Bohr"
s.author = { "David Román" => "[email protected]" }
Expand Down
4 changes: 1 addition & 3 deletions Bohr/BODateTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ - (void)setup {
}

- (CGFloat)expansionHeight {
// Uncomment if the picker view doesn't show on iOS 9.
// return 216;
return [super expansionHeight];
return 216;
}

- (void)setDateFormat:(NSString *)dateFormat {
Expand Down
4 changes: 2 additions & 2 deletions Bohr/BOTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ - (instancetype)initWithTitle:(NSString *)title key:(NSString *)key handler:(voi
}

- (void)didMoveToSuperview {
if (self.superview && self.expansionView) {
if (self.expansionView && !self.expansionView.superview) {
[self.contentView addSubview:self.expansionView];

NSLayoutConstraint *topConstraint = [NSLayoutConstraint constraintWithItem:self.expansionView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.expansionView.superview attribute:NSLayoutAttributeTopMargin multiplier:1 constant:0];
Expand All @@ -59,7 +59,7 @@ + (instancetype)cellWithTitle:(NSString *)title key:(NSString *)key handler:(voi
- (void)layoutSubviews {
[super layoutSubviews];

if ([self expansionView]) {
if ([self expansionHeight] > 0) {
CGFloat yOffset = (self.layoutMargins.top-self.frame.size.height)/2;

self.textLabel.center = CGPointMake(self.textLabel.center.x, self.textLabel.center.y+yOffset);
Expand Down
9 changes: 4 additions & 5 deletions Bohr/BOTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
BOTableViewSection *section = self.sections[indexPath.section];
BOTableViewCell *cell = section.cells[indexPath.row];
CGFloat cellHeight = [cell systemLayoutSizeFittingSize:CGSizeMake(cell.contentView.frame.size.width, UITableViewAutomaticDimension)].height;
CGFloat cellHeight = [cell.contentView systemLayoutSizeFittingSize:CGSizeMake(cell.contentView.frame.size.width, UITableViewAutomaticDimension)].height;

if (cellHeight < self.tableView.estimatedRowHeight) {
cellHeight = self.tableView.estimatedRowHeight;
} else {
Expand All @@ -121,15 +121,14 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
BOTableViewSection *section = self.sections[indexPath.section];
BOTableViewCell *cell = section.cells[indexPath.row];
cell.indexPath = indexPath;
[cell prepareForReuse];

if (cell.setting && !cell.setting.valueDidChangeBlock) {
[UIView performWithoutAnimation:^{
__unsafe_unretained typeof(self) weakSelf = self;
__unsafe_unretained typeof(cell) weakCell = cell;
cell.setting.valueDidChangeBlock = ^{
[weakSelf reloadTableView];
[weakCell settingValueDidChange];
[weakSelf reloadTableView];
};
}];
}
Expand Down Expand Up @@ -205,7 +204,7 @@ - (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInte
// Finally, we try to find an existing footer in any cell that has a checkmark accessory on it (this is the top priority for dynamic footers).
for (BOTableViewCell *cell in section.cells) {
if (cell.accessoryType == UITableViewCellAccessoryCheckmark) {
footerTitle = [cell footerTitle];
footerTitle = cell.footerTitle;
}
}

Expand Down

0 comments on commit 9da76aa

Please sign in to comment.