Created
October 12, 2017 13:30
-
-
Save mikeash/d607b4f6eb8eace4b9bdfbf2ccdd19c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
var count: UInt32 = 0 | |
let ptr = objc_copyClassList(&count)! | |
let strings = (0 ..< Int(count)).flatMap({ | |
if class_getSuperclass(ptr[$0]) == nil { | |
return String(cString: class_getName(ptr[$0])) | |
} else { | |
return nil | |
} | |
}) | |
print(strings.joined(separator: ", ")) | |
// NSLeafProxy, __NSGenericDeallocHandler, _NSZombie_, Object, SwiftObject, __NSMessageBuilder, NSProxy, __NSAtom, NSObject |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment