Skip to content

Instantly share code, notes, and snippets.


Andrew Benson drewster99

  • Nuclear Cyborg Corp
  • Minnesota USA
View GitHub Profile
drewster99 / ArbitraryViewController.swift
Created Jun 29, 2018
Move views out of the way when keyboard appears, Swift 4.1, using Auto-Layout / Interface Builder / Storyboard
View ArbitraryViewController.swift
// Move views when keyboard appears/disappears
// Snipped from ViewController.swift
// This constraint should be tied to the top superview or safe area in Storybaord
@IBOutlet weak var closeButtonTopConstraint: NSLayoutConstraint!
private var topConstraintOriginalConstant: CGFloat?
private var topConstraintScrolledConstant: CGFloat = 0
You can’t perform that action at this time.