Created
November 27, 2014 02:25
-
-
Save claybridges/39e47f4579fd9526273f to your computer and use it in GitHub Desktop.
Allows setting of WKPreferences.developerExtrasEnabled flag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import WebKit; | |
@interface WKPreferences (DevExtras) | |
@property (nonatomic, setter=_setDeveloperExtrasEnabled:) BOOL _developerExtrasEnabled; | |
- (void)enableDevExtras; | |
@end1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2014 Clay Bridges. All rights reserved. | |
#import "WKPreferences+DevExtras.h" | |
@implementation WKPreferences (DevExtras) | |
@dynamic _developerExtrasEnabled; | |
- (void)enableDevExtras | |
{ | |
[self _setDeveloperExtrasEnabled:YES]; | |
} | |
@end | |
Bad idea to do it this way: you may get rejected due to use of internal APIs. Use the setValue
way instead.
This solution doesn't seem to work in iOS. It just works in OS X. Am I right?
is it Working fine or getting any issues ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Original info from this SO question.
Works in Objective-C or Swift.
In Swift, you'll need to add the following line to your bridging header:
Usage looks like