Hi I was wondering if i could get some suggestions on this:
extension CGPoint : Comparable
{
static func <(l: CGPoint, r: CGPoint) ->
Bool{
return true;
}
static func ==(l: CGPoint, r: CGPoint) ->
Bool{
return true;
}
}
CGPoint is a Core graphics struct.
This code gives me an error "Declaration is only valid at file scope". However
per swift documentation, I cannot add an access modifier to extensions that
adopt protocols. I was wondering if there is an elegant workaround for this
limitation or if there's something I'm missing here.
Thanks.
_______________________________________________
swift-users mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-users