Last active
May 26, 2018 23:17
-
-
Save alexpaul/a386f19fc583a2f1045df91e0551b2eb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // UIViewController+Additions.h | |
| // Events | |
| // | |
| // Created by Alex Paul on 5/26/18. | |
| // Copyright © 2018 Alex Paul. All rights reserved. | |
| // | |
| #import <UIKit/UIKit.h> | |
| @interface UIViewController (Additions) | |
| - (void)showAlertWithTitle:(NSString *)title andMessage:(NSString *)message; | |
| - (void)showAcitivityControllerWithURLLink:(NSString *)urlLink; | |
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // UIViewController+Additions.m | |
| // Events | |
| // | |
| // Created by Alex Paul on 5/26/18. | |
| // Copyright © 2018 Alex Paul. All rights reserved. | |
| // | |
| #import "UIViewController+Additions.h" | |
| @implementation UIViewController (Alerts) | |
| - (void)showAlertWithTitle:(NSString *)title andMessage:(NSString *)message { | |
| UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert]; | |
| UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:nil]; | |
| [alertController addAction:okAction]; | |
| [self presentViewController:alertController animated:YES completion:nil]; | |
| } | |
| - (void)showAcitivityControllerWithURLLink:(NSString *)urlLink { | |
| UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:@[urlLink] applicationActivities:nil]; | |
| [self presentViewController:activityController animated:YES completion:nil]; | |
| } | |
| @end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment