Bot releases are hidden (Show)
This version adds a UrlOpener
, as well as new extensions:
EdgeInsets+Edge
simplifies getting the inset for a certain edge.View+Screenshot
can be used to snapshot any SwiftUI view.View+Visible
has conditional extensions to hide or show a view.There are now more convenient alert
, sheet
and toast
view modifiers, that take a context instead of a binding and a content.
This version contains more breaking changes for the toast components.
ToastContext
works just like SheetContext
and AlertContext
.ToastContext
, SheetContext
and AlertContext
share a base class.ToastProvider
that can be used with ToastContext
.toast
modifier handles presenting and dismissing the toast.Toast
view has been removed, since it's no longer needed.You can now use any views with the toast context and modifier, so it should make the toast easier to understand and to use.
This release adds:
ImagePicker
that can be used to present a UIImagePickerController
.FilePicker
that can be used to present a UIDocumentPickerViewController
.ShareSheet
that can be used to present a UIActivityViewController
.UserDefaultsPersisted
property wrapper that lets you persist data to UserDefaults
.This release changes the View
geometry extensions and replaces bindGeometry(to: ...)
with:
bindSafeAreaInsets(to: ...)
bindSize(to: ...)
You can use them like this:
@State private var size: CGSize = .zero
@State private var size: CGSize = .zero
UIColor.red.bindGeometry(to: $height) { $0.size.height }
This release adds some new toast features:
ToastContext
is an observable object can be used to manage a view's toast.ToastStyle
is a new struct that contains all available styles for a toast.This release makes some small api changes:
SwipeGesture
initializer has been made public.Toast
now uses ToastStyle
instead of separate style properties.Toast
extensions now require you to specify a background.Toast
extension automatically centers the text.This release adds new style structs:
CornerRadiusStyle
style can be used to specify corner radii.FontStyle
style can be used to specify custom fonts.ShadowStyle
style can be used to specify drop shadow styles.These view modifiers simplifies using these styles:
cornerRadius(_ style:)
can be used to apply a CornerRadiusStyle
.font(_ style: FontStyle)
can be used to apply a FontStyle
.font(name:, style:, weight:)
can also be used to apply custom fonts.shadow(_ style:)
can be used to apply a ShadowStyle
.The release also adds new view extensions:
blur(...)
simplifies using the system blur styles that are specified in this library.border(content:,width:,cornerRadius:)
can be used to apply borders with a certain content (e.g. Color.red), width and corner radius.