Skip to content

Commit 1a74c55

Browse files
committed
Added more header documentation
1 parent 364a5f7 commit 1a74c55

File tree

6 files changed

+89
-11
lines changed

6 files changed

+89
-11
lines changed

TOPasscodeViewController/TOPasscodeSettingsViewController.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,19 @@ NS_ASSUME_NONNULL_BEGIN
8888
/** If set, the view controller will disable input until this date time has been reached */
8989
@property (nonatomic, strong, nullable) NSDate *disabledInputDate;
9090

91-
/* Create a new instance with the desird light or dark style */
91+
/*
92+
Create a new instance with the desird light or dark style
93+
94+
@param style The visual style of the view controller
95+
*/
9296
- (instancetype)initWithStyle:(TOPasscodeSettingsViewStyle)style;
9397

94-
/* Changes the passcode type and animates if required */
98+
/*
99+
Changes the passcode type and animates if required
100+
101+
@param passcodeType Change the type of passcode to enter.
102+
@param animated Play a crossfade animation.
103+
*/
95104
- (void)setPasscodeType:(TOPasscodeType)passcodeType animated:(BOOL)animated;
96105

97106
@end

TOPasscodeViewController/TOPasscodeViewController.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,20 @@ NS_ASSUME_NONNULL_BEGIN
128128
Useful for obscuring the content while the app is suspended. */
129129
@property (nonatomic, assign) BOOL contentHidden;
130130

131-
/** Create a new instance of this view controller with the preset style. */
131+
/**
132+
Create a new instance of this view controller with the preset style and passcode type.
133+
134+
@param style The visual style of the view controller (light/translucent)
135+
@param type The type of passcode to enter (6-digit/numeric)
136+
*/
132137
- (instancetype)initWithStyle:(TOPasscodeViewStyle)style passcodeType:(TOPasscodeType)type;
133138

134-
/** Hide all of the content views with a crossfade animation */
139+
/**
140+
Hide everything except the background translucency view.
141+
142+
@param hidden Whether the content is hidden or not.
143+
@param animated The content will play a crossfade animation.
144+
*/
135145
- (void)setContentHidden:(BOOL)hidden animated:(BOOL)animated;
136146

137147
@end

TOPasscodeViewController/Views/Main/TOPasscodeCircleButton.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727

2828
NS_ASSUME_NONNULL_BEGIN
2929

30+
/**
31+
A UI control representing a single PIN code button for the keypad,
32+
including the number, lettering (eg 'ABC'), and circle border.
33+
*/
3034
@interface TOPasscodeCircleButton : UIControl
3135

3236
// Alpha value that properly controls the necessary subviews
@@ -56,9 +60,20 @@ NS_ASSUME_NONNULL_BEGIN
5660
// Callback handler
5761
@property (nonatomic, copy) void (^buttonTappedHandler)();
5862

63+
/**
64+
Create a new instance of the class with the supplied number and lettering string
65+
66+
@param numberString The string of the number to display in this button (eg '1').
67+
@param letteringString The string of the lettering to display underneath.
68+
*/
5969
- (instancetype)initWithNumberString:(NSString *)numberString letteringString:(NSString *)letteringString;
6070

61-
// Automatically called when tapped
71+
/**
72+
Set the background of the button to be the filled circle instead of hollow.
73+
74+
@param highlighted When YES, the circle is full, when NO, it is hollow.
75+
@param animated When animated, the transition is a crossfade.
76+
*/
6277
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated;
6378

6479
@end

TOPasscodeViewController/Views/Main/TOPasscodeKeypadView.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ NS_ASSUME_NONNULL_BEGIN
2626

2727
@class TOPasscodeCircleButton;
2828

29+
/**
30+
A view encompassing 9 circle buttons, making up a keypad view for entering PIN numbers.
31+
Can be laid out vertically or horizontally.
32+
*/
2933
@interface TOPasscodeKeypadView : UIView <UIInputViewAudioFeedback>
3034

3135
/** The type of layout for the buttons (Default is vertical) */
@@ -83,7 +87,13 @@ NS_ASSUME_NONNULL_BEGIN
8387
/** The block that is triggered whenever a user taps one of the buttons */
8488
@property (nonatomic, copy) void (^buttonTappedHandler)(NSInteger buttonNumber);
8589

86-
/* Perform an animation of a set duration to the new layout */
90+
/*
91+
Perform an animation to transition to a new layout.
92+
93+
@param horizontalLayout The content is laid out horizontally.
94+
@param animated Whether the transition is animated
95+
@param duration The animation length of the transition.
96+
*/
8797
- (void)setHorizontalLayout:(BOOL)horizontalLayout animated:(BOOL)animated duration:(CGFloat)duration;
8898

8999
@end

TOPasscodeViewController/Views/Main/TOPasscodeView.h

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ NS_ASSUME_NONNULL_BEGIN
3030
@class TOPasscodeKeypadView;
3131
@class TOPasscodeViewContentLayout;
3232

33+
/**
34+
The passcode view is the primary content view for the passcode view controller.
35+
On iPad, every view except the background view is a subview of this view.
36+
On iPhone, the auxiliary buttons ('Touch ID', 'Cancel') are managed by the view controller.
37+
*/
3338
@interface TOPasscodeView : UIView
3439

3540
/* The visual style of the view */
@@ -83,19 +88,43 @@ NS_ASSUME_NONNULL_BEGIN
8388
/* Callback triggered when the user has finished entering the passcode */
8489
@property (nonatomic, copy, nullable) void (^passcodeCompletedHandler)(NSString *passcode);
8590

86-
/* Create a new instance with one of the style types */
91+
/*
92+
Create a new instance with one of the style types
93+
94+
@param style The visual style of the passcode view.
95+
@param type The type of passcode to accept.
96+
*/
8797
- (instancetype)initWithStyle:(TOPasscodeViewStyle)style passcodeType:(TOPasscodeType)type;
8898

89-
/* Resize the view and all subviews for the optimum size to fit a super view of the suplied width. */
99+
/*
100+
Resize the view and all subviews for the optimum size to fit a super view of the suplied width.
101+
102+
@param size The size of the view to which this view.
103+
*/
90104
- (void)sizeToFitSize:(CGSize)size;
91105

92-
/* Reset the passcode to nil and optionally play animation / vibration to match */
106+
/*
107+
Reset the passcode to nil and optionally play animation / vibration to match
108+
109+
@param animated Play a shaking animation to reset the password.
110+
@param impact On supported devices, play a small reset vibration as well.
111+
*/
93112
- (void)resetPasscodeAnimated:(BOOL)animated playImpact:(BOOL)impact;
94113

95-
/* Delete the last character from the passcode */
114+
/*
115+
Delete the last character from the passcode
116+
117+
@param animated Whether the delete operation is animated or not.
118+
*/
96119
- (void)deleteLastPasscodeCharacterAnimated:(BOOL)animated;
97120

98-
/* Animate the transition between horizontal and vertical layouts */
121+
/*
122+
Animate the transition between horizontal and vertical layouts
123+
124+
@param horizontalLayout Whether to lay out the content vertically or horizontally.
125+
@param animated Whether the transition is animated or not.
126+
@param duration The duration of the animation
127+
*/
99128
- (void)setHorizontalLayout:(BOOL)horizontalLayout animated:(BOOL)animated duration:(CGFloat)duration;
100129

101130
@end

TOPasscodeViewController/Views/Settings/TOPasscodeSettingsKeypadButton.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424

2525
@class TOPasscodeButtonLabel;
2626

27+
/**
28+
A single button view that is used in a number keypad views styled in
29+
a pseudo-skeuomorphic style.
30+
31+
*/
2732
@interface TOPasscodeSettingsKeypadButton : UIButton
2833

2934
/** Background Images */

0 commit comments

Comments
 (0)