Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Loafjet/Loafjet

๐Ÿš€ Loafjet is a lightweight custom framework used to add Loafs, Dash Board, Popup Card, and Loading indicator in your Swift project
https://github.com/Loafjet/Loafjet

indicators ios loaf popup-card toast toast-message toast-ui toastify toasts uidesign uikit

Last synced: 3 months ago
JSON representation

๐Ÿš€ Loafjet is a lightweight custom framework used to add Loafs, Dash Board, Popup Card, and Loading indicator in your Swift project

Awesome Lists containing this project

README

        



# Loafjet ๐Ÿš€
![Forks](https://img.shields.io/github/forks/Loafjet/Loafjet) ![Stars](https://img.shields.io/github/stars/Loafjet/Loafjet) ![Issues](https://img.shields.io/github/issues/Loafjet/Loafjet) ![PRs](https://img.shields.io/github/issues-pr-raw/Loafjet/Loafjet) ![Languages](https://img.shields.io/github/languages/count/Loafjet/Loafjet) [![Version](https://img.shields.io/cocoapods/v/Loafjet.svg?style=flat)](https://cocoapods.org/pods/Loafjet) ![Badges](https://img.shields.io/badge/License-MIT-yellow) [![Platform](https://img.shields.io/cocoapods/p/Loafjet.svg?style=flat)](https://cocoapods.org/pods/Loafjet) [![Relative date](https://img.shields.io/date/1577392258?color=important&label=started&logo=github)](https://github.com/Loafjet/Loafjet) ![commit](https://img.shields.io/github/commits-since/Loafjet/Loafjet/2.0.0/master) ![contributors](https://img.shields.io/github/contributors/Loafjet/Loafjet)![Badge](https://img.shields.io/badge/Xcode-12.0-green) ![badge](https://img.shields.io/badge/Swift-5.1-red) ![size](https://img.shields.io/github/languages/code-size/Loafjet/Loafjet) ![Watchers](https://img.shields.io/github/watchers/Loafjet/Loafjet?label=Watch)

## About ๐Ÿ“’
Loafjet is a ***light weight*** Toast(Loaf) generator framework 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.

**Our Simulation App is available on App Store, Go check it out**

[](https://apps.apple.com/in/app/loafjet/id1603181291)

## Now Customise Like Apple ๏ฃฟ !

|Airpods Detection|Silent|Normal|
|--|--|--|
|Screenshot 2021-01-27 at 2 04 10 AM |Screenshot 2021-01-27 at 2 04 10 AM|Screenshot 2021-01-27 at 2 04 10 AM|

* More [Customisation](https://github.com/Loafjet/Loafjet/blob/master/README.md#customisation-) sytles ๐ŸŽ›.

## Installation ๐ŸŒ

Loafjet is available through [CocoaPods](https://cocoapods.org/pods/Loafjet). To install
it, simply add the following line to your Podfile:

```ruby
pod 'Loafjet'
```

# How To Use ๐Ÿ“ ?
From any view controller, a Loaf can be presented by following this two steps:
### 1. Import Library ๐Ÿ—ณ
```swift
import Loafjet
```
### 2. Call Loafjet ๐Ÿ“ž
```swift
Loaf.PlainLoaf(message: "Message goes here", position: .Bottom, animationDirection: .Bottom, loafjetView: View)
```
### Result: ๐Ÿ’ฏ

| Plain Default Loaf|
| --- |
|Screenshot 2021-01-27 at 12 31 14 PM |

* 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 ๐Ÿ˜Š.

### Plain Loaf
```swift
* 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 ๐ŸŒ](https://github.com/Loafjet/Loafjet/blob/master/README.md#snapshots-)

### Gradient Loaf
```swift
* 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 ๐ŸŒ](https://github.com/Loafjet/Loafjet/blob/master/README.md#snapshots-)

### Popup Card
```swift
* 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 ๐ŸŒ](https://github.com/Loafjet/Loafjet/blob/master/README.md#loafjet--1)

### Dash Board
```swift
* With Default Parameters ๐Ÿ“—

Loaf.dashBoard(dashImage: String, dashTitle: String, dashContent: String, dashButtonTitle: String, mainView: UIView, completion: () -> ())

* 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, completion: () -> ())

```
* Available for **iOS 14** and above
* Dash Board [Demo Photo ๐ŸŒ](https://github.com/Loafjet/Loafjet/blob/master/README.md#dash-board-1)
* Calling `Dasboard Dismissal` is required when Dash Board is usedโ•.

### Dash Board Dismissal ๐Ÿ“•
```swift
Loaf.dismissDashBoard(dashBoardView: UIView)
```

### LoafWheel
```swift
* 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 ๐ŸŒ](https://github.com/Loafjet/Loafjet/blob/master/README.md#loafjet--1)
* Calling `LoafWheel Dismissal` is required when LoafWheel is used for **Dynamic Processing**โ•.

### LoafWheel Dismissal ๐Ÿ“•

```swift
Loaf.dismissWheel(loafWheelView:UIView)
```

## STUDIO ๐Ÿ’ป

* **Our Simulation App is available on App Store, Go check it out!**

[](https://apps.apple.com/in/app/loafjet/id1603181291)

* There app consists of a live Studio made for developers to customise their Loaf in live. The live preview allows to select the best customisation possible.
* The app also have various prebuilt Loafjets, do check it out to get a better idea๐Ÿ˜ƒ.
* Now you can experiment in the **Studio** and design the best suitable loafjet for your projects.

| Examples | Studio | Studio | Studio |
| --- | --- | -- | -- |
| | | | |

## Don't want to use CocoaPodsโ—๏ธ

I have a solution ๐Ÿ‘€


* Add the [Source Folder](https://github.com/Loafjet/Loafjet/tree/master/Source) 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](https://github.com/Loafjet) organisation.

## Parameters ๐ŸŽš

| Parameter | Definition |
| --- | --- |
| message | Message to show on Loaf |
| position | Position of Loaf |
| loafWidth | Loaf Width |
| loafHeight | Loaf Height |
| cornerRadius | CornerRadius of Loaf |
| fontStyle | Font Style of Message |
| fontSize | Font size of Message|
| bgColor | Background Color of Loaf |

| Parameter | Definition |
| --- | --- |
| alphaValue | Opacity value for Loaf's background|
| loafImage | Image on Loaf |
| duration | Loaf Duration |
| completion | Closure to add actions to be performed|
| animationDirection | Loaf Animation type |
| blurEffect | Blur effect type |
| wheelStyle | Wheel Style |
| loafWheelView | View on which LoafWheel is running |
| loafjetView | View on which Loaf is presented |

## Combination of Position and Animations ๐Ÿ“™

* Customise your Loaf according to the below given chart ๐ŸŽ›.

Position | Animation |
-- | -- |
Top | Top
Centre | Left & Right
Bottom | Bottom

- The above mentioned are the possible combination of position & animation which are possible.
- The remaining combinations are something which are not correct with UX prospect, so we have ignored them๐Ÿ˜ƒ

# Snapshots ๐Ÿ“ธ

| Plain(Top)| Plain(Bottom) | Plain(Centre) | Plain(Centre)|
:-------------------------:|:-------------------------: | :-------------------------: | :-------------------------:
Screenshot 2021-01-27 at 1 57 03 AM| Screenshot 2021-01-27 at 1 58 44 AM | Screenshot 2021-01-27 at 1 57 43 AM | Screenshot 2021-01-27 at 1 58 23 AM
| Gradient(Top) | Gradient(Bottom) | Gradient(Centre) | Gradient(Centre) |
Screenshot 2021-01-27 at 2 01 02 AM |Screenshot 2021-01-27 at 2 00 11 AM | Screenshot 2021-01-27 at 2 00 25 AM | Screenshot 2021-01-27 at 2 00 46 AM

* Above shown are few possible ways, you can customise according to your need (Customisation shown below).

# Customisation ๐Ÿ› 

* 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 ?".

### Snapshots ๐Ÿ“ท

| Do Not Disturb | Information | Warning |
:-------------------------:|:-------------------------: | :-------------------------:
Screenshot 2021-01-27 at 2 04 10 AM | Screenshot 2021-01-27 at 2 19 10 AM | Screenshot 2021-01-27 at 2 04 32 AM
| Success | Error | Device Detection |
Screenshot 2021-01-27 at 2 04 43 AM | Screenshot 2021-01-27 at 2 05 00 AM | Screenshot 2021-01-27 at 2 05 14 AM

# Loafjet +
### Additional features

* `Dash Board`,`Gradient Loafwheel` & `Popup card` are the additional customisation which you get in Loafjet๐Ÿฅณ.

|Popup Card|Loaf Wheel|
|-- | -- |
|||

## Dash Board
* These are some possible ways of customisation ๐Ÿ’ก

| Loafjet Proprietary | Alert Style | Successful Style |
|-- |-- |-- |
|Screenshot 2021-01-27 at 2 04 10 AM |Screenshot 2021-01-27 at 2 04 10 AM | Screenshot 2021-01-27 at 2 04 10 AM|

### Dark \ Light Mode Support ๐Ÿ”ฆ

| Dark Mode | Light Mode |
|-- |-- |
| Screenshot 2021-01-27 at 2 04 10 AM|Screenshot 2021-01-27 at 2 04 10 AM |

* Dash Board is available for iOS 14 and above.
* The above shown are some possible ways, How you can customise?, do try making your own and post it in the [issue](https://github.com/Loafjet/Loafjet/issues) section and get featuredโšก๏ธ.
* What are you waiting for, write `pod Loafjet` and `pod install` it .
* Done?, Now enjoy using Loafjet๐Ÿš€.

# Portrait + Landscape Support ๐Ÿ”„
* Loafjet is made with Landscape + Portrait support* ๐Ÿ”“.
* 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 ๐Ÿ’ป

# Video Demo ๐ŸŽฅ

| Top(Top) | Bottom(Bottom) |
|-- | -- |
|||

| Centre(Right) | Centre(Left) |
|-- | -- |
|||

* These are some possible ```Position X Animation``` combination, Loafjet supports various other [combinations](https://github.com/Loafjet/Loafjet/blob/master/README.md#combination-of-position-and-animations-) too.

## Instructions โš ๏ธ

* 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).
```swift
// iOS versions will varry
if #available(iOS 10.0, *) {.
// write the code to run
}
else {
print("Error Message")
}
```
### Or

```swift
// 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!**).

# Note ๐Ÿ”ด

* 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 โฌ†๏ธ).
* **You can use two or more different Loafjet type at a time, but you can't use two or more Loafjet of same type at a time**.

## License โš–๏ธ

Loafjet is available under the MIT license. See the [LICENSE](https://github.com/gokulnair2001/Loafjet) file for more info.

## How to Contribute ๐Ÿ–‹
* 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.

## Requirements โ•

* Device running on iOS/iPadOS 12.0+ versions ๐Ÿ“ฑ.
* Swift 5.1+ ๐Ÿ’ป

# Additional Info

## Mentors ๐Ÿ“ฑ

| GitHub Usernames | Domain |
| ----------------------------------------------------- | -------------------------- |
| [@gokulNair](https://github.com/gokulnair2001) | Full Stack + Documentation |
| [@anmolBansal](https://github.com/anmolbansal7) | Documentation |

## Project Admin ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป

[![Relative date](https://img.shields.io/date/1577392258?color=important&label=started&logo=github)](https://github.com/Loafjet/Loafjet) [![Maintenance](https://img.shields.io/maintenance/yes/2021?color=green&logo=github)](https://github.com/gokulnair2001/)

| |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| **[Gokul Nair](https://www.linkedin.com/in/gokul-r-nair/)** |
| |

## Apps Using Loafjet๐Ÿ“ฑ
| Dock! | Remember Us | LinkBoard |
| ----- | ----- | ----- |
| | | |

* If your App uses **LOAFJET**, then let us know to get your app featured on our [Website](https://loafjet.github.io/Loafjet/).

# Community ๐Ÿ•

* Want to be a part of our Organisation ๐Ÿš€, then:
* Mail us at **
[email protected]** โœ‰๏ธ
* Do mention the following things:

1. Reason

2. Motive

3. Skills

4. What you liked abou Loafjetโค๏ธ

* We are eager to read you messageโšก๏ธ!

# Like the Project ?
If you like using any of my projects or like what I'm doing, please do consider backing me with appreciating my work: [Message me](https://twitter.com/GokulNair2303)๐Ÿฅฐ

[BMC logo+wordmark - Black](https://www.buymeacoffee.com/gokulnair)

OR

**Drop a star โญ if you find this project interesting!**

# Reward ๐ŸŽ

**If you โค๏ธ the project then there is a gift for you:**
* [Gift from Loafjet Organisation](https://loafjet.github.io/LoafjetLogo.github.io/)
* 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


ยฉ Gokul Nair