Re: [swift-users] A somewhat stupid question about protocol conformances

2017-11-25 Thread Adrian Zubarev via swift-users
Sorry yeah you’re right, the example also requires conditional conformances. If you do not need dynamic dispatch in your use case then you can workaround the issue for now by hiding the protocol requirements and abusing the protocol extension: import UIKit protocol AreaProtocol { /* keep it

Re: [swift-users] A somewhat stupid question about protocol conformances

2017-11-25 Thread Antonino Ficarra via swift-users
Adrian, thanks, but don’t work :-( import Foundation protocol AreaProtocol { // required funcarea() -> CGFloat // implemented in protocol extension funcvolume( height:CGFloat ) -> CGFloat // } extension AreaProtocol { func

Re: [swift-users] A somewhat stupid question about protocol conformances

2017-11-25 Thread Adrian Zubarev via swift-users
This is correct. None of your types does conform to your protocol because you never conformance explicitly. The extenstion you wrote is just a conditional extension which says if the Self type conforms to AreaProtocol and the associated typed Element is a CGPoint then add the area method to