Skip to content

Commit 96de25f

Browse files
committed
Set correct field as first responder
1 parent f33aa7e commit 96de25f

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

BitStore/Controller/Account/Send/SendViewController.m

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ - (void)viewWillAppear:(BOOL)animated {
8383
[[PiwikTracker sharedInstance] sendViews:@"Send", nil];
8484
}
8585

86-
- (void)viewDidAppear:(BOOL)animated {
87-
[_addressField becomeFirstResponder];
88-
}
89-
9086
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
9187
return 1;
9288
}
@@ -110,7 +106,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
110106
_addressField.clearButtonMode = UITextFieldViewModeWhileEditing;
111107
_addressField.returnKeyType = UIReturnKeyNext;
112108
_addressField.borderStyle = UITextBorderStyleRoundedRect;
113-
[_addressField becomeFirstResponder];
114109
[cell.contentView addSubview:_addressField];
115110

116111
UIButton* scanButton = [[UIButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width - 44, 14, 32, 32)];
@@ -136,6 +131,12 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
136131
if (_initAddress && _addressField.text.length == 0 && _amountView.amountField.text.length == 0) {
137132
[self setAddress:_initAddress amount:_initAmount];
138133
}
134+
135+
if (_initAddress) {
136+
[_amountView becomeFirstResponder];
137+
} else {
138+
[_addressField becomeFirstResponder];
139+
}
139140
}
140141
return cell;
141142
}

0 commit comments

Comments
 (0)