kstenerud / iOS-Universal-Framework

An XCode project template to build universal frameworks (arm7, arm7s, and simulator) for iOS / iPhone.
2.95k stars 474 forks source link

Importing a framework created with iOS-Universal-Framework into a new Swift project #202

Closed markstickley closed 9 years ago

markstickley commented 9 years ago

Hi folks, I know it's not really an issue with this project but I've been googling for a few days now, on and off, and I'm getting no joy. Perhaps you can help?

I've been using iOS-Universal-Framework to distribute a framework for some time now and it has been great (thanks!) but now I'm testing how the framework works with Swift projects and it's not going so well.

I've created a bridging header and in there I'm importing a header file in the framework that imports all the other files necessary. This seems to work as autocomplete is working within the Swift project. The issue is on compiling where I get hundreds of errors like this:

screen shot 2014-10-20 at 10 04 03 screen shot 2014-10-20 at 10 05 26 screen shot 2014-10-20 at 10 05 17 screen shot 2014-10-20 at 10 05 37 screen shot 2014-10-20 at 10 05 45

...to give just a few examples!

Has anyone seen anything like this an possibly know how to fix it?

Thanks!

markstickley commented 9 years ago

I figured it out - I was relying on <Foundation/Foundation.h> being already loaded in the framework.

Adding

#import <Foundation/Foundation.h>

...before importing the framework in the bridging header fixed it.

Now I'm just struggling with a category that's not registering but that's something else entirely!

Cheers.