title: Get SSID in Swift 2
body: <p>Im trying to use this code to get SSID</p>
  
  <pre><code>import Foundation
  import SystemConfiguration.CaptiveNetwork
  
  public class SSID {
      class func getSSID() -&gt; String{
          var currentSSID = ""
          let interfaces = CNCopySupportedInterfaces()
          if interfaces != nil {
              let interfacesArray = interfaces.takeRetainedValue() as [String : AnyObject]
              if interfacesArray.count &gt; 0 {
                  let interfaceName = interfacesArray[0] as String
                  let unsafeInterfaceData = CNCopyCurrentNetworkInfo(interfaceName)
                  if unsafeInterfaceData != nil {
                      let interfaceData = unsafeInterfaceData.takeRetainedValue() as Dictionary!
                      currentSSID = interfaceData[kCNNetworkInfoKeySSID] as! String
                      let ssiddata = NSString(data:interfaceData[kCNNetworkInfoKeySSIDData]! as! NSData, encoding:NSUTF8StringEncoding) as! String
                      // ssid data from hex
                      print(ssiddata)
                  }
              }
          }
          return currentSSID
      }
  }
  </code></pre>
  
  <p>But in getting an error in this line
  <code>let interfacesArray = interfaces.takeRetainedValue() as [String : AnyObject]</code></p>
  
  <p>The error is</p>
  
  <p><code>Value of type 'CFArray?' has no member 'takeRetainedValue'</code></p>
  
  <p>Thanks for your help</p>