iOS / Swift:如何使用Alamofire管理网络多功能性 [英] iOS/Swift : How to manage network versatility with Alamofire

查看:111
本文介绍了iOS / Swift:如何使用Alamofire管理网络多功能性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是iOS和Swift开发的新手,而且我不习惯在通常的程序中管理网络可达性。

I'm new in iOS and Swift development, and i'm not used to manage the network reachability in my usual programs.

我找到了AFNetworking和Alamofire,是缓解iOS中API调用的好框架。

I found AFNetworking and Alamofire which are great frameworks to ease the API calls in iOS.

但是我很难弄清楚如何发出一些请求,直到我松开网络才回来。
通常在会话登录或获取一些json列表或下载图像期间。

But i have difficulties to figure out how to make some requests to wait until network is back if i'm loosing it. Typically during session login or getting some json lists or downloading images.

您是否可以依靠一些教程或示例来提高自己的知识并能够建立强大的应用程序以抵抗网络可用性?

Do you have some tutorials or examples i can rely on to improve my knowledge and be able to build a strong application resilient to network availability ?

推荐答案

现在Alamofire刚刚包含了网络状态监听器

now Alamofire has just included a Network status listener

https://github.com/Alamofire/Alamofire/pull/ 1053

这篇关于iOS / Swift:如何使用Alamofire管理网络多功能性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆