Skip to content
forked from SachK13/SKToast

SKToast is a simple and light weight Android like toast view for your iOS app written in swift.

License

Notifications You must be signed in to change notification settings

codetoart/SKToast

 
 

Repository files navigation

SKToast

Version License Platform

SKToast

Example

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

Features

  • ToastView Customization
  • Easy & Quick Integration

Requirements

  • iOS 9.0+
  • Xcode 9.1+
  • Swift 4.0+

Installation

CocoaPods

To integrate SKToast into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
pod 'SKToast', '~> 0.1.0'
end

Then, run the following command:

$ pod install

Manual

You can directly add the SKToastView.swift source files into your Xcode project.

Include SKToastView wherever you need it with import SKToast.

Usage

(see sample Xcode project in /Example) To run the example project, clone the repo, and run pod install from the Example directory first.

Import the module.

import SKToast

Now, you can show ToastView with status message:

SKToast.show(withMessage: "Please check your intenet connection.")

Display ToastView with status message and completionHandler:

SKToast.show(withMessage: "Your internet connection appears to be offline, please check your internet connection") {
         print("Perform any task after toast disappearance.")
}

Customization

// default is dark
SKToast.backgroundStyle(.light)


// default is white
SKToast.messageTextColor(UIColor.black)


// default is System Font
let myFont = UIFont(name: "AvenirNext-DemiBold", size: 16)
SKToast.messageFont(myFont!)


// ToastView background styles
SKToast.backgroundStyle(.light)
SKToast.backgroundStyle(.extraLight)
SKToast.backgroundStyle(.dark)

License

SKToast is available under the MIT license. See LICENSE for details.

About

SKToast is a simple and light weight Android like toast view for your iOS app written in swift.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 91.4%
  • Ruby 4.9%
  • Objective-C 3.7%