I have two frameworks
First - Restofire. It has a protocol ResponseSerializer with Extension.
public protocol ResponseSerializable {
/// The type of object returned in response.
associatedtype Model
/// The `Alamofire.ResponseSerializer`.
var responseSerializer: ResponseSerializer<Model, NSError> { get }
}
extension ResponseSerializable {
/// `CustomJSONResponseSerializer`
public var responseSerializer: ResponseSerializer<Model, NSError> {
return AlamofireUtils.JSONResponseSerializer()
}
}
Second - Restofire-Gloss. It has an extension to a protocol for Models conforming to Decodable that is in the Restofire framework.
public extension ResponseSerializable where Model: Decodable {
/// `GLOSSResponseSerializer`
public var responseSerializer: ResponseSerializer<Model, NSError> {
return GlossUtils.GLOSSResponseSerializer()
}
}
public extension ResponseSerializable where Model: CollectionType, Model.Generator.Element: Decodable {
/// `GLOSSResponseSerializer`
public var responseSerializer: ResponseSerializer<Model, NSError> {
return GlossUtils.GLOSSResponseSerializer()
}
}
When i import the source files of Restofire-Gloss directly into the project everything works as expected but when i import the framework, then the control doesn't reach the function in the Restofire-Gloss framework.
Maybe you should mark extension as public?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With