> Am 25.11.2015 um 08:13 schrieb Marco S Hyman <m...@snafu.org>:
> 
> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to