yysskk / SwipeMenuViewController

Swipable tab and menu View and ViewController.
MIT License
1.29k stars 131 forks source link

Fix willChangeOrientation bug #36

Closed shoheiyokoyama closed 6 years ago

shoheiyokoyama commented 6 years ago

Problem

If willChangeOrientation() called when swipeMenuView is not appeared, layoutSubviews() may not be called. In that case, isLayoutingSubviews keeps to true. various problems occur. For example, updateTabViewAddition(by:) and update(from:to:) will not be called

Ref: https://github.com/yysskk/SwipeMenuViewController/blob/master/Sources/SwipeMenuView.swift#L408

Solution

I added setNeedsLayout() in willChangeOrientation(). layoutSubviews always be called.