Skip to content

Instantly share code, notes, and snippets.

@implementation NSObject (forSwift)
- (id)__performSelector:(SEL)aSelector
{
Method m = class_getInstanceMethod(self.class, aSelector);
const char *types = method_copyReturnType(m);
if (strcmp("v", types)) {
return [self performSelector:aSelector];
} else {
@tarunon
tarunon / print.swift
Created June 10, 2014 11:27
Print Classes and Methods
func printClasses() {
var count: CUnsignedInt = 0
var clist = objc_copyClassList(&count)
for var i: CUnsignedInt = 0; i < count; i++ {
let c : AnyClass? = clist.memory
println(" #Class \(class_getName(c))")
printMethods(c)
clist = clist.succ()
}
}