Skip to content

Dynamic blur background view with tint color (UIVisualEffectView subclass) 📱

License

Notifications You must be signed in to change notification settings

mat-613/VisualEffectView

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VisualEffectView

UIVisualEffectView subclass with tint color. Applies a blurring effect to the content layered behind using UIBlurEffect.

Language Version codebeat badge Carthage compatible

Demo

$ pod try VisualEffectView

Requirements

  • iOS 9.0+
  • Swift 3.1 (VisualEffectView 2.x), Swift 2.3 (VisualEffectView 1.x)

Installation

CocoaPods

To install with CocoaPods, simply add this in your Podfile:

use_frameworks!
pod "VisualEffectView"

Carthage

To install with Carthage, simply add this in your Cartfile:

github "efremidze/VisualEffectView"

Manually

  1. Download and drop VisualEffectView.swift in your project.
  2. Congratulations!

Usage

Use the VisualEffectView like any UIView.

import VisualEffectView

let visualEffectView = VisualEffectView(frame: CGRect(x: 0, y: 0, width: 320, height: 480))

// Configure the view with tint color, blur radius, etc. For example:
//
// visualEffectView.colorTint = .redColor()
// visualEffectView.colorTintAlpha = 0.2
// visualEffectView.blurRadius = 10
// visualEffectView.scale = 1

addSubview(visualEffectView)

For more examples, take a look at the example project.

Customization

var colorTint: UIColor // tint color. default is nil
var colorTintAlpha: CGFloat // tint color alpha. default is 0
var blurRadius: CGFloat // blur radius. default is 0
var scale: CGFloat // scale factor. default is 1

Storyboard Support

Works great with storyboards and xibs.

Disclaimer

VisualEffectView utilizes a private UIKit API to do its magic. Use caution, submitting this code to the App Store adds the risk of being rejected!

Communication

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Credits

https://github.com/collinhundley/APCustomBlurView

License

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

About

Dynamic blur background view with tint color (UIVisualEffectView subclass) 📱

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 80.1%
  • Ruby 12.0%
  • Objective-C 7.9%