Skip to content

Commit

Permalink
- Adds CHANGELOG.md
Browse files Browse the repository at this point in the history
- Restrict use of +[UIButton buttonWithType:]
- Add swift name: `StateButton`
  • Loading branch information
alexhillc committed Aug 25, 2017
1 parent f32cb28 commit 0ceadcb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# 1.0.0
- Initial release; for summary of functionality, see README.md
1 change: 1 addition & 0 deletions Source/AXStateButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

@import UIKit;

NS_SWIFT_NAME(StateButton)
@interface AXStateButton : UIButton

+ (nullable instancetype)button;
Expand Down
7 changes: 6 additions & 1 deletion Source/AXStateButton.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ @implementation AXStateButton

#pragma mark - Initialization
+ (instancetype)button {
return [[self class] buttonWithType:UIButtonTypeCustom];
return [super buttonWithType:UIButtonTypeCustom];
}

+ (instancetype)buttonWithType:(UIButtonType)buttonType {
[NSException raise:@"AXUnsupportedFactoryMethodException" format:@"Use +[AXStateButton button] instead."];
return nil;
}

- (instancetype)init {
Expand Down

0 comments on commit 0ceadcb

Please sign in to comment.