Latest 2.1
Homepage https://github.com/erbittuu/HazeView
License MIT
Platforms ios 9.0
Frameworks Foundation, AVFoundation, UIKit
Authors

[![CI Status](http://img.shields.io/travis/Utsav Patel/HazeView.svg?style=flat)](https://travis-ci.org/Utsav Patel/HazeView)
Version
License
Platform

Demo

HazeViewExample

Example

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

Requirements

Installation

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

1. CocoaPods

pod "HazeView"

2. Manual

Add HazeView.swift file into your project.

Usage

a) Import UIRainView in any class you want to use it.

import HazeView

b) Add HazeView in your project

  • Using video file
  • Using gif file
  • Using live camera
func addCustomBackview() {
    videoExample()
//     gifExample()
//     frontCameraExample()
//     backCameraExample()

// Adding haze backround in your view  
hazeBG.addHazeView(in: self.view)
}

func videoExample() {
    let path = Bundle.main.path(forResource: "SampleVideo", ofType: "mp4")
    let url = URL(fileURLWithPath: path!)

    hazeBG = HazeView(videoURL: url, andFrame: self.view.frame)
    hazeBG.blurStyle = .light
}

func gifExample() {
    let path = Bundle.main.path(forResource: "giphy", ofType: "gif")
    let url = URL(fileURLWithPath: path!)

    hazeBG = HazeView(gifURL: url, andFrame: self.view.frame)
}

func frontCameraExample() {
    hazeBG = HazeView(byFrontCamera:true, andFrame: self.view.frame)
}

func backCameraExample() {
    hazeBG = HazeView(byFrontCamera:false, andFrame: self.view.frame)
}

To start background video playing,

// Start background haze effect 
hazeBG.startHazeing()

To Stop background video playing,

// Stop background haze effect, mostly use in viewDidDisappear ...
hazeBG.stopHazeing()

Contribution

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

Author

Utsav Patel, [email protected]

License

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

Latest podspec

{
    "name": "HazeView",
    "version": "2.1",
    "summary": "HazeView is subclass class of UIView for enabling live background with haze effect in your views or viewcontrollers",
    "homepage": "https://github.com/erbittuu/HazeView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Utsav Patel": "[email protected]"
    },
    "source": {
        "git": "https://github.com/erbittuu/HazeView.git",
        "tag": "2.1"
    },
    "social_media_url": "https://twitter.com/erbittuu",
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "Source/*.swift",
    "frameworks": [
        "Foundation",
        "AVFoundation",
        "UIKit"
    ],
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "3.0"
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This