Skip to content

Instantly share code, notes, and snippets.

@michzio
Created May 4, 2020 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michzio/7500f15930587672459f6b900aaef203 to your computer and use it in GitHub Desktop.
Save michzio/7500f15930587672459f6b900aaef203 to your computer and use it in GitHub Desktop.
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