Skip to content

Instantly share code, notes, and snippets.

@saitomarch
saitomarch / bootstrap.sh
Last active May 18, 2020
Bootstrap scripts to install depended packages (which provided on RubyGems Bundler, CocoaPods, Carthage and NPM) automatically for macOS/iOS App Project.
View bootstrap.sh
#!/bin/sh
usage_exit() {
echo "Usage: $0 [-u] [-c]" 1>&2
echo " -u: Update packages"
echo " -c: Clean caches"
exit 1
}
abort() {
@saitomarch
saitomarch / viewport_injection.swift
Created Jan 19, 2017
WKWebView JavaScript Injection to block zoom.
View viewport_injection.swift
// Remember to import WebKit at the top of the file
let source = "var meta = document.createElement('meta');" +
"meta.name = 'viewport';" +
"meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no';" +
"var head = document.getElementsByTagName('head')[0];" +
"head.appendChild(meta);"
let userContentController = WKUserContentController()
userContentController.addUserScript(script)
You can’t perform that action at this time.