UIView-Shadow-Maker

by Seitk

An UIView category that allow user to easily make inset shadow, customize the radius, alpha, color a...

128 Stars 29 Forks Last release: Not found MIT License 5 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

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

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.