Skip to content

Commit

Permalink
Use KVC instead of NSClassFromString. This may reduce the possibility…
Browse files Browse the repository at this point in the history
… the app get rejected, I think.
  • Loading branch information
yeatse committed Oct 11, 2016
1 parent 9401b18 commit c2ac430
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/NSURLProtocol+WebKitSupport.m
Expand Up @@ -7,13 +7,18 @@
//

#import "NSURLProtocol+WebKitSupport.h"
#import <WebKit/WebKit.h>

/**
* The functions below use some undocumented APIs, which may lead to rejection by Apple.
*/

FOUNDATION_STATIC_INLINE Class ContextControllerClass() {
return NSClassFromString(@"WKBrowsingContextController");
static Class cls;
if (!cls) {
cls = [[[WKWebView new] valueForKey:@"browsingContextController"] class];
}
return cls;
}

FOUNDATION_STATIC_INLINE SEL RegisterSchemeSelector() {
Expand Down

0 comments on commit c2ac430

Please sign in to comment.