Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
|
|
@ -0,0 +1,39 @@
|
|||
#import "MWMLocationAlert.h"
|
||||
#import "MWMAlertViewController.h"
|
||||
|
||||
static NSString * const kLocationAlertNibName = @"MWMLocationAlert";
|
||||
|
||||
@interface MWMLocationAlert ()
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIButton * rightButton;
|
||||
@property (nullable, nonatomic) MWMVoidBlock cancelBlock;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MWMLocationAlert
|
||||
|
||||
+ (instancetype)alertWithCancelBlock:(MWMVoidBlock)cancelBlock
|
||||
{
|
||||
MWMLocationAlert * alert =
|
||||
[NSBundle.mainBundle loadNibNamed:kLocationAlertNibName owner:nil options:nil].firstObject;
|
||||
[alert setNeedsCloseAlertAfterEnterBackground];
|
||||
alert.cancelBlock = cancelBlock;
|
||||
return alert;
|
||||
}
|
||||
|
||||
- (IBAction)settingsTap
|
||||
{
|
||||
[self close:^{
|
||||
NSURL * url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
|
||||
UIApplication * a = UIApplication.sharedApplication;
|
||||
if ([a canOpenURL:url])
|
||||
[a openURL:url options:@{} completionHandler:nil];
|
||||
}];
|
||||
}
|
||||
|
||||
- (IBAction)closeTap
|
||||
{
|
||||
[self close:self.cancelBlock];
|
||||
}
|
||||
|
||||
@end
|
||||
Loading…
Add table
Add a link
Reference in a new issue