souzainf3 / RNNotificationView

Emulates the native Notification Banner UI for any alert
MIT License
68 stars 22 forks source link

RNNotificationView

Emulates the native Notification Banner UI for any alert.

Easy to use and customizable messages/notifications for iOS applications. ToatView with gestures.

For iPhone X make sure View controller-based status bar appearance is set to NO in your info.plist to change status bar style.

Support

Requirements

Adding RNNotificationView to your project

Cocoapods

  1. Add a pod entry for RNNotificationView to your Podfile pod 'RNNotificationView'
  2. Install the pod(s) by running pod install.

Using RNNotificationView


// Using Singleton
RNNotificationView.show(withImage: UIImage(named: "sambleIcon"),
title: "Title",
message: "Message",
duration: 2,
iconSize: CGSize(width: 22, height: 22), // Optional setup
onTap: {
print("Did tap notification")
}
)

// Creating instance
let notification = RNNotificationView()
// Customizations
notification.titleFont = UIFont(name: "AvenirNext-Bold", size: 10)!
notification.titleTextColor = UIColor.blueColor()
notification.iconSize = CGSize(width: 46, height: 46) // Optional setup
notification.show(withImage: nil,
title: "Title",
message: "Message",
onTap: {
print("Did tap notification")
})

Customizing

You can create a RNNotificationView instance and configure this properties: