Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pickerの位置表示の処理を修正 #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions OneTimePasswordExample/SettingController.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ - (void)viewDidLoad {
self.algorithmPatterns = @[@"SHA1", @"SHA256", @"SHA512"];
self.digitsPatterns = @[@"4", @"5", @"6", @"7", @"8", @"9", @"10"];
self.periodPatterns = @[@"30", @"60"];

[self tableView:self.tableView didSelectRowAtIndexPath:[NSIndexPath indexPathForRow: 0 inSection: 0]];
}

#pragma mark - Table view data source
Expand Down Expand Up @@ -90,11 +92,10 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// FIXME: タップしても反応しないことがある
self.settingsItem = indexPath.row;
NSInteger selectRow = [self pickerSelectRowWithItem:self.settingsItem];
[self.pickerView selectRow:selectRow inComponent:0 animated:true];
[self.pickerView reloadAllComponents];
[self.pickerView selectRow:selectRow inComponent:0 animated:true];
}

#pragma mark - Picker view data source
Expand Down