Skip to content

Commit

Permalink
Removed minimumWidth property since it doesn’t make sense anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
TimOliver committed Oct 3, 2023
1 parent ae63374 commit 52d7abf
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 24 deletions.
3 changes: 0 additions & 3 deletions TORoundedButton/TORoundedButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ IB_DESIGNABLE @interface TORoundedButton : UIControl
/// The duration of the tapping cross-fade animation (Default is 0.4f).
@property (nonatomic, assign) CGFloat tapAnimationDuration;

/// Given the current size of the text label, the smallest horizontal width in which this button can scale.
@property (nonatomic, readonly) CGFloat minimumWidth;

/// A callback handler triggered each time the button is tapped.
@property (nonatomic, copy) void (^tappedHandler)(void);

Expand Down
4 changes: 0 additions & 4 deletions TORoundedButton/TORoundedButton.m
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,6 @@ - (void)setEnabled:(BOOL)enabled {
_containerView.alpha = enabled ? 1 : 0.4;
}

- (CGFloat)minimumWidth {
return _titleLabel.frame.size.width;
}

#pragma mark - Graphics Handling -

- (UIColor *)_brightnessAdjustedColorWithColor:(UIColor *)color amount:(CGFloat)amount TOROUNDEDBUTTON_OBJC_DIRECT {
Expand Down
17 changes: 0 additions & 17 deletions TORoundedButtonExampleTests/TORoundedButtonExampleTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,6 @@ - (void)testDefaultValues
XCTAssertEqual(button.tappedButtonScale, 0.97f);
}

- (void)testMinimimumWidth
{
TORoundedButton *button = [[TORoundedButton alloc] initWithText:@"Long Button Name"];

// Manually
UILabel *titleLabel = nil;
for (UIView *subview in button.subviews.firstObject.subviews) {
if ([subview isKindOfClass:[UILabel class]]) {
titleLabel = (UILabel *)subview;
break;
}
}

XCTAssert(button.minimumWidth > 0.0f);
XCTAssertEqual(titleLabel.frame.size.width, button.minimumWidth);
}

- (void)testButtonInteraction
{
TORoundedButton *button = [[TORoundedButton alloc] initWithText:@"Long Button Name"];
Expand Down

0 comments on commit 52d7abf

Please sign in to comment.