I am having so much fun converting our code to Swift 3. That's on us, but what drives me crazy is how slow Xcode is in reacting to anything - Quick Help, code completion, etc… things that in Swift 2 on XCode 7 were instant on Swift 3 take 10 seconds to a minute to display.
Anyhow - here is the latest issue - and I'm genuinely stumped:
Objective-C class
@interface AKContext : AKIntermediaryObject
@property(nonatomic, readonly) NSString *title;
@property(nonatomic, readonly) NSString *icon;
- (instancetype)initWithPIContext:(PIContext *)context;
@endSwift3 "generated interface"
open class AKContext : AKIntermediaryObject {
public init!(piContext context: PIContext!) /
}For a brief second when I select the option, I get the correct properties. This of course gives me problems where when using AKContext in Swift - for example sorting an array of them:
return contexts.sorted{ $0.title.lowercased.localizedCompare($1.title.lowercased) == .orderedAscending }I get an error:
Ambiguous reference to member 'title'
Now here is the interesting thing - in the implementation file (the .m) we have :
@interface AKContext ()
@property(nonatomic, strong) NSString *title;
@property(nonatomic, strong) NSString *icon;
@endSo that obviously the properties can be set internally in the implementation. If I comment that out - Swift works fine! Why is Swift caring about my implementation file and why would that make the properties invisible? Is this a bug or is this a Swift change? I've followed Swift Evolution, but I've never see anything like this.