Skip to content

Instantly share code, notes, and snippets.

@aratkevich
Created June 20, 2017 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aratkevich/81c92c679b78bdf35dd37532f2abdd0d to your computer and use it in GitHub Desktop.
Save aratkevich/81c92c679b78bdf35dd37532f2abdd0d to your computer and use it in GitHub Desktop.
SSID wifi
NSString *ssid = nil;
NSArray *ifs = (id)CFBridgingRelease(CNCopySupportedInterfaces());
for (NSString *ifnam in ifs) {
NSDictionary *info = (id)CFBridgingRelease(CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam));
if (info[@"SSID"]) {
ssid = [info[@"SSID"] copy]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment