Fix build #2

Merged
kirb merged 5 commits from master into master 2021-09-06 02:59:58 -07:00
2 changed files with 31 additions and 0 deletions
Showing only changes of commit 47e20ddb99 - Show all commits

View file

@ -8,6 +8,12 @@
#import <UIKit/UIKit.h>
@interface UIAlertController (Private)
@property (nonatomic, retain) UIViewController *contentViewController;
@end
@interface UIAlertAction (Common)
+ (UIAlertAction *)okAction;
+ (UIAlertAction *)okActionWithHandler:(void (^)(UIAlertAction *action))handler;

View file

@ -114,6 +114,31 @@ NSString *backupNameSelected;
alertControllerWithTitle:@"Restoring from backup"
message:@"Your device will respring when the process is completed."
preferredStyle:UIAlertControllerStyleAlert];
UIActivityIndicatorViewStyle indicatorStyle = UIActivityIndicatorViewStyleGray;
if (@available(iOS 13, *)) {
indicatorStyle = UIActivityIndicatorViewStyleMedium;
}
UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:indicatorStyle];
activityIndicator.translatesAutoresizingMaskIntoConstraints = NO;
[activityIndicator startAnimating];
finishedRestoreAlert.contentViewController = [[UIViewController alloc] init];
[finishedRestoreAlert.contentViewController.view addSubview:activityIndicator];
[NSLayoutConstraint activateConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[activityIndicator]|"
options:kNilOptions
metrics:nil
views:@{
@"activityIndicator": activityIndicator
}]];
[NSLayoutConstraint activateConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[activityIndicator]|"
options:kNilOptions
metrics:nil
views:@{
@"activityIndicator": activityIndicator
}]];
[self presentViewController:finishedRestoreAlert animated:YES completion:nil];
//RUN RESTORE SCRIPT