Im trying to use this code to get SSID
import Foundation
import SystemConfiguration.CaptiveNetwork
public class SSID {
class func getSSID() -> String
You can find an another answer with updated Swift standards of @japes answer which supports both Swift 3 and Swift 4. Return empty ""
on simulators.
import SystemConfiguration.CaptiveNetwork
internal class SSID {
class func fetchSSIDInfo() -> String {
var currentSSID = ""
if let interfaces = CNCopySupportedInterfaces() {
for i in 0..