An in-app notification banner for Swift.
Example
// Initialize a notification
let notification: GTNotification = GTNotification()
notification.title = "Welcome Notification"
notification.message = "Thank you for checking out GTNotificationView."
notification.position = GTNotificationPosition.Top
notification.animation = GTNotificationAnimation.Slide
notification.blurEnabled = true
// Perform a custom selector on tap
notification.addTarget(self, action: Selector("dismissNotification"))
// Set the notification's delegate
notification.delegate = self
// Show the notification
GTNotificationManager.sharedInstance.showNotification(notification)
GTNotificationDelegate Methods
// MARK: GTNotificationDelegate Methods
func notificationDidDismiss(notification: GTNotification)
{
// The notification was dismissed automatically
NSLog("The notification was dismissed automatically")
}
func notificationFontForTitleLabel(notification: GTNotification) -> UIFont
{
return UIFont(name: "AvenirNext-Medium", size: 16.0)!
}
func notificationFontForMessageLabel(notification: GTNotification) -> UIFont
{
return UIFont(name: "AvenirNext-Regular", size: 13.0)!
}
Screenshots
Dark Blur
Light Blur
Extra Light Blur
Solid Color