I am having trouble creating an extension in Swift that conforms to a protocol.
In Objective-C I could create a category that conformed to a protocol:
SomeProtocol.h
@protocol SomeProtocol
...
@end
UIView+CategoryName
#import SomeProtocol.h
@interface UIView (CategoryName) <SomeProtocol>
...
@end
I am trying to achieve the same with a Swift Extension
SomeProtocol.swift
protocol SomeProtocol {
...
}
UIView Extension
import UIKit
extension UIView : SomeProtocol {
...
}
I receive the following compiler error:
Type 'UIView' does not conform to protocol 'SomeProtocol'