diff --git a/.swiftpm/xcode/package.xcworkspace/xcuserdata/macintoshi.xcuserdatad/UserInterfaceState.xcuserstate b/.swiftpm/xcode/package.xcworkspace/xcuserdata/macintoshi.xcuserdatad/UserInterfaceState.xcuserstate index 21acd0e..96ddd2e 100644 Binary files a/.swiftpm/xcode/package.xcworkspace/xcuserdata/macintoshi.xcuserdatad/UserInterfaceState.xcuserstate and b/.swiftpm/xcode/package.xcworkspace/xcuserdata/macintoshi.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Sources/ToastKit/ToastStack/ToastStackManager.swift b/Sources/ToastKit/ToastStack/ToastStackManager.swift index 0065f58..06b4c43 100644 --- a/Sources/ToastKit/ToastStack/ToastStackManager.swift +++ b/Sources/ToastKit/ToastStack/ToastStackManager.swift @@ -8,14 +8,14 @@ import SwiftUI @available(macOS 14.0, *) @available(iOS 17, *) -struct ToastItemModel: Identifiable, Equatable { +public struct ToastItemModel: Identifiable, Equatable { let id = UUID() let title: String let toastColor: ToastColorTypes let autoDisappearDuration: TimeInterval let isStackMaxHeight: Bool = false - static func == (lhs: ToastItemModel, rhs: ToastItemModel) -> Bool { + public static func == (lhs: ToastItemModel, rhs: ToastItemModel) -> Bool { return lhs.id == rhs.id } } @@ -24,7 +24,7 @@ struct ToastItemModel: Identifiable, Equatable { @available(iOS 17, *) @MainActor -class ToastStackManager: ObservableObject { +public class ToastStackManager: ObservableObject { @Published var toasts: [ToastItemModel] = [] func show(title: String, toastColor: ToastColorTypes, autoDisappearDuration: TimeInterval = 2.0) { diff --git a/Sources/ToastKit/ToastStack/ToastStackView.swift b/Sources/ToastKit/ToastStack/ToastStackView.swift index cb24063..d245332 100644 --- a/Sources/ToastKit/ToastStack/ToastStackView.swift +++ b/Sources/ToastKit/ToastStack/ToastStackView.swift @@ -9,11 +9,11 @@ import SwiftUI @available(macOS 14.0, *) @available(iOS 17, *) -struct ToastStackView: View { +public struct ToastStackView: View { @StateObject var vm: ToastStackManager let transitionType: AnyTransition - init( + public init( vm: ToastStackManager, transitionType: AnyTransition = .move(edge: .top).combined(with: .opacity) ) { @@ -21,7 +21,7 @@ struct ToastStackView: View { self.transitionType = transitionType } - var body: some View { + public var body: some View { VStack { ForEach(vm.toasts, id: \.id) { toast in ZStack {