How to write Swift Protocol methods in Objective C -
i have file slider.swift , there protocol defined class parameter. want write methods in objective c in header file. how pass class parameter in protocols.
please help
public protocol sliderdelegate: class { func slider(slider: slider, textwithvalue value: double) -> string func sliderdidtap(slider: slider) func slider(slider: slider, didchangevalue value: double) func slider(slider: slider, didupdatefocusincontext context: uifocusupdatecontext, withanimationcoordinator coordinator: uifocusanimationcoordinator) } public extension sliderdelegate { func slider(slider: slider, textwithvalue value: double) -> string { return "\(int(value))" } func sliderdidtap(slider: slider) {} func slider(slider: slider, didchangevalue value: double) {} func slider(slider: slider, didupdatefocusincontext context: uifocusupdatecontext, withanimationcoordinator coordinator: uifocusanimationcoordinator) {} } @ibdesignable public class slider: uiview { }
Comments
Post a Comment