John Difool
John Difool

Reputation: 5702

Can't import MobileDevice module in Swift

Its location (on 10.11) is:

/System/Library/PrivateFrameworks/MobileDevice.framework

and when I try to import it after adding it to a MacOSX Swift project with this statement:

import MobileDevice

in a Swift file, I am getting an:

No such module

What's happening?

Upvotes: 4

Views: 291

Answers (1)

Harish
Harish

Reputation: 1408

If cleaning your Xcode Project doesn't work, try going to your Build Settings in Xcode and define the Framework Search Path to the path of the MobileDevice Framework. So in your case you would set the Framework Search Path to:

/System/Library/PrivateFrameworks/MobileDevice.framework

Also, if the framework is located in the project directory use $(SRCROOT) and set it to recursive.

Upvotes: 3

Related Questions