             shownCompactConstraints.forEach { $0.activate() }
         case .unspecified: break
         }
-    
+
         UIView.animate(withDuration: duration, delay: 0,
-                       options: UIViewAnimationOptions(rawValue: option.uintValue), animations: {
+                       options: UIView.AnimationOptions(rawValue: option.uintValue), animations: {
                         self.layoutIfNeeded()
         }, completion: nil)
     }
-    
-    private dynamic func keyboardWillHide(notification: Notification){
-        let duration = (notification as NSNotification).userInfo![UIKeyboardAnimationDurationUserInfoKey] as! TimeInterval
-        let option = (notification as NSNotification).userInfo![UIKeyboardAnimationCurveUserInfoKey] as! NSNumber
-        
+
+    @objc private dynamic func keyboardWillHide(notification: Notification) {
+        let duration = (notification as NSNotification).userInfo![UIResponder.keyboardAnimationDurationUserInfoKey] as! TimeInterval
+        let option = (notification as NSNotification).userInfo![UIResponder.keyboardAnimationCurveUserInfoKey] as! NSNumber
+
         switch traitCollection.verticalSizeClass {
         case .regular:
             shownRegularConstraints.forEach { $0.deactivate() }

private var ckmHiddenRegular: UInt8 = 2
private var ckmHiddenCompact: UInt8 = 3
extension UIView {
    
    fileprivate var shownRegularConstraints: [Constraint]! {
        get { return objc_getAssociatedObject(self, &ckmShownRegular) as? [Constraint] ?? [Constraint]() }
        set(newValue) { objc_setAssociatedObject(self, &ckmShownRegular, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN) }
    }
    
    fileprivate var shownCompactConstraints: [Constraint]! {
        get { return objc_getAssociatedObject(self, &ckmShownCompact) as? [Constraint] ?? [Constraint]() }
        set(newValue) { objc_setAssociatedObject(self, &ckmShownCompact, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN) }

    func keyboard(_ shown: Bool, in view: UIView) -> ConstraintMakerEditable {
        switch view.traitCollection.verticalSizeClass {
        case .regular:
            if shown { view.shownRegularConstraints.append(constraint) } else { view.hiddenRegularConstraints.append(constraint) }
        case .compact:
            if shown { view.shownCompactConstraints.append(constraint) } else { view.hiddenCompactConstraints.append(constraint) }
        case .unspecified: break
        }
        return self
