Friend-LGA / LGSideMenuController

iOS view controller which manages left and right side views
MIT License
2.05k stars 331 forks source link

iOS 18.0 Beta Crash #210

Closed rob-malvisi closed 1 month ago

rob-malvisi commented 4 months ago

Taping on a menu item in iOS 18.0 causes a crash, with

Thread 1: EXC_BAD_ACCESS (code=1, address=0x309534ce4d7db0)

in LGSideMenuController line 354

the line being

_rootView?.removeFromSuperview()

We are calling it as (crashes on the second line):

let rootViewController = LocationsNavigationViewController()
sideMenuController.rootViewController = rootViewController

Interestingly, it does not always crash, it seems leaving the side menu open for 5 - 10s then tapping an item avoids the crash.

Any assistance gratefully received, many thanks.

rob-malvisi commented 1 month ago

Just to add this also happens on the release iOS 18.0

rob-malvisi commented 1 month ago

For anyone experiencing the same issue, it was solved by setting a rootView before the rootViewController:

let rootViewController = LocationsNavigationViewController() sideMenuController.rootView = rootViewController.view sideMenuController.rootViewController = rootViewController