Re: why is this Swift initializer legal

2015-06-07 Thread Roland King
> On 8 Jun 2015, at 06:14, Greg Parker wrote: > > >> On Jun 6, 2015, at 2:43 AM, Roland King wrote: >> >> >> >> public class RDKBLEService : NSObject >> { >> let peripheral : CBPeripheral >> >> public init( peripheral: CBPeripheral ) >> { >> self.peripheral = pe

Re: why is this Swift initializer legal

2015-06-07 Thread Greg Parker
> On Jun 6, 2015, at 2:43 AM, Roland King wrote: > > > > public class RDKBLEService : NSObject > { > let peripheral : CBPeripheral > > public init( peripheral: CBPeripheral ) > { > self.peripheral = peripheral > } > } > > It’s a designated initialiser, t

Re: why is this Swift initializer legal

2015-06-06 Thread Roland King
> On 7 Jun 2015, at 10:01, Quincey Morris > wrote: > > On Jun 6, 2015, at 18:10 , Roland King mailto:r...@rols.org>> > wrote: >> >> Quincey may well be right and in the case of a class which has one single, >> no-arg, DI that DI is automagically added in by the compiler at the end of >> the

Re: why is this Swift initializer legal

2015-06-06 Thread Quincey Morris
On Jun 6, 2015, at 18:10 , Roland King wrote: > > Quincey may well be right and in the case of a class which has one single, > no-arg, DI that DI is automagically added in by the compiler at the end of > the method. After further thought, I’d say something stronger. In the scenario we’re talk

Re: why is this Swift initializer legal

2015-06-06 Thread Roland King
> On 7 Jun 2015, at 02:18, Marco S Hyman wrote: > >> public class RDKBLEService : NSObject >> { >> let peripheral : CBPeripheral >> >> public init( peripheral: CBPeripheral ) >> { >> self.peripheral = peripheral >> } >> } > > Swift doesn’t think init in NSObjec

Re: why is this Swift initializer legal

2015-06-06 Thread Quincey Morris
On Jun 6, 2015, at 02:43 , Roland King wrote: > > I was looking to see if I could find an exception to the rule which this fell > under but can’t. It looks like this isn’t something that falls under those rules, but is rather one of the Swift compiler conveniences that writes boilerplate code

Re: why is this Swift initializer legal

2015-06-06 Thread Marco S Hyman
> public class RDKBLEService : NSObject > { > let peripheral : CBPeripheral > > public init( peripheral: CBPeripheral ) > { > self.peripheral = peripheral > } > } Swift doesn’t think init in NSObject is a designated initializer. Add “override” as you would w

why is this Swift initializer legal

2015-06-06 Thread Roland King
public class RDKBLEService : NSObject { let peripheral : CBPeripheral public init( peripheral: CBPeripheral ) { self.peripheral = peripheral } } It’s a designated initialiser, there’s a superclass (NSObject) but the initialiser doesn’t call a des