Skip to content

Instantly share code, notes, and snippets.

View gavinmn's full-sized avatar
👀

Gavin Nelson gavinmn

👀
View GitHub Profile
import SwiftUI
import UIKit
struct ContentView: View {
@State private var offset: CGFloat = 0
@State private var keyboardOpened: Bool = false
var body: some View {
VStack(spacing: 0) {
ScrollView {
@gavinmn
gavinmn / KeyboardAttachedView.swift
Created August 20, 2024 02:38
Attach a view to the keyboard with interactive dismissal support
//
// ContentView.Swift
// KeyboardAttachedView
//
// Created by Gavin Nelson on 8/19/24.
//
import SwiftUI
import UIKit
/* to be used with the default obsidian theme */
/* to install, add color-tweaks-minimal-tabs.css to .obsidian/snippets/ and enable in the settings */
.theme-light {
--color-base-05: #fafbfd;
--color-base-10: #f8f9fb;
--color-base-20: #f2f4f9;
--color-base-25: #dce0e8;
--color-base-30: #d8dce7;
--color-base-35: #cbd0dc;