TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jan 2016 |
SPMSupports SPM | ✗ |
Maintained by Bruno Hecktheuer.
BHToast is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "BHToast"
BHToast(view: view, message: "This is an example message.").show()
or
let toast = BHToast(view: view)
toast.message = "This is an example message."
toast.show()
BHToast(view: view, message: "This is an example message.", imageView: `yourImageView`).show()
or
let toast = BHToast(view: view, message: "This is an example message.")
toast.imageView = `yourImageView`
toast.show()
import BHToast
let options = BHToastOptions(
duration: 10.0,
borderWidth: 0.0,
cornerRadius: 0.0
)
BHToast(view: view, message: "This is an example message.", options: options).show()
BHToastViewTag
is used to guarantee only one instance in view. If necessary, change it before first BHToast instance.
You can create a BHToastOptions
instance with this properties:
BHToast
stays in UIView
. Default: 5.0 duration: NSTimeInterval
animationDuration: NSTimeInterval
backgroundColor: UIColor
borderColor: UIColor
borderWidth: CGFloat
cornerRadius: CGFloat
bottomOffset: CGFloat
contentInsets: UIEdgeInsets
minHeight: CGFloat
maxHeight: CGFloat
messageAlignment: NSTextAlignment
messageColor: UIColor
messageFont: UIFont
imagePosition: BHToastImagePosition
All this properties have a default value. Change it to apply the customizations to all new BHToast
instances.
Bruno Hecktheuer, [email protected]
BHToast is available under the MIT license. See the LICENSE file for more info.