Skip to content

Instantly share code, notes, and snippets.

View Valpertui's full-sized avatar

Valentin Pertuisot Valpertui

View GitHub Profile
@Valpertui
Valpertui / ChatKitLoader.m
Created February 20, 2016 10:37 — forked from NSExceptional/ChatKitLoader.m
A quick and dirty example of loading classes at runtime
#import <dlfcn.h> // for dlopen()
#import "MirrorKit.h" // pod 'MirrirKit'
- (NSArray<NSString *> *)chatKitClassNames {
// Load the framework, close the handle. Now you can use any ChatKit class if you know its name.
void *handle = dlopen("/System/Library/PrivateFrameworks/ChatKit.framework/ChatKit", RTLD_NOW);
dlclose(handle);
// Making use of the Objc runtime to get the classes