Giter VIP home page Giter VIP logo

ronotificationview's Introduction

RONotificationView

CocoaPods CocoaPods

Requirements

  • iOS 11.0+
  • Xcode 9.0

Demo

Message Banner StatusBar Banner
Progress Bar Banner Custom Banner

Installation

Just add the RONotificationView folder to your project.

or use CocoaPods with Podfile:

pod 'RONotificationView'

Usage

  1. To use RONotificationView, you would be needing to create RONotificationConfiguration object. This configuration object is used to customize you banner.
  • Customizations allowed:

    • For StatusBar Banner

      isToAnimateView (Bool) -- For enable/disable hide, show animations
      duration (TimeInterval) -- If need to hide view after some time. [Set 0 if want to hide manually]
      messageTextColor (UIColor) -- To set message text color
      backgroundColor (UIColor) -- To set banner background color
      message (String) -- To set message
      messageFont (UIFont) -- To set message Font

    • For Message Banner

      isToAnimateView (Bool) -- For enable/disable hide, show animations
      messageFont (UIFont) -- To set message Font
      titleFont (UIFont) -- To set title Font
      duration (TimeInterval) -- If need to hide view after some time. [Set 0 if want to hide manually]
      titleTextColor (UIColor) -- To set title text color
      messageTextColor (UIColor) -- To set message text color
      backgroundColor (UIColor) -- To set banner background color
      image (UIImage) -- To show image on left side of banner
      title (String) -- To set title
      message (String) -- To set message
      isToShowLoader (Bool) -- To show loader on right side of banner

    • For ProgressBar Banner

      isToAnimateView (Bool) -- For enable/disable hide, show animations
      backgroundColor (UIColor) -- To set banner background color
      isToShowProgressCount (Bool) -- To show ProgressCount in centre of progressBar
      progressBarColor (UIColor) -- To set progressbar color
      progressCountFont (UIFont) -- To set count font
      progressCountColor (UIColor) -- To set count text color
      progressBarStartPosition (Float) -- To set start value for progressBar (default = 0)
      progressBarCurrentPosition (Float) -- To set current value for progressBar (incase to start from different value other than start position)
      progressBarEndPosition (Float) -- To set end value for progressBar
      isToAnimateProgressBarGradient (Bool) -- Used to animate progressbar

    • For Custom Banner

      isToAnimateView (Bool) -- For enable/disable hide, show animations
      duration (TimeInterval) -- If need to hide view after some time. [Set 0 if want to hide manually]

  • Creating Configuration Object

    • For StatusBar Banner
      let configuration = RONotificationStatusBarBannerConfiguration(message: MESSAGE, isToAnimateView: True)
      
    • For Message Banner
      let configuration = RONotificationMessageConfiguration(title: TITLE, message: MESSAGE, isToAnimateView: true)
      
    • For ProgressBar Banner
      let configuration = RONotificationProgressBarBannerConfiguration(progressBarColor: BAR_COLOR, progressBarStartPosition: 0, progressBarEndPosition: 100, isToAnimateView: true)
      
    • For Custom Banner
      let configuration = RONotificationCustomViewConfiguration(duration: DURATION, isToAnimateView: true)
      
  • To change value after creating Configuration:

    configuration.isToAnimateView = True
    ...
    
  1. After creating configuration for StatusBar Banner, You need to create StatusBar Banner Object.
  • Creating RONotificationView object:

    • For StatusBar Banner
      banner = RONotificationStatusBarBanner(presentOn: configurationView, config: configuration)
      
    • For Message Banner
      banner = RONotificationMessageBanner(presentOn: configurationView, config: configuration)
      
    • For ProgressBar Banner
      banner = RONotificationProgressBarBanner(presentOn: configurationView, config: configuration)
      
    • For Custom Banner
      banner = RONotificationCustomBanner(presentOn: configurationView, config: configuration, customView:customView)
      
    • For Banner on Window
      banner = Notification_View_Type(config: configuration)
      
  • Update Banner Configurations:

    Want to change configuration for same banner ? ๐Ÿค”
    banner.updateConfiguration(config: configuration)
    
  1. Show your banner
  • Show Banner:

    banner.showBanner(onDismiss: Closure_For_On_Dismiss, onTap: Closure_For_On_Tap, onProgressCompleted: Closure_For_On_Progress_Completed)
    
    Closure are optional.
  1. Hide your banner.
  • Hide Banner:

    banner.hideBanner()
    
    • For Auto-Hide Banner
      banner.showBanner(onDismiss: nil, onTap: nil)
      
      OnDismiss closure will be called.

Licence

RONotificationView is released under the MIT license. See LICENSE for details.

ronotificationview's People

Contributors

rahimkhalid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.