To run the example project, clone the repo, and run pod install
from the Example directory first.
UIRainView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "UIRainView"
Add UIRainView.swift
file into your project.
import UIRainView
- 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()
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()
Feel free to raise issue and PR accepted to imrove this library.
ZaidPathan , zaid.pathan@solutionanalysts.com
UIRainView is available under the MIT license. See the LICENSE file for more info.