|
@@ -16,7 +16,19 @@
|
|
|
|
|
|
#import "UIViewController+Extensions.h"
|
|
|
|
|
|
-@implementation UIViewController (ShowAlert)
|
|
|
+@implementation UIViewController (Extensions)
|
|
|
+
|
|
|
+- (void)onDelay:(float)delay action:(void (^)(void))block {
|
|
|
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC*0.1), dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), block);
|
|
|
+}
|
|
|
+
|
|
|
+- (BOOL)boolForSetting:(NSString *)key {
|
|
|
+ return [[NSUserDefaults standardUserDefaults] boolForKey:key];
|
|
|
+}
|
|
|
+
|
|
|
+- (NSInteger)integerForSetting:(NSString *)key {
|
|
|
+ return [[NSUserDefaults standardUserDefaults] integerForKey:key];
|
|
|
+}
|
|
|
|
|
|
- (void)showAlert:(NSString *)msg actions:(nullable NSArray<UIAlertAction *> *)actions completion:(nullable void (^)(UIAlertAction *action))completion {
|
|
|
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"" message:msg preferredStyle:UIAlertControllerStyleAlert];
|