Skip to content

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

License

Notifications You must be signed in to change notification settings

basvankuijck/DynamicBlurView

 
 

Repository files navigation

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.

How to Install DynamicBlurView

iOS 8+

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.

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.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 94.0%
  • Ruby 3.2%
  • Objective-C 2.8%