MMDrawerController Pre Built Animations with Swift
I am using MMDrawerController
, and I am trying to change the drawer extension method.
In object C, I would do
[drawerController setDrawerVisualStateBlock:[MMDrawerVisualState slideAndScaleVisualStateBlock]]
to change how the animation drawer slides out Slide and Scale
.
In Swift, however, I cannot do this. Here I am quick and quick:
drawerController.setDrawerVisualStateBlock { (MMDrawerController!, MMDrawerSide, CGFloat) -> Void in
}
I cannot name something like this MMRawerVisualState.slideAndScaleVisualStateBlock()
inside a block. Is this feature not supported with Swift?
source to share
In Objective-c, you passed a class method that returns a block for animation (typelias MMDrawerControllerDrawerVisualStateBlock
). But you are not passing the same method in the swift version of the code (you are implementing it).
drawerController.setDrawerVisualStateBlock(MMDrawerVisualState.slideAndScaleVisualStateBlock)
source to share