3

I'm using MMDrawerController, and I'm trying to change the way the drawer slides out.

In objective C, I would do

[drawerController setDrawerVisualStateBlock:[MMDrawerVisualState slideAndScaleVisualStateBlock]]

to change how the drawer slides out to the Slide and Scale animation.

In Swift however, I can't seem to be able to do this. This is where I'm at with swift:

drawerController.setDrawerVisualStateBlock { (MMDrawerController!, MMDrawerSide, CGFloat) -> Void in

}        

I'm unable to call something like this MMRawerVisualState.slideAndScaleVisualStateBlock() inside the block. Is this feature not supported with Swift?

Thomas
  • 2,356
  • 7
  • 23
  • 59

1 Answers1

1

In Objective-c you were passing a class method witch returns a block for the animation(typelias of MMDrawerControllerDrawerVisualStateBlock). But you're not passing the same method in the swift version of the code(You're implementing it).

drawerController.setDrawerVisualStateBlock(MMDrawerVisualState.slideAndScaleVisualStateBlock)
Tiago Maia
  • 616
  • 1
  • 6
  • 20
  • 2
    this is actually the code I had to use: `drawerController.setDrawerVisualStateBlock(MMDrawerVisualState.slideAndScaleVisualStateBlock()!)` Cheers! – Thomas Jun 26 '15 at 23:45
  • Both of you, Your answer is awesome. Thanks. – Mariam Sep 08 '15 at 15:03