Skip to content

Commit

Permalink
Enable developer mode for WebView in debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Reda Lemeden committed Sep 14, 2015
1 parent e354152 commit 7f800dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Markoff.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@
);
INFOPLIST_FILE = Markoff/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
OTHER_SWIFT_FLAGS = "-D DEBUG";
"OTHER_SWIFT_FLAGS[arch=*]" = "-D DEBUG";
PRODUCT_BUNDLE_IDENTIFIER = com.thoughtbot.Markoff;
PRODUCT_NAME = "$(TARGET_NAME)";
};
Expand All @@ -360,6 +362,7 @@
);
INFOPLIST_FILE = Markoff/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
OTHER_SWIFT_FLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = com.thoughtbot.Markoff;
PRODUCT_NAME = "$(TARGET_NAME)";
};
Expand Down
4 changes: 4 additions & 0 deletions Markoff/RenderViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class RenderViewController: NSViewController {
webView = WKWebView(frame: view.bounds, configuration: WKWebViewConfiguration())
view.addSubview(webView)
webView.translatesAutoresizingMaskIntoConstraints = false

#if DEBUG
webView.configuration.preferences.setValue(true, forKey: "developerExtrasEnabled")
#endif

view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[webView]|",
options: NSLayoutFormatOptions(),
Expand Down

0 comments on commit 7f800dc

Please sign in to comment.