Skip to content

ZaidPathan/UIRainView

Repository files navigation

UIRainView

CI Status Version License Platform

UIRainViewLogo

Demo

alt UIRainView

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

1. CocoaPods

UIRainView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "UIRainView"

2. Manual

Add UIRainView.swift file into your project.

Usage

1. Import UIRainView in any class you want to use it.

import UIRainView

2.1. Add using XIB or UIStoryboard

  • Add UIView to your view.
  • Give class name UIRainView to that UIView in Identity Inspactor.
  • Go to attribute inspactor and give Rain String value (Default is 💧) and Rain fall interval (Default is 5).
  • Connect IBOutlet of UIRainView
  • Start rain by calling : rainView?.rain()
  • Stop rain by calling : rainView?.drizzle()

2.2. Add direcly into the code.

import UIKit
import UIRainView

class ViewController: UIViewController {

    var rainView:UIRainView?

    override func viewDidLoad() {
        super.viewDidLoad()
        rainView = UIRainView()
        rainView?.frame = view.frame
        view.addSubview(rainView!)

        rainView?.rainString = "💧🎊🎉❤️💝💜💙💚💛🍰"
        rainView?.rainFallInterval = 7
        rainView?.rain()   //Start raining
    }

}

To Stop raining try following,

rainView?.drizzle()

Contribution

Feel free to raise issue and PR accepted to imrove this library.

Author

ZaidPathan , zaid.pathan@solutionanalysts.com

License

UIRainView is available under the MIT license. See the LICENSE file for more info.

About

Very LightWeight, Easy to integrate UIView subclass - A Swift3 component to get rain effect in your app.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published