This repository was archived by the owner on Jun 17, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed
Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -175,16 +175,22 @@ open class PagingMenuController: UIViewController {
175175 pagingViewController. currentViewController = nextPagingViewController
176176
177177 let duration = animated ? options. animationDuration : 0
178- UIView . animate ( withDuration: duration, animations: {
179- ( ) -> Void in
178+ let animationClosure = {
180179 pagingViewController. positionMenuController ( )
181- } ) { [ weak self] ( _) -> Void in
182- pagingViewController. relayoutPagingViewControllers ( )
183-
184- // show paging views
185- self ? . showPagingMenuControllers ( )
186-
187- self ? . onMove ? ( . didMoveController( to: nextPagingViewController, from: previousPagingViewController) )
180+ }
181+ let completionClosure = { [ weak self] ( _: Bool ) -> Void in
182+ pagingViewController. relayoutPagingViewControllers ( )
183+
184+ // show paging views
185+ self ? . showPagingMenuControllers ( )
186+
187+ self ? . onMove ? ( . didMoveController( to: nextPagingViewController, from: previousPagingViewController) )
188+ }
189+ if duration > 0 {
190+ UIView . animate ( withDuration: duration, animations: animationClosure, completion: completionClosure)
191+ } else {
192+ animationClosure ( )
193+ completionClosure ( true )
188194 }
189195 }
190196
You can’t perform that action at this time.
0 commit comments