-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Do follow our blog pages ๐
Loafjet is a light weight Toast(Loaf) generator library which allows the user to add customised Toasts to their projects. Loafjet comes with various types of Toast Animations as well as Toast Positions. It can be used to add gradient and plain toasts. Loafjet comes with extra features like Popup Card and Loading Indicator which can be customised according to your needs.
Airpods Detection | Silent | Normal |
---|---|---|
- More Customisation sytles ๐.
Loafjet is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Loafjet'
- I've provided a demo project to showcase the uses of Loafjet! Simply clone this repo, and open
Loafjet.xcworkspace
. - Run
pod install
. - Here you can see and experiment custom Loaf styles in
Examples.swift
.
From any view controller, a Loaf can be presented by following this two steps:
import Loafjet
Loaf.PlainLoaf(message: "Message goes here", position: .Bottom, animationDirection: .Bottom, loafjetView: View)
Plain Default Loaf |
---|
- This is the most basic Loafjet that you can make with least line of code ๐.
- Below all Loafjet types are mentioned , have a look on it ๐.
* With Default Parameters ๐
Loaf.PlainLoaf(message: String, position: loafPosition, animationDirection: loafAnimation, loafjetView: UIView)
* Without Default Parameters ๐
Loaf.PlainLoaf(message: String, position:LoafPosition, loafWidth:CGFloat , loafHeight:CGFloat, cornerRadius: CGFloat, fontStyle: String, fontSize: CGFloat, bgColor: UIColor, fontColor: UIColor, alphaValue:CGFloat, loafImage: String? , animationDirection: LoafAnimation , duration: TimeInterval, loafjetView: UIView)
- Plain Loaf Demo Photo ๐
* With Default Parameters ๐
Loaf.GradientLoaf(message: String, position: LoafPosition, bgColor1: UIColor, bgColor2: UIColor, fontColor: UIColor, loafImage: String?, animationDirection: loafAnimation, loafjetView: UIView)
* Without Default Parameters ๐
Loaf.GradientLoaf(message: String, position:LoafPosition, loafWidth:CGFloat, loafHeight:CGFloat, cornerRadius: CGFloat, fontStyle: String, fontSize: CGFloat, bgColor1: UIColor, bgColor2: UIColor, fontColor: UIColor, loafImage: String?, animationDirection: LoafAnimation, duration: TimeInterval, loafjetView: UIView)
- Gradient Loaf Demo Photo ๐
* With Default Parameters ๐
Loaf.PopupCard(message: String, position: LoafPosition, bgColor1: UIColor, bgColor2: UIColor, fontColor: UIColor, loafImage: String?, blurEffect: UIBlurEffectStyle?, loafjetView: UIView)
* Without Default Parameters ๐
Loaf.PopupCard(message: String, position:LoafPosition, loafWidth:CGFloat, loafHeight:CGFloat, cornerRadius: CGFloat, fontStyle: String, fontSize: CGFloat, bgColor1: UIColor, bgColor2: UIColor, fontColor: UIColor, loafImage: String?, duration: TimeInterval, blurEffect: UIBlurEffectStyle?, loafjetView: UIView)
- Popup Card Demo Photo ๐
* With Default Parameters ๐
Loaf.dashBoard(dashImage: String, dashTitle: String, dashContent: String, dashButtonTitle: String, mainView: UIView)
* Without Default Parameters ๐
Loaf.dashBoard(dashSpacing: CGFloat, dashRadius: CGFloat, dashColor: UIColor, dashImage: String, dashImageRadius: CGFloat, dashTitle: String, dashTitleColor: UIColor, dashContent: String, dashContentColor: UIColor, dashButtonTitle: String, dashButtonTitleColor: UIColor, dashButtonColor: UIColor, dashButtonRadius: CGFloat, dashButtonBorderColor: UIColor, dashButtonBorderWidth: CGFloat, dashDuration: TimeInterval, mainView: UIView)
- Dash Board Demo Photo ๐
* With Default Parameters ๐
Loaf.LoafWheel(message: String, bgColor1: UIColor, bgColor2: UIColor, loafWheelView: UIView)
* Without Default Parameters ๐
Loaf.LoafWheel(message: String, loafWidth:CGFloat, loafHeight:CGFloat, cornerRadius:CGFloat, bgColor1:UIColor, bgColor2:UIColor, fontStyle: String, fontSize: CGFloat, fontColor: UIColor, duration: TimeInterval, wheelStyle: UIActivityIndicatorViewStyle, blurEffect: UIBlurEffectStyle ,loafWheelView: UIView)
- Loafwheel Demo Photo ๐
- Calling
LoafWheel Dismissal
is required when LoafWheel is used for Dynamic Processingโ.
Loaf.dismissWheel(loafWheelView:UIView)
I have a solution ๐
- Add this Loaf.swift file into your project.
- Now you are ready to use Loafjet ๐.
- Remaining steps are same ๐.
- Do read the documentation till the end to get a reward ๐ from Loafjet Organisation.
|
|
- Customise your Loaf according to the below given chart ๐.
Position & Animation | Left | Right | Top | Bottom |
---|---|---|---|---|
Top | โ | โ | โ | โ |
Centre | โ | โ | โ | โ |
Bottom | โ | โ | โ | โ |
- The above mentioned โ means that particular combination of position & animation won't be working accurately .
Plain(Top) | Plain(Bottom) | Plain(Centre) | Plain(Centre) |
---|---|---|---|
Gradient(Top) | Gradient(Bottom) | Gradient(Centre) | Gradient(Centre) |
- Above shown are few possible ways, you can customise according to your need (Customisation shown below).
- Loafjet offers you a wide variety of customisation, select a style and apply your creativity on it.
- This are some possible ways, "How Loafjet can be used ?".
Do Not Disturb | Information | Warning |
---|---|---|
Success | Error | Device Detection |
-
Dash Board
,Gradient Loafwheel
&Popup card
are the additional customisation which you get in Loafjet๐ฅณ.
Popup Card | Loaf Wheel |
---|---|
- These are some possible ways of customisation ๐ก
Loafjet Proprietary | Alert Style | Successful Style |
---|---|---|
Dark Mode | Light Mode |
---|---|
- The above shown are some possible ways, How you can customise?, do try making your own and send it to us here ๐ฒ
- What are you waiting for, write
pod Loafjet
andpod install
it . - Done?, Now enjoy using Loafjet๐.
- Loafjet is made with Landscape + Portrait support* ๐.
- Now You can use your favourite Loaf without taking care of orientation๐.
- Have a look on your favourite Loafjet supports ๐
Loafjet | Portrait | Landscape |
---|---|---|
Plain Loaf | โ | โ |
Gradient Loaf | โ | โ |
Popup Card | โ | โ |
Dash Board | โ | โ |
Loaf Wheel | โ | โ |
- Other than Dash board all the Loafjets support every type of orientation ๐.
- Dash Board Landscape support will be added soon, stay tuned ๐ป
Top(Top) | Bottom(Bottom) |
---|---|
Centre(Right) | Centre(Left) |
---|---|
- These are some possible
Position X Animation
combination, Loafjet supports various other combinations too.
- At a time you can only use one Loaf(Simultaneous use is allowed).
- Customise Loaf Position and Anmation according to the above given table.
- Use
.greatestFiniteMagnitude
in duration to get an infinte loader. - To dismiss the loader use
Loaf.dismissWheel(LoafWheelView:UIView)
. - For certain colors and blur effect particular iOS version is required, So to solve it use the below code (By default Xcode will show you both the fix).
// iOS versions will varry
if #available(iOS 10.0, *) {.
// write the code to run
}
else {
print("Error Message")
}
// iOS versions will varry
@available(iOS 10.0, *)
- Test Run of few Loafjets are given, have a look on it (Running all Loafjets at a time may lead to irregular functioning!).
- Currently 'Loafjet' dont support SF Symbols, if you need it just raise an issue and I will try to add it โ๏ธ.
- The Loafimage you add must be present in the
Images.xcassets
file . - Loafimages which you add must be of A x A Size(Else images may get cutout!).
- In the Test Run make sure you don't run all the Loafjets at a time, wait for one whole Loafjet to complete its task, then go for next.
- All the Loafjets are created with default parameters too, so notice carefully which one you are using (Functions with and without default parameters are shown โฌ๏ธ).
- Loafjet is still in developement stage, you might face some bugs; do create an issue and inform usโฎ๏ธ.
Loafjet is available under the MIT license. See the LICENSE file for more info.
- Run the app - Steps are mentioned above.
- If you face issues in any step open a new issue.
- To fix issues: Fork this repository, make your changes and make a Pull Request.
- Device running on iOS/iPadOS 12.0+ versions ๐ฑ.
- Swift 5.1+ ๐ป
- Want to be a part of our Organisation ๐, then:
- Mail us here โ๏ธ
- Do mention the following things:
1. Reason
2. Motive
3. Skills
4. What you liked abou Loafjetโค๏ธ
- We are eager to read you mailโก๏ธ!
If you like using any of my projects or like what I'm doing, please consider backing me with appreciating my work: Message me๐ฅฐ
OR
Drop a star โญ if you find this project interesting!
If you โค๏ธ the project then there is a gift for you:
- Gift From Loafjet Organisation
- Set the following image as your iPhone's Lock Screen wallpaper and see the magic ๐ช.
- Thank Me later by giving a โญ๏ธ to Loafjet๐ .
Made with โค๏ธ in ๐ฎ๐ณ By Gokul Nair