AdmiralSwiftUI ZToastNotificationsView - admiral-team/admiralui-ios GitHub Wiki
Overview
ZToastNotificationsView
- A View for show toast.
ToastNotificationsDirection - Public enum for direction ZToastNotificationsView
Code
public var body: some View {
ZToastNotificationsView(
direction: .up,
isAfterTouchUpdateTimer: viewModel.toastDirection == .up,
bottomOffset: 64.0,
toastsDidDisappear: {
toastManager.model = nil
toastManager.toastDirection = nil
},
content: { presenter in
Text()
}
)
}
You can create a ZToastNotificationsView
by specifying the following parameters in the initializer
- animationDuration: Double - Animation duration.
- hideAnimationDuration: Double - Hidden toast animation duration.
- content: (ToastPresenter) -> (Content) - Сlosure passing in the argument by the parameter of the representative and returning View
- direction: ToastNotificationsDirection - Can be in the following states: up, down\
ToastNotificationsDirection can be one of the following values:
- up - Toast show from up.
- down - Toast show from dowm.
Live Example
To run live demo with ZToastNotificationsView
open Xcode and run project with Example target. Then in the main page -> ZToastNotificationsView:
Contribution
You can help us to find bugs or ask us to add features.
- To start
issue
please use ready-made templates. - To make changes to the repository, you need to create a
fork
of the project, make changes to the code and create apull request
in our project. You can read more about this in the Github documentation.