Skip to content

Instantly share code, notes, and snippets.

import UIKit
extension UIView {
var useAnchor: UIView {
translatesAutoresizingMaskIntoConstraints = false
return self
}
@discardableResult
import UIKit
class ViewController: UIViewController {
class Container: UIView {
init() {
super.init(frame: .zero)
backgroundColor = .red
}
NSURL *settingsURL = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
[UIApplication.sharedApplication openURL:settingsURL options:@{} completionHandler:nil];
@heaven-sweetie
heaven-sweetie / pre-commit-swiftlint.sh
Last active April 6, 2017 02:36 — forked from haruair/pre-commit-swiftlint.sh
Git Client-side pre-commit hook for SwiftLint
#!/bin/bash
#
# hook script for swiftlint. It will triggered when you make a commit.
#
# If you want to use, type commands in your console.
# $ ln -s ../../pre-commit-swiftlint.sh .git/hooks/pre-commit
# $ chmod +x .git/hooks/pre-commit
LINT=/usr/local/bin/swiftlint
if [[ -e "${LINT}" ]]; then