JLGradientViews 0.2.0

JLGradientViews 0.2.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2016

Maintained by Joey Lee.



  • By
  • Joey Lee

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

JLGradientViews is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "JLGradientViews"

Usage

1. open Storyboard or xib in Interface Builder.
2. add a view.

3. change the name of the class.

4. set gradient colors and points.
  • point value should be in the range of 0.0 ~ 1.0.
  • e.g. (0,0) means left-top corner. (1,1) means right-bottom corner.

5. if you are so lazy to set a start point and a end point to the every views, JLVerticalGradientView and JLHorizontalGradientView are also available for you. :D

6. If you are a code lover, it's important to call updateColor or updatePoint to reflect data on the view.
JLHorizontalGradientView *gradientView = [[JLHorizontalGradientView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
gradientView.leftColor = [UIColor whiteColor];
gradientView.rightColor = [UIColor blackColor];
[gradientView updateColor];
[self.view addSubview:gradientView];
7. Enjoy and be happy!

Author

Joey Lee

License

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