v-silin / DynamicBlurView

DynamicBlurView is a dynamic and high performance UIView subclass for Blur.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DynamicBlurView

Carthage compatible Version License Platform

DynamicBlurView is a dynamic and high performance UIView subclass for Blur.

  • Demo gif
    Gif

  • Image capture
    Gif

  • Since using the CADisplayLink, it is a high performance.

  • UIToolbar does not use.

  • Can generate a plurality of BlurView.

Requirements

  • Swift 3.0
  • iOS 7.0 or later
  • tvOS 9.0 or later

How to Install DynamicBlurView

iOS 8+, tvOS

CocoaPods

Add the following to your Podfile:

pod "DynamicBlurView"
use_frameworks!

Note: the use_frameworks! is required for pods made in Swift.

Carthage

Add the following to your Cartfile:

github "KyoheiG3/DynamicBlurView"

iOS 7

Just add everything in the DynamicBlurView.swift file to your project.

Usage

import

If target is ios8.0 or later, please import the DynamicBlurView.

import DynamicBlurView

Example

Blur the whole

let blurView = DynamicBlurView(frame: view.bounds)
blurView.blurRadius = 10
view.addSubview(blurView)

Animation

UIView.animateWithDuration(0.5) {
    blurView.blurRadius = 30
}

Variable

var blurRadius: CGFloat
  • Strength of the blur.
var dynamicMode: DynamicBlurView.DynamicMode
  • Mode for update frequency.
  • Common is constantly updated.
  • Tracking is only during scrolling update.
  • None is not update.
var blendColor: UIColor?
  • Blend in the blurred image.
var iterations: Int
  • Number of times for blur.
  • Default is 3.
var fullScreenCapture: Bool
  • Please be on true if the if Layer is not captured. Such as UINavigationBar and UIToolbar. Can be used only with DynamicMode.None.
  • Default is false.
var blurRatio: CGFloat
  • Ratio of radius.
  • Defauot is 1.
var quality: CaptureImageQuality
  • Quality of captured image.

Function

func refresh()
  • Get blur image again. for DynamicMode.None
func remove()
  • Delete blur image. for DynamicMode.None

Acknowledgements

LICENSE

Under the MIT license. See LICENSE file for details.

About

DynamicBlurView is a dynamic and high performance UIView subclass for Blur.

License:MIT License


Languages

Language:Swift 94.1%Language:Ruby 3.3%Language:Objective-C 2.7%