windowID ) var items = [Dictionary<NSObject, AnyObject>]() for i in 0..<CFArrayGetCount(windowInfosRef) { let lineUnsafePointer:UnsafePointer<Void> = CFArrayGetValueAtIndex(windowInfosRef, i) let lineRef = unsafeBitCast(lineUnsafePointer, CFDictionaryRef.self) let dictionary = lineRef as Dictionary<NSObject, AnyObject> print((dictionary[kCGWindowLayer as String] as! NSNumber).integerValue) items.append(dictionary) }