I’m stuck trying to use SwiftHTTP in my app. Here’s what I’ve done:
Added the SwiftHTTP.xcodeproject to my project
In Build Phases, I included all four SwiftHTTP.framework files
In my ViewController, I put import SwiftHTTP at the top
But I keep getting this error: “No such module SwiftHTTP”
I’ve tried this in both Xcode 6.4 and 7.1, but no luck. It’s driving me crazy! Has anyone run into this before? Any ideas on what I might be doing wrong or what else I can try?
I’m pretty new to Swift and dealing with external libraries, so I might be missing something obvious. Thanks for any help!
hey mate, had the same issue. have u tried cleaning ur project and rebuilding? sometimes xcode gets wonky with new frameworks. also, check ur target’s ‘linked frameworks and libraries’ section to make sure swifthttp is there. if not, drag it in manually. good luck!
I’ve gone through this exact headache with SwiftHTTP. What eventually worked for me was ditching the manual approach and going with Carthage. It’s a bit like CocoaPods but less invasive. Here’s what I did:
Install Carthage if you haven’t already (brew install carthage)
Create a Cartfile in your project root and add: github “daltoniam/SwiftHTTP” ~> 3.0.1
Run carthage update --platform iOS
Drag the built SwiftHTTP.framework from Carthage/Build/iOS into your project’s ‘Linked Frameworks and Libraries’
Add a new ‘Run Script’ phase in Build Phases with: /usr/local/bin/carthage copy-frameworks
This solved the import issues for me and kept things clean. Plus, updating is a breeze. Give it a shot if you’re still stuck!
I encountered a similar problem when integrating SwiftHTTP. One solution that worked for me was to use CocoaPods instead of manual integration. It simplifies the process significantly. Add ‘pod SwiftHTTP’ to your Podfile, run ‘pod install’, and open the .xcworkspace file. This method ensures proper linking and usually resolves import issues. If you prefer manual integration, double-check your project’s SWIFT_INCLUDE_PATHS in Build Settings. Sometimes, explicitly adding the framework’s path there can solve the ‘No such module’ error. Remember to clean and rebuild after making changes.