diff --git a/MDCSwipeToChoose/Internal/Views/UIView+MDCBorderedLabel.h b/MDCSwipeToChoose/Internal/Views/UIView+MDCBorderedLabel.h index 326de31..8be3dad 100644 --- a/MDCSwipeToChoose/Internal/Views/UIView+MDCBorderedLabel.h +++ b/MDCSwipeToChoose/Internal/Views/UIView+MDCBorderedLabel.h @@ -28,6 +28,7 @@ - (void)constructBorderedLabelWithText:(NSString *)text color:(UIColor *)color + font:(UIFont *)font angle:(CGFloat)angle; @end diff --git a/MDCSwipeToChoose/Internal/Views/UIView+MDCBorderedLabel.m b/MDCSwipeToChoose/Internal/Views/UIView+MDCBorderedLabel.m index 9367fcc..f5e4ac0 100644 --- a/MDCSwipeToChoose/Internal/Views/UIView+MDCBorderedLabel.m +++ b/MDCSwipeToChoose/Internal/Views/UIView+MDCBorderedLabel.m @@ -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; @@ -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]; diff --git a/MDCSwipeToChoose/Public/Options/MDCSwipeToChooseViewOptions.h b/MDCSwipeToChoose/Public/Options/MDCSwipeToChooseViewOptions.h index f43c044..1097cb7 100644 --- a/MDCSwipeToChoose/Public/Options/MDCSwipeToChooseViewOptions.h +++ b/MDCSwipeToChoose/Public/Options/MDCSwipeToChooseViewOptions.h @@ -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 @@ -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 diff --git a/MDCSwipeToChoose/Public/Options/MDCSwipeToChooseViewOptions.m b/MDCSwipeToChoose/Public/Options/MDCSwipeToChooseViewOptions.m index 19be422..1604c7b 100644 --- a/MDCSwipeToChoose/Public/Options/MDCSwipeToChooseViewOptions.m +++ b/MDCSwipeToChoose/Public/Options/MDCSwipeToChooseViewOptions.m @@ -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; diff --git a/MDCSwipeToChoose/Public/Views/MDCSwipeToChooseView.m b/MDCSwipeToChoose/Public/Views/MDCSwipeToChooseView.m index f94bcbb..954172a 100644 --- a/MDCSwipeToChoose/Public/Views/MDCSwipeToChooseView.m +++ b/MDCSwipeToChoose/Public/Views/MDCSwipeToChooseView.m @@ -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; @@ -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;