Sidemenu: Not working on iOS / iPadOS 14.2 Beta (2)

Created on 4 Oct 2020  路  19Comments  路  Source: jonkykong/SideMenu

Maybe a beta (2) problem, maybe not...

Bug - Help Wanted!

Most helpful comment

Can confirm that it has been fixed with 14.2 beta 3

All 19 comments

symptoms:

  • opening the SideMenu the first time is fine; dismissal is also normal
  • trying to open the SideMenu subsequently does not work; CPU usage goes up to 100%

Likely an iOS 14.2 beta 2 issue; beta 2 has been buggy as hell...

  • no problem on 14.0, 14.0.1, or 14.2 beta 1

Same here! Hopefully it is solved on beta 3

I am under the impression that this is a beta 2 issue and not an issue with SideMenu itself.
Hopefully beta 3 resolves this, but definitely makes it difficult to test certain large aspects of an application, thanks Apple.

Not only does the CPU hover between 99% and 100%, but I have also observed a large growth of memory usage over a long period of time.

My app is functioning fine until I select the button to open the side menu. Once I do, the entire app appears disabled/frozen. Unlike @OIO-WPK, the menu does not open for me once. I tested the SideMenu Example app and am seeing the same behavior that I saw in my own app.

Duplicate of #652

Same Issue - there is a memory leak

Same issue here. This may be an issue caused by a buggy iOS beta, however in order to avoid urgent issues the day of the public release, i would definitely suggest to fix it as soon as possible.

I鈥檇 like to empower anyone here using the beta to investigate a fix for the community.

I will not be updating until the stable build drops.

I got something. If I comment-out transitionController?.layout() in SideMenuNavigationController the menu shows up.

    open override func viewWillLayoutSubviews() {
        super.viewWillLayoutSubviews()
        //transitionController?.layout()
    }

UPDATE: presentingVC.view.untransform {} in containerViewWillLayoutSubviews() in SideMenuPresentaionController causes SideMenuNavigationController to re-layout which will result in an endless loop.

This is a great finding @DanielFontes

Where would you move presentingVC.view.untransform ?

I got something. If I comment-out transitionController?.layout() in SideMenuNavigationController the menu shows up.

    open override func viewWillLayoutSubviews() {
        super.viewWillLayoutSubviews()
        //transitionController?.layout()
    }

UPDATE: presentingVC.view.untransform {} in containerViewWillLayoutSubviews() in SideMenuPresentaionController causes SideMenuNavigationController to re-layout which will result in an endless loop.

Where would you move presentingVC.view.untransform ?

At the moment I just want to figure out why it's causing an endless loop only on iOS 14.2 beta 2 and not before.

Hi, I just resolved this issue, well, maybe only a part, what I made was:
In the class SideMenuPresentationController

  • I comment-out the line that set the width of the Menu's view, line 230
    //rect.size.width = config.menuWidth
  • Set the size of the presentedViewController as follow, same class, line 85, method containerViewWillLayoutSubviews
    presentedViewController.view.frame.size = CGSize(width: config.menuWidth, height:
    presentedViewController.view.frame.height)

Is still crashing me when presente a VC, so, I'm going to searching to a fix.
PD: Sorry for my bad english.

I think it's more of a autolayout bug because after setting the width of the the menu it's always resetting to the device width and this always triggers viewWillLayoutSubviews() -> loop

I tried to disable translatesAutoresizingMaskIntoConstraints for both the menu and the presentingViewController and that causes the menu to show up without 100% CPU usage (but that causes other bugs when you close the menu).

SideMenuPresentationController.swift:

    required init(config: PresentationModel, leftSide: Bool, presentedViewController: UIViewController, presentingViewController: UIViewController, containerView: UIView) {
        self.config = config
        self.containerView = containerView
        self.leftSide = leftSide

        presentedViewController.view.translatesAutoresizingMaskIntoConstraints = false
        presentingViewController.view.translatesAutoresizingMaskIntoConstraints = false

        self.presentedViewController = presentedViewController
        self.presentingViewController = presentingViewController
    }

Yeah, there's a infinite loop in viewWillLayoutSubviews(). It's a temporary way to avoid the crash, at least to my needs, I hope the next beta resolve this issue.

This is my temporary fix: f40c09ec49321f76f1fc4cb87a0fb178cacb410a

Can confirm that it has been fixed with 14.2 beta 3

Can confirm that it has been fixed with 14.2 beta 3

That's great news

Confirmed. Fixed with public beta 3.

Thank you all for you continued updates and support. I am marking this issue as resolved.

Was this page helpful?
0 / 5 - 0 ratings