Code Monkey home page Code Monkey logo

ios-blur's Introduction

iOS-blur

In iOS 7 a new view is shown in several places that is transparent and has a nice blur effect. However Apple hasn't given us a public API to use this amazing view.

Apple gave us some sample code at WWDC that blurs an UIImage object. It looks great, but isn't as cool as a view that blurs the views behind it in realtime.

I needed this in one of my projects, so after some thinking I came up with a brilliant and simple idea. It only works for iOS 7.

Screenshot

Screenshot

How is it done?

I simply took a UIToolbar, placed it as a subview and voila!

Awesome! So, how do I use it?

You just use it as any normal UIView object. I wanted it to be as simple as possible, and I think I've managed to do just that.

To use it you copy JCRBlurView.h and JCRBlurView.m to your project. Make sure to import it, initialise it, set a frame and add it to your view. That's it! :)

JCRBlurView *blurView = [JCRBlurView new];
[blurView setFrame:CGRectMake(0.0f,0.0f,100.0f,100.0f)];
[self.view addSubview:blurView];

If you prefer using Auto Layout that works great too!

What about using it as a cocoapod? It would be SO much easier!

Just add: pod 'iOS-blur' to your Podfile and run pod install

License

iOS-blur is released under the WTFPL-license (see the LICENSE file)

ios-blur's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ios-blur's Issues

iOS 7 only?

It seems like this can only work on iOS 7. If so, please add a reference to this in the readme. If not, I think the readme should also say: Magic! You can you use this on iOS 3.... ;)

Tint not behaving as expected

I implemented some sliders so we could try out the tinting.

I think it doesn't work as expected. As you see (when you try it) once a tint is set it removes all the other colors :/

Maybe a layer under the blur layer with a color would do a better tint effect.

setting alpha

Hi,
I'm trying to just make the AMBlurView a little bit more transparent than it is using

    CGFloat r,g,b,a;
    [self.blurView.blurTintColor getRed:&r green:&g blue:&b alpha:&a];
    self.blurView.blurTintColor = [UIColor colorWithRed:r green:g blue:b alpha:.01];

but it does not work. Is there a way to achieve this ?

cheers

Broken in iOS 7.0.3?

I was using this with no issues but just updated my device to 7.0.3 and find that the effect is completely broken. Anyone else experiencing this?

demo doesn't blur contents on iphone 4 [ios7 beta5]

blurring works fine on simulator, but when I run on my iphone 4, I see the following:(minor mod to demo to inset the blurred area)

img_0001

Note that the fish in the view aren't blurred (compare with simulator screen shot below):

ios simulator screen shot aug 8 2013 12 24 46 pm

App rejected because AMBlurView

Hey,

My app was just rejected because I used AMBlurView in it:

2.5

We also found that your app interacts with the organization and layout of a provided view's internal hierarchy, which is a private entity. Interacting with private entities is not in compliance with the App Store Review Guidelines.

Specifically, your app uses classes like AMBlurView or MDBlurView, which take layers from UIToolbar and UINavigationBar view hierarchies.

Selecting specific layers or subviews in our provided views makes assumptions about the organization and layout of the view hierarchy. However, this hierarchy could change without notice, affecting the behavior of your app.

Resize issues

The blur layer doesn't resize properly when rotating device.

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.