AFNetworking 2.0 Reachability

后端 未结 7 1381
误落风尘
误落风尘 2020-12-07 15:33

I am trying to determine if the user is connected to the internet by using AFNetworking 2.0 and the \"AFNetworkReachabilityManager\", but it doesen\'t seem to work. It\'s al

相关标签:
7条回答
  • 2020-12-07 16:40

    That's because that block is only executed when reachability changes.

    To get the current status, you can do this:

    - (BOOL)connected {
        return [AFNetworkReachabilityManager sharedManager].reachable;
    }
    
    0 讨论(0)
提交回复
热议问题