To run the example project, clone the repo, and run pod install
from the Example directory first.
- ToastView Customization
- Easy & Quick Integration
- iOS 9.0+
- Xcode 9.1+
- Swift 4.0+
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
You can directly add the SKToastView.swift
source files into your Xcode project.
Include SKToastView wherever you need it with import SKToast
.
(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.")
}
// 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)
SKToast is available under the MIT license. See LICENSE for details.