0012883: [APP iOS] After rotation, the app are frozen

This commit is contained in:
Christophe Deschamps 2024-04-03 23:07:32 +02:00
parent fca995470f
commit 4cb651fb99
2 changed files with 16 additions and 5 deletions

View file

@ -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) {

View file

@ -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
}