Skip to content

Instantly share code, notes, and snippets.

View RockinPaul's full-sized avatar
🐢

Paul Zarudnev RockinPaul

🐢
  • Amsterdam, Netherlands
View GitHub Profile
@RockinPaul
RockinPaul / KeyboardMove.swift
Last active March 21, 2018 17:50
Move view with keyboard. Swift 3/4 version.
override func viewDidLoad() {
NotificationCenter.default.addObserver(self, selector: #selector(LoginViewController.keyboardWillShow),
name: NSNotification.Name.UIKeyboardWillShow,
object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(LoginViewController.keyboardWillHide),
name: NSNotification.Name.UIKeyboardWillHide,
object: nil)
}
func keyboardWillShow(notification: NSNotification) {
#!/bin/bash
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*
open /Applications/Xcode.app