Re: Swift - internal class conforming to public protocol

2015-11-25 Thread Andreas Mayer
> Am 25.11.2015 um 08:13 schrieb Marco S Hyman : > > 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:

Re: Swift - internal class conforming to public protocol

2015-11-25 Thread Andreas Mayer
> Am 25.11.2015 um 08:56 schrieb Quincey Morris > : > >> That's explained in "Using Swift with Cocoa and Objective-C": >> >> "The compiler does not automatically insert the @objc attribute for >> declarations marked with the private access-level modifier.”

Re: Swift - internal class conforming to public protocol

2015-11-25 Thread Roland King
> On 25 Nov 2015, at 16:30, Andreas Mayer wrote: > > >> Am 25.11.2015 um 08:56 schrieb Quincey Morris >> : >> >>> That's explained in "Using Swift with Cocoa and Objective-C": >>> >>> "The compiler does not automatically insert the

Re: Swift - internal class conforming to public protocol

2015-11-25 Thread Roland King
> On 25 Nov 2015, at 16:37, Quincey Morris > wrote: > > On Nov 25, 2015, at 00:30 , Andreas Mayer wrote: >> >> I can't replicate that behavior. > > Since Roland hasn’t contributed to this thread for 24 hours, I vote we blame >

Re: Swift - internal class conforming to public protocol

2015-11-25 Thread Quincey Morris
On Nov 25, 2015, at 00:30 , Andreas Mayer wrote: > > I can't replicate that behavior. Since Roland hasn’t contributed to this thread for 24 hours, I vote we blame *him*. ;) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: Swift - internal class conforming to public protocol

2015-11-25 Thread Roland King
> On 25 Nov 2015, at 16:30, Andreas Mayer wrote: > > >> Am 25.11.2015 um 08:56 schrieb Quincey Morris >> : >> >>> That's explained in "Using Swift with Cocoa and Objective-C": >>> >>> "The compiler does not automatically insert the

Re: Swift - internal class conforming to public protocol

2015-11-25 Thread Charles Srstka
> On Nov 25, 2015, at 12:54 AM, Andreas Mayer wrote: > > And there's no @not-objc modifier. There actually is a @nonobjc modifier. Can’t remember in which release they added it, but it’s there.

Re: Swift - internal class conforming to public protocol

2015-11-24 Thread Quincey Morris
On Nov 24, 2015, at 16:16 , Roland King wrote: > if I define an internal class which implements a public protocol, who is able > to call the methods in that protocol? Anyone (it’s a public protocol), only > classes in the same framework or source file (the class is internal)?

Re: Swift - internal class conforming to public protocol

2015-11-24 Thread Andreas Mayer
> if I define an internal class which implements a public protocol, who is able > to call the methods in that protocol? Anyone (it’s a public protocol), only > classes in the same framework or source file (the class is internal)? If you declare it internal it's internal. Adopting a public

Re: Swift - internal class conforming to public protocol

2015-11-24 Thread Roland King
> On 25 Nov 2015, at 00:59, Andreas Mayer wrote: > > >> Am 24.11.2015 um 15:10 schrieb Roland King : >> >> in this class, centralManagerDidUpdateState() is an internal function >> however the compiler is happy that the class satisfies >>

Re: Swift - internal class conforming to public protocol

2015-11-24 Thread Quincey Morris
On Nov 24, 2015, at 23:13 , Marco S Hyman wrote: > As I read that adopting a public protocol requires the methods that implement > the protocol to be public (but only those methods). As I said earlier, this isn’t true any more. (I think this change was made in the Swift that

Re: Swift - internal class conforming to public protocol

2015-11-24 Thread Marco S Hyman
>> if I define an internal class which implements a public protocol, who is >> able to call the methods in that protocol? Anyone (it’s a public protocol), >> only classes in the same framework or source file (the class is internal)? > > If you declare it internal it's internal. Adopting a

Re: Swift - internal class conforming to public protocol

2015-11-24 Thread Quincey Morris
On Nov 24, 2015, at 06:10 , Roland King wrote: > > How can this be, how can an internal function make a class conform to a > public method on a public protocol. IIRC, until fairly recently (i.e. WWDC 2015 or one of the later Xcode releases), it worked as your intuition tells

Re: Swift - internal class conforming to public protocol

2015-11-24 Thread Andreas Mayer
> Am 24.11.2015 um 15:10 schrieb Roland King : > > in this class, centralManagerDidUpdateState() is an internal function however > the compiler is happy that the class satisfies CBCentralManagerDelegate even > though that protocol is public and centralManagerDidUpdateState() is

Swift - internal class conforming to public protocol

2015-11-24 Thread Roland King
I have the following class, it was internal by default, but I’ve made it so explicitly for the purpose of the question. internal class ControllerBTLEListener: NSObject, CBCentralManagerDelegate { // the queue for all our operations static let queue : dispatch_queue_t =