Skip to content

Instantly share code, notes, and snippets.

@fellipecaetano
Created December 5, 2017 19:37
Show Gist options
  • Save fellipecaetano/abf5abc38ed3e290a795ce43165076c8 to your computer and use it in GitHub Desktop.
Save fellipecaetano/abf5abc38ed3e290a795ce43165076c8 to your computer and use it in GitHub Desktop.
@objc protocol Migration {}
func printMigrations() {
var classCount: UInt32 = 0
let classList = objc_copyClassList(&classCount)!
for index in 0 ..< Int(classCount) {
if class_conformsToProtocol(classList[index], Migration.self) {
print(classList[index])
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment