Im trying to use this code to get SSID
import Foundation
import SystemConfiguration.CaptiveNetwork
public class SSID {
class func getSSID() -> String
In Swift 3 (works in real device and simulator):
import SystemConfiguration.CaptiveNetwork
internal class SSID {
class func fetchSSIDInfo() -> String {
var currentSSID = ""
if let interfaces:CFArray = CNCopySupportedInterfaces() {
for i in 0..
Usage:
SSID.fetchSSIDInfo()
//will return "" if no connected wifi or running in simulator