From 4cb651fb9942f5f87d21ca8792f111cf9581b2ec Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Wed, 3 Apr 2024 23:07:32 +0200 Subject: [PATCH] 0012883: [APP iOS] After rotation, the app are frozen --- Classes/LinphoneUI/UICompositeView.m | 6 ++++-- .../Swift/Extensions/IOS/UIVIewExtensions.swift | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Classes/LinphoneUI/UICompositeView.m b/Classes/LinphoneUI/UICompositeView.m index 197b9be2e..eb4808108 100644 --- a/Classes/LinphoneUI/UICompositeView.m +++ b/Classes/LinphoneUI/UICompositeView.m @@ -269,7 +269,8 @@ UIViewController *controller = nil; controller = [[UIApplication sharedApplication] keyWindow].rootViewController; - CGRect frame = [[UIScreen mainScreen] bounds]; + //CGRect frame = [[UIScreen mainScreen] bounds]; + [[controller.view removeConstraints] done]; UIInterfaceOrientation oldOrientation = controller.interfaceOrientation; NSTimeInterval animationDuration = animated ? 0.3f : 0.0; @@ -279,7 +280,8 @@ [controller didRotateFromInterfaceOrientation:oldOrientation]; [UIView animateWithDuration:animationDuration animations:^{ - [controller.view setFrame:frame]; + [[controller.view matchParentDimmensions] done]; + //[controller.view setFrame:frame]; }]; if (firstResponder == nil) { diff --git a/Classes/Swift/Extensions/IOS/UIVIewExtensions.swift b/Classes/Swift/Extensions/IOS/UIVIewExtensions.swift index c05b9c7e6..217e0e0a2 100644 --- a/Classes/Swift/Extensions/IOS/UIVIewExtensions.swift +++ b/Classes/Swift/Extensions/IOS/UIVIewExtensions.swift @@ -25,7 +25,7 @@ extension UIView { // Few constraints wrapper to abstract SnapKit functions - func removeConstraints() -> UIView { + @objc func removeConstraints() -> UIView { snp.removeConstraints() return self } @@ -144,7 +144,16 @@ extension UIView { return self } - func matchParentDimmensions() -> UIView { + + func matchLeftBordersOf(view:UIView) -> UIView { + snp.makeConstraints { (make) in + make.left.equalTo(view) + } + return self + } + + + @objc func matchParentDimmensions() -> UIView { snp.makeConstraints { (make) in make.left.right.top.bottom.equalToSuperview() } @@ -464,7 +473,7 @@ extension UIView { return self } - func done() { + @objc func done() { // to avoid the unused variable warning }