I'm trying to import myFramework
into a project. I've added myFramework
in Build Phases->Link Binary With Libraries.
Objective-c works:
#import <UIKit/UIKit.h>
#import <myFramework/myFramework.h>
But with in Swift, I get a No such module myFramework
error:
import UIKit
import myFramework
According to the Swift documentation:
Importing External Frameworks
You can import external frameworks that have a pure Objective-C codebase, a pure Swift codebase, or a mixed-language codebase. The process for importing an external framework is the same whether the framework is written in a single language or contains files from both languages. When you import an external framework, make sure the Defines Module build setting for the framework you’re importing is set to Yes.
You can import a framework into any Swift file within a different target using the following syntax:
SWIFT
import FrameworkName
You can import a framework into any Objective-C .m file within a different target using the following syntax:
OBJECTIVE-C
@import FrameworkName;
I created myFramework
using Xcode 5. Xcode 5 doesn't have a "Defines Module" build setting.
Where is the problem?
@import
non-system frameworks. It's available since Xcode 6. – Shmidt