Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6ff11e7294
Fetching contributors…

Cannot retrieve contributors at this time

file 79 lines (59 sloc) 1.803 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
//
// SSGradientView.h
// SSToolkit
//
// Created by Sam Soffes on 10/27/09.
// Copyright 2009-2011 Sam Soffes. All rights reserved.
//

#import "SSBorderedView.h"

/**
The direction the gradient.
*/
typedef enum {
/** The gradient is horizontal. */
SSGradientViewDirectionHorizontal,

/** The gradient is verticle. */
SSGradientViewDirectionVertical
} SSGradientViewDirection;

/**
Simple `UIView` wrapper for `CGGradient`.
*/
@interface SSGradientView : SSBorderedView

///---------------------------
/// @name Drawing the Gradient
///---------------------------

/**
An array of `UIColor` objects used to draw the gradient. If the value is `nil`, the `backgroundColor` will be drawn
instead of a gradient.
The default is `nil`.
*/
@property (nonatomic, copy) NSArray *colors;

/**
An optional array of `NSNumber` objects defining the location of each gradient stop.
The gradient stops are specified as values between `0` and `1`. The values must be monotonically
increasing. If `nil`, the stops are spread uniformly across the range. Defaults to `nil`.
*/
@property (nonatomic, copy) NSArray *locations;

/**
The direction of the gradient.
The default is `SSGradientViewDirectionVertical`.
*/
@property (nonatomic, assign) SSGradientViewDirection direction;


///-------------------------
/// @name Deprecated Methods
///-------------------------

/**
The top gradient color. This method is deprecated.
The default is `nil`.
*/
@property (nonatomic, strong) UIColor *topColor;

/**
The bottom gradient color. This method is deprecated.
The default is `nil`.
*/
@property (nonatomic, strong) UIColor *bottomColor;

/** The scale of the gradient. This method is deprecated.
The default is `1.0`.
*/
@property (nonatomic, assign) CGFloat gradientScale;

@end
Something went wrong with that request. Please try again.