Skip to content

Commit fff93cb

Browse files
committed
Added option to disable tapToEndEditing
1 parent 7bee145 commit fff93cb

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

PAYFormBuilder/controller/PAYFormTableViewController.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@
1717
*/
1818
@interface PAYFormTableViewController : UITableViewController
1919

20+
/**
21+
* If tapping on the background of the form (i.e. outside of a cell) should dismiss the keyboard/end editing.
22+
*
23+
* Enabled by default. Must be updated in the `initForm` method to be applied.
24+
*/
25+
@property (nonatomic, assign) BOOL tapToEndEditing;
26+
2027
/**
2128
* This method could be overriden by the subclass to configure the form table view controller.
2229
* For example a custom footer could be set. This is method is only called once after the view

PAYFormBuilder/controller/PAYFormTableViewController.m

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ @interface PAYFormTableViewController ()
2626

2727
@implementation PAYFormTableViewController
2828

29+
- (instancetype)init
30+
{
31+
self = [super init];
32+
if (self) {
33+
_tapToEndEditing = YES;
34+
}
35+
return self;
36+
}
37+
2938
- (void)loadView {
3039
self.tableView = [[PAYFormTableView alloc] initWithFrame:CGRectZero
3140
style:UITableViewStyleGrouped];
@@ -46,8 +55,11 @@ - (void)viewDidLoad {
4655
[self loadStructure];
4756

4857
[super viewDidLoad];
49-
50-
[self.tableView enableTapToEndEditing];
58+
59+
if (self.tapToEndEditing)
60+
{
61+
[self.tableView enableTapToEndEditing];
62+
}
5163

5264
[self buildFooter];
5365
}

0 commit comments

Comments
 (0)