I'm creating a Swift framework in the latest Xcode 6 DP4. I need to internally use AFNetworking in my framework, but can't figure out a way to compile it.
I know how to use bridging headers, but those aren't supported in Swift frameworks.
My framework, Core.framework, looks like this:
> Core.h
#import <UIKit/UIKit.h>
#import <AFNetworking/AFNetworking.h>
//! Project version number for Core.
FOUNDATION_EXPORT double CoreVersionNumber;
//! Project version string for Core.
FOUNDATION_EXPORT const unsigned char CoreVersionString[];
> SomeFileThatNeedsAFNetworking.swift
And I'm using a podfile to bring in AFNetworking. However, when I compile, I get the following error:
<unknown>:0: error: ~/Core/Source/Core.h:2: include of non-modular header inside framework module 'Core'
because of the AFNetworking import. But if I don't include that, then I get compilation errors everywhere referencing AFNetworking.
Has anyone figured out the right combination?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…