diff --git a/shell/ios/emulator.xcodeproj/project.pbxproj b/shell/ios/emulator.xcodeproj/project.pbxproj index 299711b95..1644ade19 100644 --- a/shell/ios/emulator.xcodeproj/project.pbxproj +++ b/shell/ios/emulator.xcodeproj/project.pbxproj @@ -1463,6 +1463,7 @@ 87078A7F18A47FE90034C7A0 /* Sources */, 87078A8018A47FE90034C7A0 /* Frameworks */, 87078A8118A47FE90034C7A0 /* Resources */, + 9C7A3C2518C85A080070BB5F /* ShellScript */, ); buildRules = ( ); @@ -1557,6 +1558,22 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 9C7A3C2518C85A080070BB5F /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "GIT=`which git`\nif [ \"$GIT\" -a -d .git ]; then\nGIT_VERSION=`$GIT describe --tags --always`\nelse\nGIT_VERSION=unknown\nfi\ndefaults write $BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Info GitVersionString -string $GIT_VERSION"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 87078A7F18A47FE90034C7A0 /* Sources */ = { isa = PBXSourcesBuildPhase; diff --git a/shell/ios/emulator/AboutViewController.h b/shell/ios/emulator/AboutViewController.h index e08e1c2a7..b38c04f18 100644 --- a/shell/ios/emulator/AboutViewController.h +++ b/shell/ios/emulator/AboutViewController.h @@ -8,6 +8,9 @@ #import -@interface AboutViewController : UITableViewController +@interface AboutViewController : UITableViewController { + IBOutlet UILabel *versionLabel; +} +@property (weak, nonatomic) IBOutlet UIBarButtonItem *sidebarButton; @end diff --git a/shell/ios/emulator/AboutViewController.m b/shell/ios/emulator/AboutViewController.m index 1fe5e9ee8..89a53f2c7 100644 --- a/shell/ios/emulator/AboutViewController.m +++ b/shell/ios/emulator/AboutViewController.m @@ -7,6 +7,7 @@ // #import "AboutViewController.h" +#import "SWRevealViewController.h" @interface AboutViewController () @@ -26,7 +27,16 @@ - (void)viewDidLoad { [super viewDidLoad]; - + self.title = @"About"; + + versionLabel.text = [NSBundle mainBundle].infoDictionary[@"GitVersionString"]; + + // Set the side bar button action. When it's tapped, it'll show up the sidebar. + _sidebarButton.target = self.revealViewController; + _sidebarButton.action = @selector(revealToggle:); + + // Set the gesture + [self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer]; // Uncomment the following line to preserve selection between presentations. // self.clearsSelectionOnViewWillAppear = NO; @@ -42,79 +52,32 @@ #pragma mark - Table view data source -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { -#warning Potentially incomplete method implementation. - // Return the number of sections. - return 0; + NSArray *developerTwitters = @[@"angelXwind"/*, @"LoungeKatt"*/]; //@LoungeKatt is private, so not linking it to the About dialog. + NSArray *githubframeworks = @[@"John-Lluch/SWRevealViewController"]; + if (indexPath.section == 0 && indexPath.row == 0) //@reicastdc twitter + { + NSURL *twitterURL = [NSURL URLWithString:[NSString stringWithFormat:@"twitter://user?screen_name=reicastdc"]]; + if ([[UIApplication sharedApplication] canOpenURL:twitterURL]) + [[UIApplication sharedApplication] openURL:twitterURL]; + else + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://twitter.com/reicastdc"]]]; + } else if (indexPath.section == 0 && indexPath.row == 1) //reicast github + { + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://github.com/reicast/reicast-emulator/"]]]; + } else if (indexPath.section == 1 && indexPath.row < developerTwitters.count) //developer twitter accounts + { + NSURL *twitterURL = [NSURL URLWithString:[NSString stringWithFormat:@"twitter://user?screen_name=%@", developerTwitters[indexPath.row]]]; + if ([[UIApplication sharedApplication] canOpenURL:twitterURL]) + [[UIApplication sharedApplication] openURL:twitterURL]; + else + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://twitter.com/%@", developerTwitters[indexPath.row]]]]; + } else if (indexPath.section == 2 && indexPath.row < githubframeworks.count) //third-party frameworks + { + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://github.com/%@", githubframeworks[indexPath.row]]]]; + } + [tableView deselectRowAtIndexPath:indexPath animated:YES]; } -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section -{ -#warning Incomplete method implementation. - // Return the number of rows in the section. - return 0; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath -{ - static NSString *CellIdentifier = @"Cell"; - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; - - // Configure the cell... - - return cell; -} - -/* -// Override to support conditional editing of the table view. -- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath -{ - // Return NO if you do not want the specified item to be editable. - return YES; -} -*/ - -/* -// Override to support editing the table view. -- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath -{ - if (editingStyle == UITableViewCellEditingStyleDelete) { - // Delete the row from the data source - [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; - } - else if (editingStyle == UITableViewCellEditingStyleInsert) { - // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view - } -} -*/ - -/* -// Override to support rearranging the table view. -- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath -{ -} -*/ - -/* -// Override to support conditional rearranging of the table view. -- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath -{ - // Return NO if you do not want the item to be re-orderable. - return YES; -} -*/ - -/* -#pragma mark - Navigation - -// In a story board-based application, you will often want to do a little preparation before navigation -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender -{ - // Get the new view controller using [segue destinationViewController]. - // Pass the selected object to the new view controller. -} - - */ - @end diff --git a/shell/ios/emulator/EmulatorViewController.h b/shell/ios/emulator/EmulatorViewController.h index 2c3bc14e4..eed451c48 100644 --- a/shell/ios/emulator/EmulatorViewController.h +++ b/shell/ios/emulator/EmulatorViewController.h @@ -10,6 +10,5 @@ #import @interface ViewController : GLKViewController -@property (weak, nonatomic) IBOutlet UIBarButtonItem *sidebarButton; @end diff --git a/shell/ios/emulator/InputViewController.h b/shell/ios/emulator/InputViewController.h index 8c4eaa661..7f7547f4a 100644 --- a/shell/ios/emulator/InputViewController.h +++ b/shell/ios/emulator/InputViewController.h @@ -9,5 +9,6 @@ #import @interface InputViewController : UITableViewController +@property (weak, nonatomic) IBOutlet UIBarButtonItem *sidebarButton; @end diff --git a/shell/ios/emulator/InputViewController.m b/shell/ios/emulator/InputViewController.m index 3606de9c9..00e7a1d53 100644 --- a/shell/ios/emulator/InputViewController.m +++ b/shell/ios/emulator/InputViewController.m @@ -7,6 +7,7 @@ // #import "InputViewController.h" +#import "SWRevealViewController.h" @interface InputViewController () @@ -26,7 +27,14 @@ - (void)viewDidLoad { [super viewDidLoad]; - + self.title = @"Input"; + + // Set the side bar button action. When it's tapped, it'll show up the sidebar. + _sidebarButton.target = self.revealViewController; + _sidebarButton.action = @selector(revealToggle:); + + // Set the gesture + [self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer]; // Uncomment the following line to preserve selection between presentations. // self.clearsSelectionOnViewWillAppear = NO; @@ -42,79 +50,6 @@ #pragma mark - Table view data source -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView -{ -#warning Potentially incomplete method implementation. - // Return the number of sections. - return 0; -} - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section -{ -#warning Incomplete method implementation. - // Return the number of rows in the section. - return 0; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath -{ - static NSString *CellIdentifier = @"Cell"; - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; - - // Configure the cell... - - return cell; -} - -/* -// Override to support conditional editing of the table view. -- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath -{ - // Return NO if you do not want the specified item to be editable. - return YES; -} -*/ - -/* -// Override to support editing the table view. -- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath -{ - if (editingStyle == UITableViewCellEditingStyleDelete) { - // Delete the row from the data source - [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; - } - else if (editingStyle == UITableViewCellEditingStyleInsert) { - // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view - } -} -*/ - -/* -// Override to support rearranging the table view. -- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath -{ -} -*/ - -/* -// Override to support conditional rearranging of the table view. -- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath -{ - // Return NO if you do not want the item to be re-orderable. - return YES; -} -*/ - -/* -#pragma mark - Navigation - -// In a story board-based application, you will often want to do a little preparation before navigation -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender -{ - // Get the new view controller using [segue destinationViewController]. - // Pass the selected object to the new view controller. -} - - */ +// TODO: write the rest of the view controller logic @end diff --git a/shell/ios/emulator/MainStoryboard.storyboard b/shell/ios/emulator/MainStoryboard.storyboard index 6df1c8e37..85ebdf582 100644 --- a/shell/ios/emulator/MainStoryboard.storyboard +++ b/shell/ios/emulator/MainStoryboard.storyboard @@ -26,9 +26,6 @@ - - -