All Projects → devxoul → Toaster

devxoul / Toaster

Licence: wtfpl
🍞 Toast for Swift

Programming Languages

swift
15916 projects
objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Labels

Projects that are alternatives of or similar to Toaster

React Native Redux Toast
Simple to use, easy to customize Toast component for Android & iOS. Developed with love for redux apps
Stars: ✭ 51 (-96.62%)
Mutual labels:  toast
Jquery Toast Plugin
Highly customizable jquery plugin to show toast messages
Stars: ✭ 1,237 (-18.13%)
Mutual labels:  toast
Jjhud
JJHUD is an displays a translucent HUD with an indicator and/or labels .
Stars: ✭ 94 (-93.78%)
Mutual labels:  toast
Topmessage
A beautiful way of message prompting instead of Toast!
Stars: ✭ 62 (-95.9%)
Mutual labels:  toast
Android Target Tooltip
Create Toast like tooltips, but targets can be specified, plus custom properties and features
Stars: ✭ 1,221 (-19.19%)
Mutual labels:  toast
Pixpic
PixPic, a Photo Editing App
Stars: ✭ 1,261 (-16.55%)
Mutual labels:  toast
Jhud
A full screen of the HUD when loading the data (Objective-C).
Stars: ✭ 1,003 (-33.62%)
Mutual labels:  toast
Android Appmsg
In-layout notifications. Based on Toast notifications and article by Cyril Mottier (http://android.cyrilmottier.com/?p=773).
Stars: ✭ 1,384 (-8.41%)
Mutual labels:  toast
Sstoastmessage
SSToastMessage is written purely in SwiftUI. It will add toast, alert, and floating message view over the top of any view. It is intended to be simple, lightweight, and easy to use. It will be a popup with a single line of code.
Stars: ✭ 82 (-94.57%)
Mutual labels:  toast
Vue Toastr
Vuejs Toast : Plugin and Component Capability.
Stars: ✭ 93 (-93.85%)
Mutual labels:  toast
Flui
A powerful UI framework for Google Flutter.
Stars: ✭ 1,153 (-23.69%)
Mutual labels:  toast
Ktoast
Customizable toast messages.
Stars: ✭ 70 (-95.37%)
Mutual labels:  toast
Floatingtoast
Android library to create customizable floating animated toasts like in Clash Royale app
Stars: ✭ 86 (-94.31%)
Mutual labels:  toast
Fancytoast Android
Make your native android Toasts Fancy. A library that takes the standard Android toast to the next level with a variety of styling options. Style your toast from code.
Stars: ✭ 1,067 (-29.38%)
Mutual labels:  toast
Avocadotoast
Small example app for SwiftWebUI
Stars: ✭ 94 (-93.78%)
Mutual labels:  toast
Easyandroid
一系列简单、轻量、方便的Android开发工具集合(持续更新中),包括Android动态权限、SharedPreferences、反射、日志、Toast、Bundle、MVP、线程池、Html、图文混排、蒙层引导、拍照、图库选择等
Stars: ✭ 1,039 (-31.24%)
Mutual labels:  toast
Fluttertoast
Flutter Toast
Stars: ✭ 84 (-94.44%)
Mutual labels:  toast
Desktoptoast
A library for toast notifications from desktop app
Stars: ✭ 105 (-93.05%)
Mutual labels:  toast
Windowshowdemo
Android 弹窗案例总结(仿淘宝弹窗 咸鱼菜单 筛选列表)
Stars: ✭ 95 (-93.71%)
Mutual labels:  toast
Bulma Toast
Bulma's pure JavaScript extension to display toasts
Stars: ✭ 93 (-93.85%)
Mutual labels:  toast

Toaster

Build Status Swift CocoaPods Carthage compatible

Android-like toast with very simple interface. (formerly JLToast)

Screenshots

Toaster Screenshot

Features

  • Queueing: Centralized toast center manages the toast queue.
  • Customizable: See the Appearance section.
  • String or AttributedString: Both supported.
  • UIAccessibility: VoiceOver support.

At a Glance

import Toaster

Toast(text: "Hello, world!").show()

Installation

  • For iOS 9+ projects with CocoaPods:

    pod 'Toaster'
  • For iOS 9+ projects with Carthage:

    github "devxoul/Toaster"
    
  • For iOS 9+ and Xcode 11+ projects with Swift Package Manager:

    dependencies: [
        .package(url: "https://github.com/devxoul/Toaster.git", from: "master")
    ]
    

Getting Started

Setting Duration and Delay

Toast(text: "Hello, world!", duration: Delay.long)
Toast(text: "Hello, world!", delay: Delay.short, duration: Delay.long)

Removing Toasts

  • Removing toast with reference:

    let toast = Toast(text: "Hello")
    toast.show()
    toast.cancel() // remove toast immediately
  • Removing current toast:

    if let currentToast = ToastCenter.default.currentToast {
        currentToast.cancel()
    }
  • Removing all toasts:

    ToastCenter.default.cancelAll()

Appearance

Since Toaster 2.0.0, you can use UIAppearance to set default appearance. This is an short example to set default background color to red.

ToastView.appearance().backgroundColor = .red

Supported appearance properties are:

Property Type Description
backgroundColor UIColor Background color
cornerRadius CGFloat Corner radius
textInsets UIEdgeInsets Text inset
textColor UIColor Text color
font UIFont Font
bottomOffsetPortrait CGFloat Vertical offfset from bottom in portrait mode
bottomOffsetLandscape CGFloat Vertical offfset from bottom in landscape mode
shadowPath CGPath The shape of the layer’s shadow
shadowColor UIColor The color of the layer’s shadow
shadowOpacity Float The opacity of the layer’s shadow
shadowOffset CGSize The offset (in points) of the layer’s shadow
shadowRadius CGFloat The blur radius (in points) used to render the layer’s shadow
maxWidthRatio CGFloat The width ratio of toast view in window
useSafeAreaForBottomOffset Bool A Boolean value that determines safeAreaInsets.bottom is added to bottomOffset

Attributed string

Since Toaster 2.3.0, you can also set an attributed string:

Toast(attributedText: NSAttributedString(string: "AttributedString Toast", attributes: [NSAttributedString.Key.backgroundColor: UIColor.yellow]))

Accessibility

By default, VoiceOver with UIAccessibility is enabled since Toaster 2.3.0. To disable it:

ToastCenter.default.isSupportAccessibility = false

License

Toaster is under WTFPL. You can do what the fuck you want with Toast. See LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].