Search code examples
iosswiftframeworkscarthage

Swift framework integration - Xcode shows errors but compiles ok


I have created a Swift framework and I have integrated that framework into my project using Carthage. All the necessary steps mentioned on the Carthage github page have been completed.

When I use the framework classes in my main project code, Xcode throws up errors in the editor (red exclamations in the margin) for any framework type - Use of undeclared type .... However the project itself compiles fine and works perfectly with the framework functionality. Another related issue might be that I do not get any autocomplete suggestions for my framework code. The framework classes, structs etc have been marked public as necessary.

What step am I missing here - what do I need to do so that Xcode does not show those errors?

The framework code is written on Xcode 8 with Swift 2.3, the main project is being managed on Xcode 7.3.1 with Swift 2.3


Solution

  • Xcode 7.3.1 supported only till Swift 2.2. Please upgrade your project to Swift 2.3 in Xcode 8