https://github.com/sameersyd/motiontoastview
A Beautiful Multipurpose Motion Toast Library in iOS using Swift
https://github.com/sameersyd/motiontoastview
alert beautiful-toast-library cocoapods ios ios-swift library motion-toast sameersyd swift toast-style ui-design xcode
Last synced: 11 months ago
JSON representation
A Beautiful Multipurpose Motion Toast Library in iOS using Swift
- Host: GitHub
- URL: https://github.com/sameersyd/motiontoastview
- Owner: sameersyd
- License: mit
- Created: 2020-08-11T12:45:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-29T11:13:12.000Z (over 5 years ago)
- Last Synced: 2025-02-28T12:24:35.020Z (11 months ago)
- Topics: alert, beautiful-toast-library, cocoapods, ios, ios-swift, library, motion-toast, sameersyd, swift, toast-style, ui-design, xcode
- Language: Swift
- Homepage:
- Size: 132 KB
- Stars: 99
- Watchers: 3
- Forks: 15
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MotionToastView - A Beautiful Toast Library for iOS Swift
[](https://travis-ci.org/sameersyd/MotionToastView)
[](https://cocoapods.org/pods/MotionToastView)
[](https://cocoapods.org/pods/MotionToastView)
[](https://cocoapods.org/pods/MotionToastView)
A Beautiful Multipurpose Motion Toast Library in iOS using Swift 😍

## Preview - Vibrant Toast 🌈

## Preview - Pale Toast 🌟

## Preview - Dark Vibrant Toast 🌈

## Preview - Dark Pale Toast 🌈

# Types of Toast Style ❤️
1. Pale Toast
2. Vibrant Toast
3. Dark Pale Toast
4. Dark Vibrant Toast
## About
A Beautiful Multipurpose Motion Toast View in iOS using Swift with full customisation options. The library is developed using Swift 5.
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Installation
MotionToastView is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'MotionToastView'
```
Import MotionToastView in your class
```ruby
import MotionToastView
```
## 4️⃣ Toast types
```
1 .success
2 .error
3 .warning
4 .info
```
## ✌🏻 Toast styles
```
1 .style_vibrant
2 .style_pale
```
## ⌛️ Toast duration
```
1 .short // 2 Seconds
2 .long // 4 Seconds
```
# Usage
## Sample Code for - Motion Toast View 🌟
### Success Toast
(Basic)
```
MotionToast(message: "You have successfully completed the trip", toastType: .success)
```
### Error Toast
(with corner radius)
```
MotionToast(message: "You have failed to complete the trip", toastType: .error, toastCornerRadius: 12)
```
### Warning Toast
(with duration, style, gravity, pulseEffect)
```
MotionToast(message: "You are not in the location. Try again", toastType: .warning, duration: .long,
toastStyle: .style_pale, toastGravity: .centre, pulseEffect: false)
```
### Info Toast
(with duration, style, gravity)
```
MotionToast(message: "You have failed to complete the trip", toastType: .info,
duration: .long, toastStyle: .style_pale, toastGravity: .top)
```
## Note:
#### Light and Dark mode are set using system preference
#### toastCornerRadius parameter is only for toast style - vibrant
## Motion Toast View
Parameter
Optional
Default Value
Type
Values Available
message
false
nil
String
custom
toastType
false
nil
enum
[.success, .error, .warning, .info]
duration
true
.short
enum
[.short, .long]
toastStyle
true
.style_vibrant
enum
[.style_vibrant, .style_pale]
toastGravity
true
.bottom
enum
[.top, .centre, .bottom]
toastCornerRadius
true
0
Int
custom
pulseEffect
true
true
Bool
[true, false]
## ✍🏻 Want More Customisation?
```
MotionToast_Customisation(header: "Custom Toast", message: "It gives you more customisation options.",
headerColor: UIColor(red: 255.0, green: 255.0, blue: 255.0, alpha: 1.0),
messageColor: UIColor(red: 239.0, green: 239.0, blue: 239.0, alpha: 0.7),
primary_color: UIColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 0.5),
secondary_color: UIColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 1.0),
icon_image: UIImage(named: "apple")!, duration: .long, toastStyle: .style_pale,
toastGravity: .bottom, toastCornerRadius: 12, pulseEffect: true)
```
## Checkout Android version of this library Motion Toast
#### Design Inspired from @Spikeysanju
## Donation
If this project helped you reduce time to develop, you can buy me a cup of coffee :)
## Author
Sameer Nawaz, sameer.nwaz@gmail.com
## License
MotionToastView is available under the MIT license. See the LICENSE file for more info.
