-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathTKRoundedView.h
More file actions
69 lines (54 loc) · 2.38 KB
/
TKRoundedView.h
File metadata and controls
69 lines (54 loc) · 2.38 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
//
// TKRoundedView.h
// TKRoundedView
//
// Created by Tomasz Kuźma on 1/6/13.
// Copyright (c) 2013 Tomasz Kuźma. All rights reserved.
//
typedef NS_OPTIONS(NSUInteger, TKRoundedCorner) {
TKRoundedCornerNone = 0,
TKRoundedCornerTopRight = 1 << 0,
TKRoundedCornerBottomRight = 1 << 1,
TKRoundedCornerBottomLeft = 1 << 2,
TKRoundedCornerTopLeft = 1 << 3,
};
typedef NS_OPTIONS(NSUInteger, TKDrawnBorderSides) {
TKDrawnBorderSidesNone = 0,
TKDrawnBorderSidesRight = 1 << 0,
TKDrawnBorderSidesLeft = 1 << 1,
TKDrawnBorderSidesTop = 1 << 2,
TKDrawnBorderSidesBottom = 1 << 3,
};
typedef NS_ENUM(NSInteger, TKGradientDirection) {
TKGradientDirectionHorizontal,
TKGradientDirectionVertical,
TKGradientDirectionUp,
TKGradientDirectionDown,
};
extern const TKRoundedCorner TKRoundedCornerAll;
extern const TKDrawnBorderSides TKDrawnBorderSidesAll;
UIImage * TKRoundedCornerImage(CGSize size,
TKRoundedCorner corners,
TKDrawnBorderSides drawnBorders,
UIColor *fillColor,
UIColor *borderColor,
CGFloat borderWidth,
CGFloat cornerRadius);
@interface TKRoundedView : UIView
/* Which borders should be drawn - default TKDrawnBordersSidesAll - only not rounded borders can *NOT* be drawn atm */
@property (nonatomic, assign) TKDrawnBorderSides drawnBordersSides;
/* Which corners should be rounded - default TKRoundedCornerAll */
@property (nonatomic, assign) TKRoundedCorner roundedCorners;
/* Fill color of the figure - default white */
@property (nonatomic, strong) UIColor *fillColor;
/* Stroke color for the figure, default is light gray */
@property (nonatomic, strong) UIColor *borderColor;
/* Border line width, default 1.0f */
@property (nonatomic, assign) CGFloat borderWidth;
/* Corners radius , default 15.0f */
@property (nonatomic, assign) CGFloat cornerRadius;
/* Direction of the gradient [options -, |, /, \] (if there will be a gradient drawn), default vertical */
@property (nonatomic, assign) TKGradientDirection gradientDirection;
/* NSArray of NSDictionaries with NSNumber with color's locations and the UIColor object, default nil */
@property (nonatomic, strong) NSArray *gradientColorsAndLocations;
@end