I have the following Objective-C method:
-(void)setPaneState:(MHPaneState)state withInitialVelocity:(CGPoint)velocity{
self.paneState = state;
[self animatePaneWithInitialVelocity:velocity];
}
Currently, in Swift code in the same app, I'm calling this method like this:
setPaneState(.closed, withInitialVelocity: .zero)
I'd like for the 2nd parameter (velocity) to have a default value of CGPointZero. I know that Objective-C doesn't support default values at the language level, but Swift does, so I'd like to call this method in Swift like this:
setPaneState(.closed)
How can I accomplish this short of defining a new method that takes just the one MHPaneState parameter?
Could you write a Swift extension on your Objective-C type and give it a different name?