A Simple Toast Library for iOS

Overview

PowerplayToastKit

Version License Platform

Toasts Type

Success.

Screenshot 2021-10-17 at 9 22 30 AM

Warning

Screenshot 2021-10-17 at 9 22 38 AM

Error

Screenshot 2021-10-17 at 9 22 44 AM

Info

Screenshot 2021-10-17 at 9 35 08 AM

Custom View (Dialog)

Screenshot 2021-10-17 at 9 23 10 AM

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

iOS 11+

Installation

PowerplayToastKit is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'PowerplayToastKit'

Usage

Quick Start

// success Toast at top
let heading = "Success"
let message = "This method was a success"
PowerplayToastKit
    .shared
    .showToast(of: .success(title: heading, message: message), at: .top)
    

// warning toast at bottom
let heading = "Warning"
let message = "Dont do that again or you're done !!"
PowerplayToastKit
    .shared
    .showToast(of: .warning(title: heading, message: message), at: .bottom)
    

// error toast at center with a time interval of 5 seconds
let heading = "Error"
let message = "This method could not be completed, unknown error occured !!"
PowerplayToastKit
    .shared
    .showToast(of: .error(title: heading, message: message), at: .center, for: 5)  
    

// info toast at custom position
let heading = "Info"
let message = "🕺🕺We are hiring at Powerplay🕺🕺 Check our carrer page!"
PowerplayToastKit
    .shared
    .showToast(of: .info(title: heading, message: message), at: .custom(callback: { toastView in
        toastView.snp.makeConstraints { make in
            make.leading.trailing.equalToSuperview().inset(16)
            make.top.equalToSuperview().offset(200)
        }
    }))     

But wait, there's more!


// You can show custom views in place of Toast (eg. dialog, bottomsheet, loading indicators, etc..)

// we pass .greatestFiniteMagnitude as TimeInterval which will make the Dialog appear for infinte time

// see example to see DialogView class
let dialogView = DialogView()
dialogView.translatesAutoresizingMaskIntoConstraints = false
dialogView.isUserInteractionEnabled = true
PowerplayToastKit
    .shared
    .showToast(withCustomView: dialogView, at: .bottom, for: .greatestFiniteMagnitude)
    
    
    
    
// You can Provide a ToastBuilder to change theme and modify the Toast View
    
let themeBuilder = ToastThemeBuilder()
    .set(backgroundColor: UIColor.systemRed.withAlphaComponent(0.78))
    .set(titleTextColor: .black)
    .set(messageTextColor: .black)
    .set(toastCornerRadius: 6)
        
let toastBuilder = ToastBuilder()
    .set(theme: themeBuilder)
    .set(type: ToastType.info(title: "Info", message: "Here's a Toast with a custom builder"))
    .set(position: .top)
        
PowerplayToastKit.shared.showToast(withBuilder: toastBuilder)
    

Communication

  • If you'd like to ask a general question or need help, reach out on LinkedIn.
  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Author & Maintainer

Mithlesh Parmar (linkedin)

Show some ❤️ and star the repo to support the project

Medium Article for this library

License

PowerplayToastKit is available under the MIT license. See the LICENSE file for more info.

Copyright (c) 2021 Mithilesh Parmar [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You might also like...
An iOS library for SwiftUI to create draggable sheet experiences similar to iOS applications like Maps and Stocks.

An iOS library for SwiftUI to create draggable sheet experiences similar to iOS applications like Maps and Stocks.

A simple, customizable popup dialog for iOS written in Swift. Replaces UIAlertController alert style.
A simple, customizable popup dialog for iOS written in Swift. Replaces UIAlertController alert style.

Introduction Popup Dialog is a simple, customizable popup dialog written in Swift. Features Easy to use API with hardly any boilerplate code Convenien

iOS / Objective C: an extremely simple UIAlertView alternative
iOS / Objective C: an extremely simple UIAlertView alternative

RKDropdownAlert an extremely simple (and customizeable) alert alternative based on Facebook's app Slingshot, and inspiration from SVProgressHUD (yes,

Simple DropDown Alert View For Any iOS Projects.
Simple DropDown Alert View For Any iOS Projects.

⚠️ DEPRECATED, NO LONGER MAINTAINED JDropDownAlert JDropDownALert Simple DropDown Alert View For Any iOS Projects. Usage Top let alert = JDropDown

A Simple And Minimalist iOS AlertController
A Simple And Minimalist iOS AlertController

HYAlertController HYAlertController is a minimalist alert control, that contains a variety of usage scenarios. It has the same syntax as Apple's UIAle

A simple custom popup dialog view for iOS written in Swift. Replaces UIAlertController alert style.
A simple custom popup dialog view for iOS written in Swift. Replaces UIAlertController alert style.

A simple custom popup dialog view for iOS written in Swift. Replaces UIAlertController alert style.

SwiftMessages is a very flexible view and view controller presentation library for iOS.
SwiftMessages is a very flexible view and view controller presentation library for iOS.

SwiftMessages Overview SwiftMessages is a very flexible view and view controller presentation library for iOS. Message views and view controllers can

It is a highly configurable iOS library which allows easy styling with built in styles as well as extra header and footer views so that you can make extremely unique alerts and action sheets.
It is a highly configurable iOS library which allows easy styling with built in styles as well as extra header and footer views so that you can make extremely unique alerts and action sheets.

 CFAlertViewController CFAlertViewController is a library that helps you display and customise Alerts, Action Sheets, and Notifications on iPad and i

Customizable Dynamic Bottom Sheet Library for iOS
Customizable Dynamic Bottom Sheet Library for iOS

DynamicBottomSheet Powerd by Witi Corp., Seoul, South Korea. Fully Customizable Dynamic Bottom Sheet Library for iOS. This library doesn't support sto

Releases(1.1.0)
Owner
Mithilesh Parmar
Leading iOS at @powerplay-developers
Mithilesh Parmar
A Swift Toast view - iOS 14 style and newer - built with UIKit. 🍞

Toast-Swift A Swift Toast view - iOS 14 style - built with UIKit. ?? Installation Swift Package Manager You can use The Swift Package Manager to insta

Bastiaan Jansen 216 Jan 4, 2023
A modern iOS toast view that can fit your notification needs

CRToast CRToast is a library that allows you to easily create notifications that appear on top of or by pushing out the status bar or navigation bar.

Collin Ruffenach 4.2k Dec 30, 2022
A Swift extension that adds toast notifications to the UIView object class.

Toast-Swift Toast-Swift is a Swift extension that adds toast notifications to the UIView object class. It is intended to be simple, lightweight, and e

Charles Scalesse 3.3k Dec 22, 2022
🍞 Toast for Swift

Toaster Android-like toast with very simple interface. (formerly JLToast) Screenshots Features Queueing: Centralized toast center manages the toast qu

Suyeol Jeon 1.6k Dec 30, 2022
CoffeeToast - A swift package to easily add Toast notifications to your app

CoffeeToast A simple Swift package to add Toast Notifications to your app. Insta

Maegan Wilson 2 Feb 3, 2022
Bulletin / 'Toast' style view for tvOS.

KBBulletinView Bulletin / 'Toast' style view for tvOS. This project is an effort to create local application notifications/alerts similar to those use

Kevin Bradley 4 Nov 26, 2022
LCToast - Add toast to UIView.

LCToast Add toast to UIView. Requirements iOS 8.0+ Features The LCToast is a comparison of features with Toast and SVProgressHUD. LCToast Toast SVProg

LiuChang 158 Nov 22, 2022
Customizable simple Alert and simple ActionSheet for Swift

SimpleAlert It is simple and easily customizable alert. Can be used as UIAlertController. Appetize's Demo Requirements Swift 5.0 iOS 9.0 or later How

Kyohei Ito 397 Dec 6, 2022
🌊 - Jelly is a library for animated, non-interactive & interactive viewcontroller transitions and presentations with the focus on a simple and yet flexible API.

Jelly is a library for animated, non-interactive & interactive viewcontroller transitions and presentations with the focus on a simple and yet flexibl

Sebastian Boldt 2.4k Dec 25, 2022
SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps.

SwiftEntryKit ?? Donations can be made here. Table of Contents Overview Features Example Project Example Project Installation Presets Playground Requi

Daniel Huri 6.1k Jan 4, 2023