0

I am writing an app for Apple Watch and I want to include Constants.h used in corresponding iPhone app (written in ObjC) into the watch app (swift). I've tried Apple tutorial for that (https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html), but the bridging file doesn't see the actual header file.

Probably the error is caused by the fact, that watch extension is separate target, but where and how should I specify the files to be included?

What's more, when including constants.h in the bridge file, all the constants are showing editor errors:

xcode

JAL
  • 41,701
  • 23
  • 172
  • 300
izik461
  • 1,131
  • 12
  • 32

1 Answers1

2

NSString is part of Foundation. The compiler is complaining that it can't resolve that type. Add #import <Foundation/Foundation.h> to the top of your header.

JAL
  • 41,701
  • 23
  • 172
  • 300
  • Thanks a lot. It worked. I've added foundation also to be included in bridging file, not in the constants.h – izik461 Apr 18 '16 at 14:41