|
1 | 1 | // |
2 | | -// TOPasscodeImage.h |
3 | | -// TOPasscodeViewControllerExample |
| 2 | +// TOPasscodeCircleImage.h |
4 | 3 | // |
5 | | -// Created by Tim Oliver on 5/17/17. |
6 | | -// Copyright © 2017 Timothy Oliver. All rights reserved. |
| 4 | +// Copyright 2017 Timothy Oliver. All rights reserved. |
7 | 5 | // |
| 6 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | +// of this software and associated documentation files (the "Software"), to |
| 8 | +// deal in the Software without restriction, including without limitation the |
| 9 | +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | +// sell copies of the Software, and to permit persons to whom the Software is |
| 11 | +// furnished to do so, subject to the following conditions: |
| 12 | +// |
| 13 | +// The above copyright notice and this permission notice shall be included in |
| 14 | +// all copies or substantial portions of the Software. |
| 15 | +// |
| 16 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 17 | +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
| 20 | +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR |
| 21 | +// IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
8 | 22 |
|
9 | 23 | #import <UIKit/UIKit.h> |
10 | 24 |
|
11 | 25 | NS_ASSUME_NONNULL_BEGIN |
12 | 26 |
|
| 27 | +/** |
| 28 | + A subclass of `UIImage` that can procedurally generate both hollow and full circle graphics at any size. |
| 29 | + These are used for the 'normal' and 'tapped' states of the passcode circle buttons. |
| 30 | + */ |
13 | 31 | @interface TOPasscodeCircleImage : UIImage |
14 | 32 |
|
| 33 | +/** |
| 34 | + Generates and returns a `UIImage` of a filled circle at the specified size. |
| 35 | +
|
| 36 | + @param size The diameter of the final circle image |
| 37 | + @param inset An inset value that will shrink the size of the circle. This is so it can be overlaid on a hollow circle |
| 38 | + without interfering with the anti-aliasing on the outer border. |
| 39 | + @param padding External padding around the circle to ensure it won't be clipped by the edge of the layer. |
| 40 | + Setting this value will increase the dimensions of the final `UIImage`. |
| 41 | + @param antialias Whether the circle boundary will be antialiased (Since antialiasing is unnecessary if this circle will overlay another.) |
| 42 | + */ |
15 | 43 | + (UIImage *)circleImageOfSize:(CGFloat)size inset:(CGFloat)inset padding:(CGFloat)padding antialias:(BOOL)antialias; |
| 44 | + |
| 45 | +/** |
| 46 | + Generates and returns a `UIImage` of a hollow circle at the specified size. |
| 47 | +
|
| 48 | + @param size The diameter of the final circle image |
| 49 | + @param strokeWidth The thickness, in points, of the stroke making up the circle image. |
| 50 | + @param padding External padding around the circle to ensure it won't be clipped by the edge of the layer. |
| 51 | + Setting this value will increase the dimensions of the final `UIImage`. |
| 52 | + */ |
16 | 53 | + (UIImage *)hollowCircleImageOfSize:(CGFloat)size strokeWidth:(CGFloat)strokeWidth padding:(CGFloat)padding; |
17 | 54 |
|
18 | 55 | @end |
|
0 commit comments