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
private func configureWebView() { | |
let wkWebConfig = WKWebViewConfiguration() // We create a web view configuration | |
let wkUserController = WKUserContentController() // We create a user content controller for adding the JS for manipulating the CSS of the web page | |
wkWebConfig.userContentController = wkUserController | |
addHideHeaderScript(wkWebController: wkUserController) // We add the the hide header script | |
// We configure the web view, and add it as a subview to the current view | |
webView = WKWebView(frame: self.view.bounds, configuration: wkWebConfig) |
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
private func addPageHasChangedDelegateScript(wkWebController: WKUserContentController) { | |
// load the script from the file and create a WKUserScript object | |
let scriptURL = Bundle.main.path(forResource: Constants.detectPageChangeScript, ofType: "js") | |
let scriptContent = try! String.init(contentsOfFile: scriptURL!) | |
let script = WKUserScript(source: scriptContent, injectionTime: .atDocumentStart, forMainFrameOnly: false) | |
// Add the script to the WKUserContentController | |
wkWebController.addUserScript(script) | |
// Register for receiving callbacks from javascript for a notification name |
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
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) { | |
if (message.name == “notification_name”) { | |
print("Page changed") | |
} | |
} |
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
let startupViewController = StartupViewController() | |
let navController = UINavigationController(rootViewController: startupViewController) | |
appDelegate.window.rootViewController = navController |
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
pod install |
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
xcodebuild -list -project <your_project_name>.xcodeproj |
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
man xcodebuild |
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
xcodebuild -workspace <your_project_name>.xcworkspace -scheme <your_desired_schema> -configuration <your_desired_configuration> -destination 'platform=iOS Simulator,name=iPad Pro (12.9-inch),OS=10.2' -derivedDataPath <derived_data_path> BUILD_DIR=<build_directory_path> -UseModernBuildSystem=YES clean build -enableCodeCoverage=YES test |
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
xcodebuild -workspace <your_project_name>.xcworkspace \ | |
-scheme <your_desired_schema> -configuration <your_desired_configuration> \ | |
-destination 'platform=iOS Simulator,name=iPad Pro (12.9-inch),OS=10.2' \ | |
-derivedDataPath <derived_data_path> BUILD_DIR=<build_directory_path> \ | |
-UseModernBuildSystem=YES clean build -enableCodeCoverage=YES test |
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
xcrun llvm-cov show -instr-profile <path_of_the_Coverage.profdata_file> \ | |
<path_of_the_executable> > <name_of_the_report_file> |
OlderNewer