Last active
June 19, 2016 12:00
-
-
Save ozgurshn/1064082c32cc28ed14a38aadd11d8a28 to your computer and use it in GitHub Desktop.
Ensuring Objective-C class implemented Swift optional protocol method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@objc protocol VideoRangeSliderDelegate | |
{ | |
func videoRange (videoRange:VideoRangeSlider, didChangeLeftPosition:CGFloat, rightPosition:CGFloat) | |
optional func videoRange(videoRange:VideoRangeSlider, didGestureStateEndedLeftPosition:CGFloat, rightPosition:CGFloat) | |
} | |
// Usage ensuring call if method is implemented | |
delegate?.videoRange?(self, didGestureStateEndedLeftPosition: self.leftPosition, rightPosition: self.rightPosition) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment