From 38a7c9faf6b4033a1532ae9e65461bad997aa9f2 Mon Sep 17 00:00:00 2001 From: Fabio Donatelli Date: Mon, 5 Sep 2016 15:34:35 +0200 Subject: [PATCH 1/2] added initWithCoder method initialization --- BZGFormViewController/BZGFormViewController.m | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/BZGFormViewController/BZGFormViewController.m b/BZGFormViewController/BZGFormViewController.m index e8ea6e3..8bf0dcf 100644 --- a/BZGFormViewController/BZGFormViewController.m +++ b/BZGFormViewController/BZGFormViewController.m @@ -45,6 +45,17 @@ - (id)initWithStyle:(UITableViewStyle)style return self; } +- (instancetype)initWithCoder:(NSCoder *)coder +{ + self = [super initWithCoder:coder]; + if (self) { + _formCellsBySection = [NSMutableArray array]; + _style = UITableViewStyleGrouped; + _showsValidationCell = YES; + } + return self; +} + - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; From 61fc24adcfacb6b76d9d021ab379ae7351952018 Mon Sep 17 00:00:00 2001 From: Fabio Donatelli Date: Tue, 6 Sep 2016 11:41:48 +0200 Subject: [PATCH 2/2] correct scrollview insets when changing first responder between cells. It could resolve issue #49 --- BZGFormViewController/BZGFormViewController.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BZGFormViewController/BZGFormViewController.m b/BZGFormViewController/BZGFormViewController.m index 8bf0dcf..d419693 100644 --- a/BZGFormViewController/BZGFormViewController.m +++ b/BZGFormViewController/BZGFormViewController.m @@ -316,6 +316,10 @@ - (void)textFieldDidEndEditing:(UITextField *)textField } [self updateInfoCellBelowFormCell:cell]; + + [UIView animateWithDuration:0.3 animations:^{ + [self.tableView setContentInset:UIEdgeInsetsZero]; + }]; } - (BOOL)textFieldShouldReturn:(UITextField *)textField