Comments (21)
Thanks, @angelcasado.
from alamofire.
@Isuru-Nanayakkara I just spent an embarrassing amount of time trying to get things working as a framework...finally realized that I didn't add "import Alamofire" into my Swift classes.
from alamofire.
I don't get how you're supposed to use it as a framework?
I added several .framework
dependencies in my project and it worked fine, but the README
here calls for a .xcodeproj
file. Dragging it didn't make it work. Any idea?
In the meantime I just added the source file and remove the Alamofire.
in my sources.
from alamofire.
If you look at the code change the AlamoFire struct was removed, so if you were using AlamoFire.request just use "request".
from alamofire.
Looks like we're going to have to include Alamofire in our projects as a framework. I downloaded the ZIP and tried adding the Alamofire framework in "linked frameworks and libraries" and "target dependencies" but the linker is failing. Not sure if there's an official plan for Swift Cocoapods but I hope so. Instructions for including the framework would be helpful in the meantime.
from alamofire.
Frameworks are only available in iOS 8, right? So to use Alamofire like we used until now (Alamofire.request()
) we'd need to require iOS 8.
from alamofire.
The example project is built with Alamofire as a framework. You can use that as a reference if you need more clarification on installation.
from alamofire.
In case anyone hasn't figured it out yet. Once you drag the Alamofire.xcodeproj
into your project go to your project target >> "Build Phases" under "Target Dependencies" press +
and add the framework.
As for supporting iOS 7; I found it easy to change Alamofire's "Deployment Target" to iOS 7. I haven't really found a bug in doing this yet. This may be the cause of some errors if your project deploys with iOS 7.
from alamofire.
@angelcasado I dragged and dropped the Alamofire.xcodeproj to my project, added the framework as a Target Dependency but still it doesn't work. And here's the kicker! When I build it, it fails without an error!
I have no idea why Alamorefire.framework is showing in red either.
@mattt Is adding it as a framework the only option to add Alamofire to a project? Can't we just add the file like it used to be anymore?
from alamofire.
@luketheobscure Thanks, Luke. I finally managed to integrate it successfully.
from alamofire.
Thanks @angelcasado, @luketheobscure !
from alamofire.
@luketheobscure Thanks, you are a life saver!
from alamofire.
@luketheobscure @mattt forgot to import Alamofire into my class. face palm
from alamofire.
I am getting the same error. I followed all the steps but I was not sure about this step, I probably did something wrong because I don't see this "Targets" option in the side nav:
In Xcode, navigate to the target configuration window by clicking on the blue project icon, and selecting the application target under the "Targets" heading in the sidebar.
I do not see the "Targets" heading in the sidebar. Where is this?
The attached screenshot is what it currently looks like. You can see the framework is red, which to me implies that there was a build problem for the framework.
from alamofire.
@mattcantstop You need to add the Alamofire.framework to the Target Dependencies, not Link Binary with Libraries,.
from alamofire.
Ah, thanks. Overlooked that this go round.
from alamofire.
@Isuru-Nanayakkara - 👍 Adding to Target Dependencies fixed it, Thanks! And step 6 on the read me should be changed.
from alamofire.
I just assumed I misread it @adooylabs. I can submit a pull request to make that change if people want.
from alamofire.
@mattcantstop - Sounds like a good idea. 👍
from alamofire.
In my case, if this helps anyone, I found myself with Alamofire added in both places, Target Dependencies and Link Binaries With Libraries. And the error only went away once I removed it from Link Binary.
from alamofire.
Great angelcassado
from alamofire.
Related Issues (20)
- Add SPM product as a dynamic framework HOT 3
- Provide Privacy Manifest support for AFNetworking HOT 22
- Multiple AF.upload cannot be concurrent HOT 1
- App crash on archived version HOT 1
- Different iOS minimal OS support in Package.swift and Alamofire.podspec HOT 1
- Upload Progress called only once with fraction value 1.0 before the upload request complete HOT 2
- Dr
- Add Conformance To ClientTransport From swift-openapi-generator HOT 1
- Timeout responseCode is nil HOT 2
- Add support for visionOS HOT 1
- New version with privacy manifest is not available HOT 3
- Crash - CompositeEventMonitor.request<A>(_:didParseResponse:) HOT 1
- The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.10, but the range of supported deployment target versions is 10.13 to 14.2.99. (in target 'Alamofire macOS' from project 'Alamofire') HOT 1
- In Xcode's InspectorView, Signature's Kind is Unsigned HOT 1
- Crash on startup with Alamofire 4.9.1 HOT 1
- Cocoapods support for visionOS HOT 4
- Authenticator with Swift Concurrency HOT 3
- Almofire SDK privacy details not reflecting in my project HOT 20
- Not possible to `validate` `WebSocketRequest`? HOT 2
- WebSocketRequest Should Support Validation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alamofire.