Re: Swift - internal class conforming to public protocol
Re: Swift - internal class conforming to public protocol
- Subject: Re: Swift - internal class conforming to public protocol
- From: Andreas Mayer <email@hidden>
- Date: Wed, 25 Nov 2015 08:56:32 +0100
> Am 25.11.2015 um 08:13 schrieb Marco S Hyman <email@hidden>:
>
> As I read that adopting a public protocol requires the methods that implement the protocol to be public (but only those methods).
That's not how I read it. And it does not to work that way either. This compiles fine:
public protocol PublicProtocol {
func someFunction()
}
internal class SomeClass: PublicProtocol {
internal func someFunction() {
// implementation
}
}
I think it means you can't declare internal functions for a public protocol, whereas you can declare internal functions for a public class.
This does not compile:
public protocol OtherPublicProtocol {
internal func someFunction()
}
The compiler complains that "'internal' modifier cannot be used in protocols".
Andreas
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden