Skip to content

Instantly share code, notes, and snippets.

@haldun
Created January 23, 2014 14:21
Show Gist options
  • Save haldun/8579213 to your computer and use it in GitHub Desktop.
Save haldun/8579213 to your computer and use it in GitHub Desktop.
- (BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender
{
if ([identifier isEqualToString:@"NewPhotoAdded"]) {
if ([self.titleTextField.text length] == 0) {
[self alert:@"Title'i doldur haci"];
return NO;
}
if ([self.remoteIDTextField.text length] == 0) {
[self alert:@"remote id'yi doldur haci"];
return NO;
}
return YES;
}
return [super shouldPerformSegueWithIdentifier:identifier sender:sender];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
if ([segue.identifier isEqualToString:@"NewPhotoAdded"]) {
self.photo = [[FZMPhoto alloc] init];
self.photo.title = self.titleTextField.text;
self.photo.remoteIdentifier = self.remoteIDTextField.text;
self.photo.remoteURL = self.remoteURLTextField.text;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment