Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:peterhajas/Genesis

  • Loading branch information...
commit de1f7f0bd76a8a9f5696da65158d3db66846bbe6 2 parents cdb92b1 + bc6dfd3
Jeff Hui authored
Showing with 13 additions and 1 deletion.
  1. +13 −1 iOS/Genesis/Genesis/GNNewProjectViewController.m
View
14 iOS/Genesis/Genesis/GNNewProjectViewController.m
@@ -30,7 +30,19 @@ -(BOOL)textFieldShouldReturn:(UITextField *)textField
// If the text of the text field isn't blank
if(![[textField text] isEqualToString:@""])
{
- // TODO: Make sure this isn't a project that's already been made! Check for unique names!
+ if([GNFileManager entryExistsAtRelativePath:[textField text]
+ isDirectory:YES])
+ {
+ // A project exists at this directory!
+ UIAlertView* duplicateAlert = [[UIAlertView alloc] initWithTitle:@"Duplicate Project Name!"
+ message:@"A project with that name already exists. Pick a new name."
+ delegate:nil
+ cancelButtonTitle:@"Got it."
+ otherButtonTitles:nil];
+ [duplicateAlert show];
+ return YES;
+ }
+
// Create the new project
GNAppDelegate* appDelegate = (GNAppDelegate*)[[UIApplication sharedApplication] delegate];
Please sign in to comment.
Something went wrong with that request. Please try again.