Skip to content

Instantly share code, notes, and snippets.

@ryanlintott
ryanlintott / ContentView.swift
Last active August 15, 2025 23:36
A SwiftUI environment value for the keyboard height that updates with animation. This is useful when you want a specific view in a stack to stick to the bottom of the keyboard when the keyboard moves up. Now included in FrameUp https://github.com/ryanlintott/FrameUp
import SwiftUI
struct ContentView: View {
var body: some View {
KeyboardAvoidingWithOffset()
.keyboardHeightEnvironmentValue()
}
}
struct KeyboardAvoidingWithOffset: View {