diff --git a/ios/RetroArch/RetroArch_iOS.h b/ios/RetroArch/RetroArch_iOS.h index c9cd7f427a..3d55e4069e 100644 --- a/ios/RetroArch/RetroArch_iOS.h +++ b/ios/RetroArch/RetroArch_iOS.h @@ -17,6 +17,7 @@ @property (strong, nonatomic) NSString *nib_name; @property (strong, nonatomic) UIImage* file_icon; @property (strong, nonatomic) UIImage* folder_icon; +@property (strong, nonatomic) UIBarButtonItem* settings_button; @property const char* system_directory; diff --git a/ios/RetroArch/RetroArch_iOS.m b/ios/RetroArch/RetroArch_iOS.m index 26acd373d2..f69f5c56e4 100644 --- a/ios/RetroArch/RetroArch_iOS.m +++ b/ios/RetroArch/RetroArch_iOS.m @@ -34,9 +34,16 @@ extern uint32_t ios_current_touch_count ; bool is_iphone = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone; self.nib_name = is_iphone ? @"ViewController_iPhone" : @"ViewController_iPad"; + // Load icons self.file_icon = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"ic_file" ofType:@"png"]]; self.folder_icon = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"ic_dir" ofType:@"png"]]; + // Load buttons + self.settings_button = [[UIBarButtonItem alloc] + initWithTitle:@"Settings" + style:UIBarButtonItemStyleBordered + target:nil action:nil]; + self.navigator = [[UINavigationController alloc] initWithNibName:self.nib_name bundle:nil]; [self.navigator pushViewController: [[module_list alloc] initWithNibName:self.nib_name bundle:nil] animated:YES]; diff --git a/ios/RetroArch/directory_list.m b/ios/RetroArch/directory_list.m index 33a3e8f5f4..62aa9397a3 100644 --- a/ios/RetroArch/directory_list.m +++ b/ios/RetroArch/directory_list.m @@ -25,7 +25,7 @@ free(path); path = strdup(directory); - [self setTitle: [[NSString alloc] initWithUTF8String:directory]]; + [self setTitle: [[[NSString alloc] initWithUTF8String:directory] lastPathComponent]]; return self; } @@ -44,11 +44,7 @@ table.dataSource = self; table.delegate = self; - self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] - initWithTitle:@"Parent" - style:UIBarButtonItemStyleBordered - target:nil action:nil]; - + self.navigationItem.rightBarButtonItem = [RetroArch_iOS get].settings_button; self.view = table; } diff --git a/ios/RetroArch/module_list.m b/ios/RetroArch/module_list.m index 15369f55fc..68ed5ee5a0 100644 --- a/ios/RetroArch/module_list.m +++ b/ios/RetroArch/module_list.m @@ -50,10 +50,7 @@ table.delegate = self; self.view = table; - self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] - initWithTitle:@"Parent" - style:UIBarButtonItemStyleBordered - target:nil action:nil]; + self.navigationItem.rightBarButtonItem = [RetroArch_iOS get].settings_button; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath