Latest 1.0.2
Homepage https://github.com/levigroker/GRKGradientView
License Creative Commons Attribution 3.0 Unported License
Platforms ios 6.0, requires ARC
Frameworks CoreGraphics
Authors

A UIView subclass which draws a configurable gradient.

Sample Screenshot

Future Ideas

  • Radial gradient.
  • Linear gradient with an angle.
  • Animatable rotation of linear gradient.
  • Linear gradient animates based on accelerometer data (gravity "down" is always the "end"
    of the gradient).

Installing

If you’re using CocoPods it’s as simple as adding this to your Podfile:

pod 'GRKGradientView', '~> 1.0'

Documentation

Use as you would any other UIView, and simply configure appropriate to your needs.
In the simplest case, all you need supply are two colors for the start and end of the
gradient.

@property (nonatomic,weak) IBOutlet GRKGradientView *downGradient;
@property (nonatomic,weak) IBOutlet GRKGradientView *upGradient;

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.downGradient.gradientColors = [NSArray arrayWithObjects:[UIColor lightGrayColor], [UIColor darkGrayColor], nil];

    self.upGradient.gradientOrientation = GRKGradientOrientationUp;
    self.upGradient.gradientColors = [NSArray arrayWithObjects:[UIColor whiteColor], [UIColor blackColor], nil];
}

Additional documentation is available in GRKGradientView.h.

Disclaimer and Licence

About

A professional iOS engineer by day, my name is Levi Brown. Authoring a technical blog
grokin.gs, I am reachable via:

Twitter @levigroker
App.net @levigroker
Email [email protected]

Your constructive comments and feedback are always welcome.

Latest podspec

{
    "name": "GRKGradientView",
    "version": "1.0.2",
    "summary": "A UIView subclass which draws a configurable gradient.",
    "description": "ttUse as you would any UIView and configure it to render a gradient instead of a solid color.n",
    "homepage": "https://github.com/levigroker/GRKGradientView",
    "license": "Creative Commons Attribution 3.0 Unported License",
    "authors": {
        "Levi Brown": "[email protected]"
    },
    "social_media_url": "https://twitter.com/levigroker",
    "source": {
        "git": "https://github.com/levigroker/GRKGradientView.git",
        "tag": "1.0.2"
    },
    "platforms": {
        "ios": "6.0"
    },
    "source_files": "GRKGradientView/**/*.{h,m}",
    "frameworks": "CoreGraphics",
    "requires_arc": true
}

Pin It on Pinterest

Share This