Apples Reachability类有更复杂的替代品吗? [英] Are there more sophisticated alternatives to Apples Reachability class?

查看:157
本文介绍了Apples Reachability类有更复杂的替代品吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Apple创建了着名的Reachability类,但查看代码我不太信任它。格式和标题很乱。

Apple has created that famous Reachability class but looking at the code I don't trust it much. The formatting and header is messy.

此外,它没有提供显示你没有互联网!的帮助。警告。

Also it provides no help for showing that "You have no internet!" alert.

我只想这样做:


  • 点下载XML。

  • At some point download a XML.

当没有互联网时,显示提醒。

When there is no internet, show alert.

当互联网在下载XML时断开连接时,显示警告。

When internet disconnects while downloading the XML, show alert.

在我的应用中,用户点按没有下载按钮自动在后台。

In my app the user taps no download button it all happens automatically in the background.

就是这样。真。我现在花了3个小时用Reachability我的大脑拒绝它。

That's it. Really. I spent now 3 hours with Reachability my brain just rejects it.

有人用干净的标题和干净的代码创建了一个聪明的替代品吗?什么东西真的很简单?

Did someone create a clever alternative with a clean header and clean code? Something that is really simple to use?

推荐答案

我在GitHub上找到了一个:
https://github.com/tonymillion/Reachability

I've found one on GitHub: https://github.com/tonymillion/Reachability

注意:首先找到!=必然最好找。

Note: First find != necessarily best find.

这篇关于Apples Reachability类有更复杂的替代品吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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