草庐IT

Alamofire4

全部标签

xcode - 导入 Alamofire 3.4 - 没有这样的模块 'Alamofire'

我有一个需要导入Alamofire的项目,我采取的每一个方法都让我遇到了同样的问题导入Alamofire-没有这样的模块“Alamofire”已安装cocoapods编辑的Podfile:来源'https://github.com/CocoaPods/Specs.git'platform:ios,'9.0'use_frameworks!target'myprojectname'dopod'Alamofire','~>3.4'end$pod安装从安装cocoapods到最后,一切都很顺利,没有任何错误。使用projectname.xcworkspace打开项目即使手动尝试了,仍然是同样的

ios - Alamofire 5 在使用 Carthage 安装后显示错误, "' Alamofire 没有名为请求的成员”

我已经使用Carthage安装了Alamofire5,但它一直显示没有成员请求的错误。Alamofire.request(route).responseJSONDecodable{responsein}Module'Alamofire'hasnomembernamed'request' 最佳答案 您正在使用Alamofire5,那么您应该使用AF.request而不是Alamofire.request。 关于ios-Alamofire5在使用Carthage安装后显示错误,"'Alamo

ios - 为 Alamofire 请求输入用户名和密码

我正在尝试使用Alamofire为我的iOS应用发出GET请求,但我真的不知道如何输入我的用户名和密码。成功运行的cURL命令是curl-k-uuser:pwhttps://url/cli/方法它返回了正确的JSON我试过AlamofireAlamofire.request(.GET,self.baseURL+method,parameters:params).responseJSON{(_,_,JSON,_)inprintln(JSON)其中baseURL+方法是https://url/休息/方法参数是letparams=["username":self.username.text,

ios - pod -Alamofire : Swift is not supported for static libraries

我有一个在Swift1.2和iOS8.4上运行的项目。在更新到Swift2和iOS9之后,我执行了“podupdate”来更新我的pod。现在出现Pods-Alamofire错误:“静态库不支持Swift。”有什么解决办法吗? 最佳答案 如果您使用的是cocoapods,请确保您使用的是正确版本的Alamofirepod'Alamofire','~>2.0'//2.0iscurrentlythelatestversion还要确保您使用的是use_frameworks!,这样您的个人资料应该如下所示:platform:ios,'8.0

ios - 使用 Alamofire 和 multipart/form-data

我无法以正确的方式使用提供给我的API来获得我正在寻找的响应。我已经使用Swift和Alamofire一段时间了,但这是我第一次使用multipart/form-data上传图像。我可以使用Postman上传图像,但无法使用Alamofire框架让我的应用程序发送相同的消息。我的Swift代码:funcpostFulfilWish(wish_id:Int,picture:UIImage,completionHandler:((AnyObject?,ErrorType?)->Void)){varurlPostFulfilWish=Constant.apiUrl;urlPostFulfil

swift - Alamofire NetworkActivityIndi​​catorManager.sharedManager.isEnabled = true ,使用未解析的标识符

Alamofires网络工具AlamofireNetworkActivityIndi​​cator无法正常工作。当我输入代码时,NetworkActivityIndi​​catorManager.sharedManager.isEnabled=true我使用未解析的标识符。我不明白为什么它不存在,也许是新的Xcode更新,但老实说我不确定为什么。Screenshotofproblem 最佳答案 我遇到了同样的问题,想避免在AppDelegate中使用额外的import语句,但最终在链接框架失败后才这样做:importAlamofir

ios - 使用 Swift 3 和 Alamofire 4 后没有得到响应

将我的代码更改为swift3并使用Alamofire4后出现问题。在使用Alamofire4和swift3之前,我的代码运行完美。当我更改为swift3并使用Alamofire4时,我遇到了很多错误,并且在修复它们之后。我还有一个问题,就是我没有收到任何回复!!我当前使用Swift3和Alamofire4的代码importUIKitimportAlamofireprotocolVideoModelDelegate{funcdataReady()}classVideoModel:NSObject{letAPI_KEY="xxxxxxxxxxxxxxxxx"letUPLOADS_PLAYL

swift - Alamofire 2,如何获取 NSError?

在alamofire2中,他们引入了结果类型:Alamofire.request(.GET,URLString,parameters:["foo":"bar"]).responseJSON{request,response,resultinswitchresult{case.Success(letJSON):print("SuccesswithJSON:\(JSON)")case.Failure(letdata,leterror):print(error)}}error是ErrorType类型,它的唯一成员是debugDescription,它打印:Optional(ErrorDoma

ios - Swift 2.0 Alamofire 完成处理程序返回 Json

我的目标是创建一个简单的函数,我在其中传递一个url,它返回JSON。我环顾四周,发现了使用Alamofire实现完成处理程序的小例子。我也在使用SwiftyJson来帮助解析它。如何将此处的内容转换为返回我的Json的函数。funcrequest(){Alamofire.request(.GET,API_END_POINT).responseJSON{responsein//swiftyJsonVariswhatIwouldlikethisfunctiontoreturn.letswiftyJsonVar=JSON(response.result.value!)}}

ios - Alamofire fire 变量类型没有下标成员

更新到Alamofire4并将我的代码更新到Swift3后,由于某种原因我的所有请求都不起作用。我尝试使用的变量以红色突出显示并显示“TypeAny'没有下标成员”这是我的代码:Alamofire.request("https://example.com/notifications.php?action=\(action)&UUID=\(UniversalUUID)&token=\(token)").responseJSON{(response)->VoidinifletJSON=response.result.value{letmessage=JSON["message"]as!St