Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MDCSwipeToChoose/Internal/Views/UIView+MDCBorderedLabel.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

- (void)constructBorderedLabelWithText:(NSString *)text
color:(UIColor *)color
font:(UIFont *)font
angle:(CGFloat)angle;

@end
5 changes: 3 additions & 2 deletions MDCSwipeToChoose/Internal/Views/UIView+MDCBorderedLabel.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ @implementation UIView (MDCBorderedLabel)

- (void)constructBorderedLabelWithText:(NSString *)text
color:(UIColor *)color
font:(UIFont *)font
angle:(CGFloat)angle {
self.layer.borderColor = color.CGColor;
self.layer.borderWidth = 5.f;
Expand All @@ -38,8 +39,8 @@ - (void)constructBorderedLabelWithText:(NSString *)text
UILabel *label = [[UILabel alloc] initWithFrame:self.bounds];
label.text = [text uppercaseString];
label.textAlignment = NSTextAlignmentCenter;
label.font = [UIFont fontWithName:@"HelveticaNeue-CondensedBlack"
size:48.f];
label.font = font;

label.textColor = color;
[self addSubview:label];

Expand Down
12 changes: 12 additions & 0 deletions MDCSwipeToChoose/Public/Options/MDCSwipeToChooseViewOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
*/
@property (nonatomic, strong) UIColor *likedColor;

/*!
* The font of the text of the `likedView`. A default value is provided in the
* `-init` method.
*/
@property (nonatomic, strong) UIFont *likedFont;

/*!
* The image used to displayed in the `likeView`. If this is present, it will take
* precedence over the likeText
Expand All @@ -72,6 +78,12 @@
*/
@property (nonatomic, strong) UIColor *nopeColor;

/*!
* The font of the text of the `nopeView`. A default value is provided in the
* `-init` method.
*/
@property (nonatomic, strong) UIFont *nopeFont;

/*!
* The image used to displayed in the `nopeView`. If this is present, it will take
* precedence over the nopeText
Expand Down
2 changes: 2 additions & 0 deletions MDCSwipeToChoose/Public/Options/MDCSwipeToChooseViewOptions.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ - (instancetype)init {
if (self) {
_likedText = [NSLocalizedString(@"liked", nil) uppercaseString];
_likedColor = [UIColor mdc_colorWith8BitRed:29.f green:245.f blue:106.f alpha:1.f];
_likedFont = [UIFont fontWithName:@"HelveticaNeue-CondensedBlack" size:48.f];
_likedRotationAngle = -15.f;

_nopeText = [NSLocalizedString(@"nope", nil) uppercaseString];
_nopeColor = [UIColor mdc_colorWith8BitRed:247.f green:91.f blue:37.f alpha:1.f];
_nopeFont = [UIFont fontWithName:@"HelveticaNeue-CondensedBlack" size:48.f];
_nopeRotationAngle = 15.f;

_threshold = 100.f;
Expand Down
2 changes: 2 additions & 0 deletions MDCSwipeToChoose/Public/Views/MDCSwipeToChooseView.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ - (void)constructLikedView {
self.likedView = [[UIView alloc] initWithFrame:frame];
[self.likedView constructBorderedLabelWithText:self.options.likedText
color:self.options.likedColor
font:self.options.likedFont
angle:self.options.likedRotationAngle];
}
self.likedView.alpha = 0.f;
Expand All @@ -111,6 +112,7 @@ - (void)constructNopeView {
self.nopeView = [[UIView alloc] initWithFrame:frame];
[self.nopeView constructBorderedLabelWithText:self.options.nopeText
color:self.options.nopeColor
font:self.options.nopeFont
angle:self.options.nopeRotationAngle];
}
self.nopeView.alpha = 0.f;
Expand Down