Create a toast message quickly and customize it to what you want.
pod 'Toastyle-SwiftUI'
XCode -> File
-> Add Packages...
-> Paste https://github.com/eriffanani/Toastyle-SwiftUI
on Search Bar -> Select Up To Next Minor Version
-> Add Package
-> Done
import Toastyle
struct ContentView: View {
var body: some View {
ZStack { // Parent
Toastyle(text: "Basic Toast", show: $show)
}
}
}
Toastyle(text: "Text Color Toast", show: $show)
.textColor(Color.yellow)
Toastyle(text: "Icon Left Toast", icon: "info.circle.fill", show: $show)
Toastyle(text: "Icon Right Toast", image: "iconExample", show: $show4)
.iconColor(Color.yellow)
.iconPosition(.right)
Toastyle(text: "Bordered Toast Message", show: $show5)
.border(3, color: Color.orange)
Toastyle(text: "Toast Corner Radius", show: $show6)
.corner(22)
Toastyle(text: "Custom Corner Radius", show: $show7)
.corners(15, corners: [.topRight, .bottomLeft])
.border(3, color: Color.pink)
Toastyle(text: "Backgrund Color", show: $show8)
.corners(15, corners: [.topRight, .bottomLeft])
.border(3, color: Color.yellow)
.backgroundColor(Color.red)
Toastyle(text: "Custom Font Family", show: $show9)
.corner(10)
.font(font: .custom("Sunlit Memories", size: 20).bold())
Toastyle(text: "Success State Toast", show: $show10)
.state(.success)
Toastyle(text: "Shadow Warning State", show: $show11)
.state(.warning)
.shadow(true)
Toastyle(text: "Custom Position", show: $show12)
.state(.info)
.shadow(true)
.position(position: .top)
.padding(.top, 10)