Created
May 4, 2020 17:34
-
-
Save michzio/7500f15930587672459f6b900aaef203 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension List { | |
func attachKeyboardAvoider(_ keyboardAvoider: KeyboardAvoider, offset: CGFloat = 0) -> some View { | |
let (total, adjusted) = keyboardAvoider.keyboardOffsets(offset: offset) | |
return self | |
.padding(.bottom, total > 0 ? adjusted + 32 : 0) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment