not an issue, but a swift example
Here's an example using swift. Maybe add it in the readme somewhere, because digging though stackoverflow is not nice.
import CRToast
//somewhere....
var options:[NSObject:AnyObject] = [
kCRToastTextKey : "Hello World! This is a sample message up after loading the view",
kCRToastBackgroundColorKey : UIColor.blackColor(),
kCRToastTextColorKey: UIColor.yellowColor(),
kCRToastTextMaxNumberOfLinesKey: 2,
kCRToastTimeIntervalKey: 3,
kCRToastUnderStatusBarKey : NSNumber(bool: false),
kCRToastTextAlignmentKey : NSTextAlignment.Left.rawValue,
//options[kCRToastImageKey] = UIImage(named: "ic_whatever") as AnyObject?
kCRToastNotificationTypeKey : CRToastType.NavigationBar.rawValue,
kCRToastAnimationInTypeKey : CRToastAnimationType.Gravity.rawValue,
kCRToastAnimationOutTypeKey : CRToastAnimationType.Gravity.rawValue,
kCRToastAnimationInDirectionKey : CRToastAnimationDirection.Top.rawValue,
kCRToastAnimationOutDirectionKey : CRToastAnimationDirection.Top.rawValue
]
CRToastManager.showNotificationWithOptions(options, completionBlock: { () -> Void in
print("done!")
})
thanks but its giving errors in swift 3
let options: [String: Any] = [kCRToastTextKey: "Member joined: (member.identity)", kCRToastTextAlignmentKey: NSTextAlignment.center, kCRToastBackgroundColorKey: UIColor.red, kCRToastAnimationInTypeKey: CRToastAnimationType.gravity, kCRToastAnimationOutTypeKey: CRToastAnimationType.gravity, kCRToastAnimationInDirectionKey: CRToastAnimationDirection.left, kCRToastAnimationOutDirectionKey: CRToastAnimationDirection.right]
CRToastManager.showNotification(options: options) {
print("completed")
}
This one is working example.
good