dekatotoro / dekatotoro/SlideMenuControllerSwift

UI is not responding if awakeFromNib is called twice

Open
#261 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
3.4k
Forks
742
PR merge metrics
No merged PRs in 30d

Description

I have a project, where SlideMenuController's `awakeFromNib` is called twice during initialization.
Because of this, container views (`mainContainerView`, `leftContainerView`) are creating twice so that the last one is covering the screen making UI inaccessible.

A simple workaround for this could be removing container views before initialization to avoid duplicates:
```
open func initView() {
for subview in view.subviews {
subview.removeFromSuperview()
}

...
```

or, better:
```
open func initView() {
mainContainerView.removeFromSuperview()
opacityView.removeFromSuperview()
leftContainerView.removeFromSuperview()
rightContainerView.removeFromSuperview()

...
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at SlideMenuController's awakeFromNib and initView entry points, then inspect how mainContainerView, leftContainerView, rightContainerView, and opacityView are created. Reproduce the double initialization and ensure the container views are not duplicated or left covering the UI; the issue mentions no specific test file.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
mobile
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.