iOS/iPhone Reachability - How to only check when internet is lost/not reachable using Reachability.m/.h

前端 未结 7 605
一生所求
一生所求 2021-02-01 09:59

Currently i am using the class by apple reachability.m/.h and it works, except it notifies me for any change, where as i would like to only notify the user if the network is not

7条回答
  •  南旧
    南旧 (楼主)
    2021-02-01 10:34

    I would implement the whole Reachability class, tie it into your code as necessary and remove or comment out parts of Reachability. Just remove, one by one, the things you do not want to be notified of. Obviously, you need a good understanding of obj-c, the Reachability class, notifications, etc., but it can be done.

提交回复
热议问题