Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Imported Embedded Framework into Watch Extension

I've created an embedded framework containing some swift classes and am able to import and use this successfully in my main app using the import statement. The functions I'm using are marked public and everything works just fine in the main app.

import FrameworkNameKit

However, when I add a watchos2 target when I try to import the framework into the Watch Extension Xcode can't find the framework and I always get the 'No such module' error. I'm trying to import into the InterfaceController.swift file if that helps.

The entire project is written is Swift and I'm using Xcode 7.0 beta.

Has anyone managed to do this successfully? I'm pretty sure I'm missing something basic but can't seem to figure it out.

like image 486
FractalDoctor Avatar asked Jun 19 '15 09:06

FractalDoctor


1 Answers

I can't find this actually documented anywhere, but if you take a look at Apple's "Lister" project for watchOS, it seems you have to have a separate framework built for the watchOS SDK in order to include that framework into a watchOS 2.0 extension and include any shared code in both the iOS and watchOS framework targets.

like image 76
Cocoatype Avatar answered Oct 13 '22 00:10

Cocoatype