m1entus / MZFormSheetPresentationController

MZFormSheetPresentationController provides an alternative to the native iOS UIModalPresentationFormSheet, adding support for iPhone and additional opportunities to setup UIPresentationController size and feel form sheet.
MIT License
973 stars 146 forks source link

Current Frame usage in Swift #87

Closed sinanku closed 8 years ago

sinanku commented 8 years ago

Hello!

Quick question, when using the content view frame function in Swift

func contentViewFrameForPresentationController(presentationController: MZFormSheetPresentationController, currentFrame: CGRect) -> CGRect {
        currentFrame.size.height = 450
        currentFrame.origin.y = 20
        return currentFrame
 }

I am getting the following issue

Cannot assign to property: 'currentFrame' is a 'let' constant

Is there a way this can be a var instead of a let, or am I missing something?

m1entus commented 8 years ago

You just need to do, var currentFrame = currentFrame, and you will be able to change it, in Swift 3 they will discard var in parameters anyway...

sinanku commented 8 years ago

@m1entus got it, thanks!