Attempting do something similar to an abstract class in swift using protocols and extensions to better organize a pluggable class so that it can be swapped out manually if needed, for example a different map api. The issue is once I add the protocol to the main class and run it the delegate functions extended in the protocol are ignored.
so for example
protocol MapTwoDelegate:BaseMapProtocol,RequiredMapViewDelegate{{
var someVariable:String!{get set}
}
extension MapTwoDelegate:BaseMapProtocol{
//MARK:Map Functions
func mapView(mapView: CoolMapView, annotationCanShowCallout annotation: CoolAnnotation) -> Bool {
return //Something
}
The only fix is to extend what ever class I am extending directly; however, If i switched apis, in this case mapping api, then I would have to comment out the swift file.
Any assistance or insight would be well appreciated?
also just to add I extended it instead of making it a class because, their are variables and functions I would want the user to create and are slightly different among implementations