Are there more sophisticated alternatives to Apples Reachability class?

冷暖自知 提交于 2019-11-28 01:36:24

问题


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.

I just want to do:

  • At some point download a XML.

  • When there is no internet, show alert.

  • 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.

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?


回答1:


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

Note: First find != necessarily best find.




回答2:


Maybe its too late to respond, but following answer can help someone looking for solution to same problem, as I answered here.

Easiest way to detect Internet connection on iOS?



来源:https://stackoverflow.com/questions/10801527/are-there-more-sophisticated-alternatives-to-apples-reachability-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!