Generated

Originator:brian.nickel
Number:rdar://17183425 Date Originated:05-Jun-2014 01:09 PM
Status:Resolved Resolved:09-Jul-2014 07:10 AM
Product:Developer Tools Product Version:Version 6.0 (6A215l)
Classification: Reproducible:
 
Summary:
I've created a Swift class that has an Objective-C property:

class AlbumListViewController: UITableViewController {
    let library:SSKPhotoLibrary = SSKPhotoLibrary.sharedInstance()
}

For Swift to access SSKPhotoLibrary, I added #import "SSKPhotoLibrary.h" to JuxtaPhotos-Bridging-Header.h.

When other Objective-C classes need access a Swift class, I include #import "JuxtaPhotos-Swift.h".

This generated header has the following:

SWIFT_CLASS("_TtC11JuxtaPhotos23AlbumListViewController")
@interface AlbumListViewController : UITableViewController
@property (nonatomic, readonly) SSKPhotoLibrary * library;

But doesn't define SSKPhotoLibrary.

Now every time I want to use a Swift class from Objective-C, I need to do 

@class SSKPhotoLibrary, SSKOther, SSKEvenAnother, SSK...
#import "JuxtaPhotos-Swift.h"

-or-

#import "JuxtaPhotos-Bridging-Header.h"
#import "JuxtaPhotos-Swift.h"

Steps to Reproduce:
1. Add an Objective-C header for class ObjC1 to -Bridging-Header.h
2. Reference the class in that header in an @objc class (Sw1) in Swift.
3. Create some other useful @objc class (Sw2).
4. Include -Swift.h in some Objective-C file ObjC2 that doesn't know about ObjC1.

Expected Results:
No compiler error.  -Swift.h has declaration for ObjC1.

Actual Results:
Compiler error in -Swift.h referenced from ObjC2.m.  No declaration for ObjC1.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!