Skip to content

Commit

Permalink
Publish the BottomSheetView
Browse files Browse the repository at this point in the history
  • Loading branch information
nonameplum committed Nov 7, 2022
1 parent a1c294c commit 02eff5b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Sources/SwiftUIModal/BottomSheetView.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftUI

struct BottomSheetView<Content>: DismissableView where Content: View {
var onDismiss: () -> Void
public struct BottomSheetView<Content>: DismissableView where Content: View {
public var onDismiss: () -> Void

@GestureState private var translation: CGFloat = 0
@State private var contentHeight: CGFloat = 0
Expand All @@ -14,7 +14,7 @@ struct BottomSheetView<Content>: DismissableView where Content: View {

private let content: Content

init(
public init(
configuration: BottomSheetConfiguration? = nil,
onDismiss: @escaping () -> Void = {},
@ViewBuilder content: () -> Content
Expand All @@ -24,7 +24,7 @@ struct BottomSheetView<Content>: DismissableView where Content: View {
self.content = content()
}

var body: some View {
public var body: some View {
GeometryReader { geometry in
VStack(spacing: 0) {
configuration.indicator
Expand Down Expand Up @@ -68,7 +68,7 @@ struct BottomSheetView<Content>: DismissableView where Content: View {
}
}

func dismiss(completion: @escaping () -> Void = {}) {
public func dismiss(completion: @escaping () -> Void = {}) {
withAnimation(springAnimation) {
show = false
}
Expand Down
1 change: 0 additions & 1 deletion Sources/SwiftUIModal/NonAnimatedUIKitModal.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import UIKit
import SwiftUI


/// A view that presents SwiftUI ``DismissableView`` modaly without animation.
public struct NonAnimatedUIKitModal<Presented>: UIViewControllerRepresentable where Presented: DismissableView {
public let isPresented: Binding<Bool>
Expand Down

0 comments on commit 02eff5b

Please sign in to comment.