How To check if wifi option enabled or not

后端 未结 3 1445
天命终不由人
天命终不由人 2020-12-19 01:41

How to check if wifi option is enabled on the iPhone or not (but maybe iPhone not connected to one of the wifi net).

3条回答
  •  感情败类
    2020-12-19 01:45

    Found a great line of code for this. Add the Reachability class to your project and then you can do this:

    BOOL isConnectedProperly = ([[Reachability reachabilityForInternetConnection] currentReachabilityStatus] == ReachableViaWiFi);
    

提交回复
热议问题