mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-24 06:53:46 +00:00
[ios] Switching to iOS 15 as the minimum
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
35cda6d342
commit
78b54acad4
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user