Skip to content

Instantly share code, notes, and snippets.

View EmilioPelaez's full-sized avatar
👨‍💻
I am the computerman

Emilio Pelaez Romero EmilioPelaez

👨‍💻
I am the computerman
View GitHub Profile
@EmilioPelaez
EmilioPelaez / FittedSheet.swift
Created February 21, 2023 19:50
Drop-in replacement for the `.sheet` modifier that will adjust the height of the sheet to fit the its content.
//
// Created by Emilio Peláez on 11/2/23.
//
import SwiftUI
public extension View {
func fittedSheet<Item: Identifiable, Content: View>(item binding: Binding<Item?>,
onDismiss: @escaping () -> Void = {},
content: @escaping (Item) -> Content) -> some View {