标签:wifi 分享 src ict 解决 图片 log ring break
/************ 控制器的view 加载完毕 的时候调用 *****************************/
- (void)viewDidLoad {
[super viewDidLoad];
// 获取网络信息
NSDictionary *netInfo = [self fetchNetInfo];
NSString *SSID = [netInfo objectForKey:@"SSID"];
NSLog(@"网络信息 == %@", netInfo);
NSLog(@"wifi名 == %@", SSID);
}
/************ 获取网络信息 *****************************/
- (NSDictionary *)fetchNetInfo {
NSArray *interfaceNames = CFBridgingRelease(CNCopySupportedInterfaces());
NSDictionary *SSIDInfo;
for (NSString *interfaceName in interfaceNames) {
SSIDInfo = CFBridgingRelease(CNCopyCurrentNetworkInfo((__bridge CFStringRef)interfaceName));
BOOL isNotEmpty = (SSIDInfo.count > 0);
if (isNotEmpty) {
break;
}
}
return SSIDInfo;
}
标签:wifi 分享 src ict 解决 图片 log ring break
原文地址:https://www.cnblogs.com/CH520/p/9923796.html