Giter Club home page Giter Club logo

uiview-blur's Introduction

UIView+Blur

There's a ton of ways to get this done, namely nicklockwood's FXBlurView and radi's LiveFrost but those solutions requires you to use a subclass of UIView in order to make it work. For older iOS version support you should go with those solutions, but for iOS7 only, this is a lighter solution.

This category uses the UIToolbar layer hack as described so many times all over the web.

ScreenShot

How To Get Started

add UIView+Blur.h/.m to your project, then import .h file

#import "UIView+Blur.h"

Create your UIView and activate the blur

UIView* view = [[UIView alloc] initWithFrame:CGRectMake(100, 160, 100, 100)];    
[view enableBlur:YES];
[view setBlurTintColor:[UIColor redColor]];

Here's what can be customized, (check the .h file for more explanations):

/* The UIToolbar that has been put on the current view, use it to do your bidding */
@property (strong,nonatomic,readonly) UIView* blurBackground;

/* tint color of the blurred view */
@property (strong,nonatomic) UIColor* blurTintColor;

/* intensity of blurTintColor applied on the blur 0.0-1.0, default 0.6f */
@property (assign,nonatomic) CGFloat blurTintColorIntensity;

/* returns if blurring is enabled */
@property (readonly,nonatomic) BOOL isBlurred;

/* Style of Toolbar, remapped to UIViewBlurStyle typedef above */
@property (assign,nonatomic) UIViewBlurStyle blurStyle;

Requirements

No requirements, I've tested this project with iOS 7.1

More

Any suggestions are welcome ! as I am looking to learn good practices, to understand better behaviors and Objective-C in general ! Thank you.

uiview-blur's People

Contributors

mikemtol avatar mmusallam avatar

Watchers

James Cloos avatar

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.