Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
chFlorian committed Jun 17, 2021
1 parent bbc2a88 commit 1009228
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Sources/BottomSheet/Modifiers/BottomSheetModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import SwiftUI

struct BottomSheet<T: Any, ContentView: View>: ViewModifier {
struct BottomSheet<ContentView: View>: ViewModifier {
@Binding private var isPresented: Bool
private let detents: [UISheetPresentationController.Detent]
private let prefersGrabberVisible: Bool
Expand Down Expand Up @@ -40,14 +40,14 @@ struct BottomSheet<T: Any, ContentView: View>: ViewModifier {
}

init(
item: Binding<Optional<T>>,
item: Binding<Optional<Any>>,
detents: [UISheetPresentationController.Detent] = [.medium(), .large()],
prefersGrabberVisible: Bool = false,
smallestUndimmedDetentIdentifier: UISheetPresentationController.Detent.Identifier? = nil,
prefersScrollingExpandsWhenScrolledToEdge: Bool = true,
prefersEdgeAttachedInCompactHeight: Bool = false,
widthFollowsPreferredContentSizeWhenEdgeAttached: Bool = false,
@ViewBuilder contentView: (T) -> ContentView
@ViewBuilder contentView: () -> ContentView
) {
self.isPresented = Binding<Bool>(get: {
item != nil
Expand All @@ -60,7 +60,7 @@ struct BottomSheet<T: Any, ContentView: View>: ViewModifier {
self.prefersScrollingExpandsWhenScrolledToEdge = prefersScrollingExpandsWhenScrolledToEdge
self.prefersEdgeAttachedInCompactHeight = prefersEdgeAttachedInCompactHeight
self.widthFollowsPreferredContentSizeWhenEdgeAttached = widthFollowsPreferredContentSizeWhenEdgeAttached
self.contentView = contentView(item.wrappedValue)
self.contentView = contentView()
}

func body(content: Content) -> some View {
Expand Down Expand Up @@ -132,15 +132,15 @@ extension View {
)
}

public func bottomSheet<T: Any, ContentView: View>(
item: Binding<Optional<T>>,
public func bottomSheet<ContentView: View>(
item: Binding<Optional<Any>>,
detents: [UISheetPresentationController.Detent] = [.medium(), .large()],
prefersGrabberVisible: Bool = false,
smallestUndimmedDetentIdentifier: UISheetPresentationController.Detent.Identifier? = nil,
prefersScrollingExpandsWhenScrolledToEdge: Bool = true,
prefersEdgeAttachedInCompactHeight: Bool = false,
widthFollowsPreferredContentSizeWhenEdgeAttached: Bool = false,
@ViewBuilder contentView: (T) -> ContentView
@ViewBuilder contentView: () -> ContentView
) -> some View {
self.modifier(
BottomSheet(
Expand Down

0 comments on commit 1009228

Please sign in to comment.