Giter VIP home page Giter VIP logo

uiview-shadow-maker's Introduction

UIView-Shadow-Maker

An UIView category that allow user to easily make inset shadow, customize the radius, alpha, color and directions.
Shadows are drawn with CAGradient and added into an UIView with tag, remove viewWithTag in subviews to clear the shadow.
This project is an example, category file can be found in /Shadow Maker Example/Classes

Function
- (void) makeInsetShadow;
- (void) makeInsetShadowWithRadius:(float)radius Alpha:(float)alpha;
- (void) makeInsetShadowWithRadius:(float)radius Color:(UIColor *)color Directions:(NSArray *)directions;

Example
UIView *sampleView1 = [[UIView alloc] initWithFrame:CGRectMake(10, 10, 100, 100)];
[sampleView1 makeInsetShadowWithRadius:3.0 Alpha:0.4];
[self.view addSubview:sampleView1];

UIView *sampleView2 = [[UIView alloc] initWithFrame:CGRectMake(150, 100, 100, 200)];
[sampleView2 makeInsetShadowWithRadius:3.0 Color:[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.4] Directions:[NSArray arrayWithObjects:@"top", @"bottom", nil]];
[self.view addSubview:sampleView2];

Screenshot
ScreenShot

Contribute
I'd love to include your contributions. Feel free to improve it, send comments or suggestions. Please let me know if you have great idea on it.

Contact Me
You can add me on Facebook - http://www.facebook.com/seitkk

uiview-shadow-maker's People

Contributors

seitk avatar

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

uiview-shadow-maker's Issues

Simple way to get the shadow object

Hi!

I like what you did, that was really useful, thanks.
But I think it would be neat to have a way to get the generated UIView somehow, so it can be manipulated. I needed that (toggle on/off with the 'hidden' property), so I just changed your methods to return the view.
You may want to expose it somehow too. Maybe a getter would be less confusing:

  • (UIView *)insetsShadowView;

Although that would mean there can be only one of them.

Rounded borders

This doesn't seem to cater for rounded borders. This should be reasonably easy to implement

No License

Is there a license associated with this library? I've seen it used in several places and I want to make sure that there won't be any licensing issues.

I'd suggest going with MIT or possibly BSD style licenses.

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.