[ios] Switching to iOS 15 as the minimum

Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
Yannik Bloscheck
2025-06-24 16:14:33 +02:00
committed by Konstantin Pastbin
parent 35cda6d342
commit 78b54acad4
22 changed files with 52 additions and 89 deletions

View File

@@ -210,6 +210,9 @@ static NSString *const kAlertControllerNibIdentifier = @"MWMAlertViewController"
- (void)displayAlert:(MWMAlert *)alert {
UIViewController *ownerVC = self.ownerViewController;
if (ownerVC.navigationController != nil) {
ownerVC = self.ownerViewController.navigationController;
}
BOOL isOwnerLoaded = ownerVC.isViewLoaded;
if (!isOwnerLoaded) {
return;
@@ -234,10 +237,19 @@ static NSString *const kAlertControllerNibIdentifier = @"MWMAlertViewController"
}
completion:nil];
[self willMoveToParentViewController:NULL];
[self.view removeFromSuperview];
[self removeFromParentViewController];
alert.alertController = self;
[ownerVC addChildViewController:self];
self.view.frame = CGRectMake(0, 0, ownerVC.view.frame.size.width, ownerVC.view.frame.size.height);
[ownerVC.view addSubview:self.view];
[self didMoveToParentViewController:ownerVC];
alert.alpha = 0.;
[self.view addSubview:alert];
CGFloat const scale = 1.1;
alert.transform = CGAffineTransformMakeScale(scale, scale);
[UIView animateWithDuration:kDefaultAnimationDuration

View File

@@ -222,19 +222,6 @@
view.frame = window.bounds;
}
- (void)setAlertController:(MWMAlertViewController *)alertController {
_alertController = alertController;
UIView *view = alertController.view;
UIViewController *ownerViewController = alertController.ownerViewController;
view.frame = ownerViewController.view.bounds;
[ownerViewController.view addSubview:view];
[self addControllerViewToWindow];
auto const orientation = UIApplication.sharedApplication.statusBarOrientation;
[self rotate:orientation duration:0.0];
[view addSubview:self];
self.frame = view.bounds;
}
- (void)layoutSubviews {
[super layoutSubviews];
self.frame = self.superview.bounds;

View File

@@ -70,7 +70,7 @@ final class Toast: NSObject {
private func show(withAlignment alignment: Alignment, pinToSafeArea: Bool) {
Self.hideAll()
guard let view = UIApplication.shared.keyWindow else { return }
guard let view = (UIApplication.shared.connectedScenes.filter { $0.activationState == .foregroundActive }.first(where: { $0 is UIWindowScene }) as? UIWindowScene)?.keyWindow else { return }
view.addSubview(blurView)
let leadingConstraint = blurView.leadingAnchor.constraint(greaterThanOrEqualTo: view.leadingAnchor, constant: Constants.horizontalOffset)