Private framework is for apple use only, and usage of private framework may cause rejection of app submission. You can use class-dump
to get method signatures but you can not get any constants or C functions.
- nst/iOS-Runtime-Headers
- nst/RuntimeBrowser
- Cykey/ios-reversed-headers
- kennytm/iphone-private-frameworks
- /System/Library/Frameworks by theiphonewiki
- PrivateFrameworks by iphonedevwiki
- ios-private-frameworks on stackoverflow
- iOS/OS X TIMELINE
- How to correctly configure building private OS X frameworks
- Using the UIAutomation Private Framework
- Bluetooth hen you have used a private API in iOS
- iOS otool to detect private apis
//============Calling class method============//
Class MFMailComposeViewController = (NSClassFromString(@"MFMailComposeViewController"));
if ([MFMailComposeViewController canSendMail] == YES) {
NSLog(@"can send mail");
}
// please read UIAutocorrectInlinePrompt.h at https://github.com/nst/iOS-Runtime-Headers/blob/master/Frameworks/UIKit.framework/UIAutocorrectInlinePrompt.h
//============Calling instance method============//
//============UIAutocorrectInlinePrompt============//
Class UIAutocorrectInlinePrompt = NSClassFromString(@"UIAutocorrectInlinePrompt");
id obj = [[UIAutocorrectInlinePrompt alloc] init];
/**
* using NSObject's performSelector:withObject method
*/
if ([obj respondsToSelector:@selector(setFrame:)]) {
// wrap CGRect with object, performSelector:withObject: require object
NSValue *value = [NSValue valueWithCGRect:CGRectMake(0, 0, 100, 100)];
[obj performSelector:@selector(setFrame:) withObject:value];
}
/**
* using NSInvocation to support limitless argument
*/
SEL setFrameSelector = @selector(setFrame:);
if ([obj respondsToSelector:setFrameSelector]) {
CGRect rect = CGRectMake(0, 0, 200, 200);
NSInvocation *inv = [NSInvocation invocationWithMethodSignature:[obj methodSignatureForSelector:setFrameSelector]];
[inv setSelector:setFrameSelector];
[inv setTarget:obj];
[inv setArgument:&rect atIndex:2]; //arguments 0 and 1 are self and _cmd respectively, automatically set by NSInvocation
[inv invoke];
}
how to do this in swift, xcode version 9.2