Swift framework integration - Xcode shows errors but compiles ok - ios

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

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

Related

An issue with Swift + Objective C framework on XCode 9.4.1

I have some unique case when Objective C framework is integrated in a Swift framework. Everything seems to be fine when I make build. Also, when I use this new framework in the project that is written in Objective C I have no issues.
But when I use it in the project written in Swift 4.1, after my import statement, I get an error message:
module is not found "the name of Obj C framework"*
When I used Xcode 9.2 back in the days everything worked fine. So, this issue appeared only after Xcode 9.4.
I believe there's something that could be changed in a build settings maybe, but, unfortunately, I don't have enough experience to find this out. Could anyone help me, please?
I found a link Swift and AFNetworking integration to integrate the Obj c framework in Swift Project . I hope it would work for you. Plus Check your header file path and framework path in your project.

Swift framework problems with Xcode compatibility

I have a framework that I distribute to customers without giving them access to the source code, depending on which version of Xcode I use to build it, they get errors like module compiled with Swift 4.1 cannot be imported in Swift 3.2.3 when importing the file .
I couldn't find any setting in the project that allowed me to build backwards compatible version of my framework. Specifically the problem is between 9.2 and 9.3, but at the same time this seems to be a common problem, how can I build the framework so that it works with all the previous versions of Xcode?
Until Swift 5 is released with ABI stability, your library has to be compiled with the same version of Swift as the parent app. This means multiple copies out there based on Swift / Xcode version.
Once Swift 5 is released, then you can compile a copy to be used in any app compiled with Swift 5 or greater.

Xcode can't read swift files

This project came to me to be updated to the new iOS 10.It uses frameworks downloaded with cocoa pods. Some of these frameworks are written in swift.Now that I made few changes on the project code, when I try to build the project, I get errors on the frameworks I downloaded as if the project can't read swift!
Is there somewhere where I can set my project to accept swift classes?
Updated Xcode to Xcode 8 and it updated the code and fixes theses issues. Thanks Folks.

Issue while creating dynamic framework in Swift with carthage

Hi Can any one help in resolving this issue.
I have created a dynamic framework in swift. My framework is referring some external frameworks like alamofire, xcglogger etc into my framework project. I am using carthage for this purpose.
It works perfectly. But when I create the framework and use it in another project its giving me error on my framework
Missing required modules : 'Alamofire','XCGlogger'
Can anyone help me in this.
I am using carthage 0.16.2
xcode 7.3.1
Swift

"Module file was created by an older version of the compiler" message when trying to run UI Test on Xcode

I'm trying to do some UI Testing on my older project.
I created a UI Test target and added #testable import MyOlderProject at the top of the test Swift file.
I'm getting the following error message:
Module file was created by an older version of the compiler; rebuild
'MyOlderProject' and try again
Looks like it's related to MyOlderProject.swiftmodule/arm.swiftmodule.
What am I doing wrong?
Have you tried to upgrade to Xcode 7 GM and build your app with latest swift compiler?
It might be a warning sign from here,
"To be safe, all components of your app should be built with the same
version of Xcode and the Swift compiler to ensure that they work
together."
https://developer.apple.com/swift/blog/?id=2

Resources