Skip to content

hahnah/HNToaster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HNToaster

CI Status Version License Platform

Example

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

Screenshot

screenshot

Installation

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

pod 'HNToaster'

Usage

First of all, import HNToaster in your swift file.

import HNToaster

Simple Usage

Toast appears in the center of the view.

let message1: String = "Can you see me?"
Toaster.toast(onView: self.view, message: message1)

Options Available

You can set position and area of the toast by frame parameter.
And also the font's style and size are settable by font parameter.

let message2: String = """
You can arrange
the toast's frame
and the message's font.
"""

let toastFrame: CGRect = CGRect(x: 10, y: self.view.bounds.height - 150, width: self.view.bounds.width - 20, height: 120)

let messageFont: UIFont = UIFont.italicSystemFont(ofSize: 32)

Toaster.toast(onView: self.view, message: message2, frame: toastFrame, font: messageFont)

Author

hahnah, https://superhahnah.com/

License

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

About

Toast notification for iOS

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors