Giter Club home page Giter Club logo

dynamicblurview's Introduction

DynamicBlurView

Carthage compatible Version License Platform

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

Gif

Gif

  • Since using the CADisplayLink, it is a high performance.
  • Can generate a plurality of BlurView.

Requirements

  • Swift 4.0
  • iOS 8.0 or later
  • tvOS 9.0 or later

How to Install DynamicBlurView

CocoaPods

Add the following to your Podfile:

pod "DynamicBlurView"

Carthage

Add the following to your Cartfile:

github "KyoheiG3/DynamicBlurView"

Usage

Example

Blur the whole

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

Animation

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

Ratio

blurView.blurRatio = 0.5

Variable

var drawsAsynchronously: Bool
  • When true, it captures displays image and blur it asynchronously. Try to set true if needs more performance.
  • Asynchronous drawing is possibly crash when needs to process on main thread that drawing with animation for example.
  • Default is false.
var blurRadius: CGFloat
  • Strength of the blur.
var trackingMode: TrackingMode
  • 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 isDeepRendering: Bool
  • If the view want to render beyond the layer, should be true.
  • Default is false.
var blurRatio: CGFloat
  • When none of tracking mode, it can change the radius of blur with the ratio. Should set from 0 to 1.
  • Defauot is 1.
var quality: CaptureQuality
  • Quality of captured image.
  • Default is medium.

Function

func refresh()
  • Remove cache of blur image then get it again.
func remove()
  • Remove cache of blur image.
func animate()
  • Should use when needs to change layout with animation when is set none of tracking mode.

Acknowledgements

Author

Kyohei Ito

Follow me ๐ŸŽ‰

LICENSE

Under the MIT license. See LICENSE file for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.