File tree Expand file tree Collapse file tree 1 file changed +2
-21
lines changed Expand file tree Collapse file tree 1 file changed +2
-21
lines changed Original file line number Diff line number Diff line change 16
16
- [x] Only animates if view is fully on screen
17
17
18
18
``` swift
19
- import UIKit
20
- import KeyboardLayoutGuide
21
-
22
- class ViewController : UIViewController {
23
-
24
- // Create a keyboard layout guide.
25
- let keyboardLayoutGuide = KeyboardLayoutGuide ()
26
-
27
- @IBOutlet weak var button: UIButton!
28
-
29
- override func viewDidLoad () {
30
- super .viewDidLoad ()
31
-
32
- // Add the layout guide in the view.
33
- view.addLayoutGuide (keyboardLayoutGuide)
34
-
35
- // Constrain your button to the keyboardLayoutGuide's top Anchor
36
- // the way you would do natively :)
37
- button.bottomAnchor .constraint (equalTo : keyboardLayoutGuide.topAnchor ).isActive = true
38
- }
39
- }
19
+ button.bottomAnchor .constraint (equalTo : keyboardLayoutGuide.topAnchor ).isActive = true
40
20
```
21
+ * Constrain your button to the keyboardLayoutGuide's top Anchor the way you would do natively :) *
You can’t perform that action at this time.
0 commit comments