Skip to content

Commit

Permalink
Merge "simplify Bug: 36211867"
Browse files Browse the repository at this point in the history
  • Loading branch information
ulukaya authored and Gerrit Code Review committed Mar 16, 2017
2 parents d5791c8 + 9e730dd commit 8776500
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
26 changes: 3 additions & 23 deletions invites/InvitesExample/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -139,30 +139,10 @@ - (IBAction)inviteTapped:(id)sender {

// [START invite_finished]
- (void)inviteFinishedWithInvitations:(NSArray *)invitationIds error:(NSError *)error {
NSString *message =
error ? error.localizedDescription
: [NSString stringWithFormat:@"%lu invites sent", (unsigned long)invitationIds.count];

if ([UIAlertController class]) {
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
NSLog(@"OK");
}];

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Done"
message:message
preferredStyle:UIAlertControllerStyleAlert];
[alertController addAction:okAction];
[self presentViewController:alertController
animated:YES
completion:nil];
if (error) {
NSLog(@"%@", error.localizedDescription);
} else {
[[[UIAlertView alloc] initWithTitle:@"Done"
message:message
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil] show];
NSLog(@"%lu invites sent", (unsigned long)invitationIds.count);
}
}
// [END invite_finished]
Expand Down
2 changes: 1 addition & 1 deletion invites/InvitesExampleSwift/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class ViewController: UIViewController, GIDSignInDelegate, GIDSignInUIDelegate,
if let error = error {
print("Failed: " + error.localizedDescription)
} else {
print("Invitations sent")
print("\(invitationIds.count) invites sent")
}
}
// [END invite_finished]
Expand Down

0 comments on commit 8776500

Please sign in to comment.