Skip to content

Commit

Permalink
Remove attributed string options.
Browse files Browse the repository at this point in the history
It was causing weird crashes
  • Loading branch information
dmiedema committed Jan 1, 2015
1 parent 2c4f167 commit 25c95e7
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 30 deletions.
12 changes: 0 additions & 12 deletions CRToast/CRToast.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,6 @@ extern NSString *const kCRToastAnimationGravityMagnitudeKey;
*/
extern NSString *const kCRToastTextKey;

/**
The title attributed string to be shown in the notification. This overrides `kCRToastTextKey`. Expects type `NSAttriubutedString`.
*/
extern NSString *const kCRToastAttributedStringKey;

/**
The font to be used for the `kCRToastTextKey` value . Expects type `UIFont`.
*/
Expand Down Expand Up @@ -258,11 +253,6 @@ extern NSString *const kCRToastTextMaxNumberOfLinesKey;
*/
extern NSString *const kCRToastSubtitleTextKey;

/**
The subtitle attributed string to be shown in the notification. This overrides `kCRToastSubtitleTextKey`. Expects type `NSAttriubutedString`.
*/
extern NSString *const kCRToastSubtitleAttributedStringKey;

/**
The font to be used for the `kCRToastSubtitleTextKey` value . Expects type `UIFont`.
*/
Expand Down Expand Up @@ -413,7 +403,6 @@ extern NSString *const kCRToastCaptureDefaultWindowKey;
@property (nonatomic, readonly) CGFloat animationGravityMagnitude;

@property (nonatomic, readonly) NSString *text;
@property (nonatomic, readonly) NSAttributedString *attributedString;
@property (nonatomic, readonly) UIFont *font;
@property (nonatomic, readonly) UIColor *textColor;
@property (nonatomic, readonly) NSTextAlignment textAlignment;
Expand All @@ -422,7 +411,6 @@ extern NSString *const kCRToastCaptureDefaultWindowKey;
@property (nonatomic, readonly) NSInteger textMaxNumberOfLines;

@property (nonatomic, readonly) NSString *subtitleText;
@property (nonatomic, readonly) NSAttributedString *subtitleAttributedString;
@property (nonatomic, readonly) UIFont *subtitleFont;
@property (nonatomic, readonly) UIColor *subtitleTextColor;
@property (nonatomic, readonly) NSTextAlignment subtitleTextAlignment;
Expand Down
16 changes: 0 additions & 16 deletions CRToast/CRToast.m
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ + (instancetype)interactionResponderWithInteractionType:(CRToastInteractionType)
NSString *const kCRToastAnimationGravityMagnitudeKey = @"kCRToastAnimationGravityMagnitudeKey";

NSString *const kCRToastTextKey = @"kCRToastTextKey";
NSString *const kCRToastAttributedStringKey = @"kCRToastAttributedStringKey";
NSString *const kCRToastFontKey = @"kCRToastFontKey";
NSString *const kCRToastTextColorKey = @"kCRToastTextColorKey";
NSString *const kCRToastTextAlignmentKey = @"kCRToastTextAlignmentKey";
Expand All @@ -204,7 +203,6 @@ + (instancetype)interactionResponderWithInteractionType:(CRToastInteractionType)
NSString *const kCRToastTextMaxNumberOfLinesKey = @"kCRToastTextMaxNumberOfLinesKey";

NSString *const kCRToastSubtitleTextKey = @"kCRToastSubtitleTextKey";
NSString *const kCRToastSubtitleAttributedStringKey = @"kCRToastSubtitleAttributedStringKey";
NSString *const kCRToastSubtitleFontKey = @"kCRToastSubtitleFontKey";
NSString *const kCRToastSubtitleTextColorKey = @"kCRToastSubtitleTextColorKey";
NSString *const kCRToastSubtitleTextAlignmentKey = @"kCRToastSubtitleTextAlignmentKey";
Expand Down Expand Up @@ -251,7 +249,6 @@ + (instancetype)interactionResponderWithInteractionType:(CRToastInteractionType)
static CGFloat kCRGravityMagnitudeDefault = 1.0;

static NSString * kCRTextDefault = @"";
static NSAttributedString * kCRAttributedStringDefault = nil;
static UIFont * kCRFontDefault = nil;
static UIColor * kCRTextColorDefault = nil;
static NSTextAlignment kCRTextAlignmentDefault = NSTextAlignmentCenter;
Expand All @@ -260,7 +257,6 @@ + (instancetype)interactionResponderWithInteractionType:(CRToastInteractionType)
static NSInteger kCRTextMaxNumberOfLinesDefault = 0;

static NSString * kCRSubtitleTextDefault = nil;
static NSAttributedString * kCRSubtitleAttributedStringDefault = nil;
static UIFont * kCRSubtitleFontDefault = nil;
static UIColor * kCRSubtitleTextColorDefault = nil;
static NSTextAlignment kCRSubtitleTextAlignmentDefault = NSTextAlignmentCenter;
Expand Down Expand Up @@ -325,15 +321,13 @@ + (void)initialize {
kCRToastAnimationGravityMagnitudeKey : NSStringFromClass([@(kCRGravityMagnitudeDefault) class]),

kCRToastTextKey : NSStringFromClass([NSString class]),
kCRToastAttributedStringKey : NSStringFromClass([NSAttributedString class]),
kCRToastFontKey : NSStringFromClass([UIFont class]),
kCRToastTextColorKey : NSStringFromClass([UIColor class]),
kCRToastTextAlignmentKey : NSStringFromClass([@(kCRTextAlignmentDefault) class]),
kCRToastTextShadowColorKey : NSStringFromClass([UIColor class]),
kCRToastTextShadowOffsetKey : NSStringFromClass([[NSValue valueWithCGSize:kCRTextShadowOffsetDefault] class]),
kCRToastTextMaxNumberOfLinesKey : NSStringFromClass([@(kCRTextMaxNumberOfLinesDefault) class]),
kCRToastSubtitleTextKey : NSStringFromClass([NSString class]),
kCRToastSubtitleAttributedStringKey : NSClassFromString([NSAttributedString class]),
kCRToastSubtitleFontKey : NSStringFromClass([UIFont class]),
kCRToastSubtitleTextColorKey : NSStringFromClass([UIColor class]),
kCRToastSubtitleTextAlignmentKey : NSStringFromClass([@(kCRSubtitleTextAlignmentDefault) class]),
Expand Down Expand Up @@ -397,7 +391,6 @@ + (void)setDefaultOptions:(NSDictionary*)defaultOptions {
if (defaultOptions[kCRToastAnimationGravityMagnitudeKey]) kCRGravityMagnitudeDefault = [defaultOptions[kCRToastAnimationGravityMagnitudeKey] floatValue];

if (defaultOptions[kCRToastTextKey]) kCRTextDefault = defaultOptions[kCRToastTextKey];
if (defaultOptions[kCRToastAttributedStringKey]) kCRAttributedStringDefault = defaultOptions[kCRToastAttributedStringKey];
if (defaultOptions[kCRToastFontKey]) kCRFontDefault = defaultOptions[kCRToastFontKey];
if (defaultOptions[kCRToastTextColorKey]) kCRTextColorDefault = defaultOptions[kCRToastTextColorKey];
if (defaultOptions[kCRToastTextAlignmentKey]) kCRTextAlignmentDefault = [defaultOptions[kCRToastTextAlignmentKey] integerValue];
Expand All @@ -408,7 +401,6 @@ + (void)setDefaultOptions:(NSDictionary*)defaultOptions {
if (defaultOptions[kCRToastStatusBarStyleKey]) kCRStatusBarStyleDefault = [defaultOptions[kCRToastStatusBarStyleKey] integerValue];

if (defaultOptions[kCRToastSubtitleTextKey]) kCRSubtitleTextDefault = defaultOptions[kCRToastSubtitleTextKey];
if (defaultOptions[kCRToastSubtitleAttributedStringKey]) kCRSubtitleAttributedStringDefault = defaultOptions[kCRToastSubtitleAttributedStringKey];
if (defaultOptions[kCRToastSubtitleFontKey]) kCRSubtitleFontDefault = defaultOptions[kCRToastSubtitleFontKey];
if (defaultOptions[kCRToastSubtitleTextColorKey]) kCRSubtitleTextColorDefault = defaultOptions[kCRToastSubtitleTextColorKey];
if (defaultOptions[kCRToastSubtitleTextAlignmentKey]) kCRSubtitleTextAlignmentDefault = [defaultOptions[kCRToastSubtitleTextAlignmentKey] integerValue];
Expand Down Expand Up @@ -599,10 +591,6 @@ - (NSString*)text {
return _options[kCRToastTextKey] ?: kCRTextDefault;
}

- (NSAttributedString *)attributedString {
return _options[kCRToastAttributedStringKey];
}

- (UIFont*)font {
return _options[kCRToastFontKey] ?: kCRFontDefault;
}
Expand All @@ -629,10 +617,6 @@ - (NSString*)subtitleText {
return _options[kCRToastSubtitleTextKey] ?: kCRSubtitleTextDefault;
}

- (NSAttributedString *)subtitleAttributedString {
return _options[kCRToastSubtitleAttributedStringKey];
}

- (UIFont*)subtitleFont {
return _options[kCRToastSubtitleFontKey] ?: kCRSubtitleFontDefault;
}
Expand Down
2 changes: 0 additions & 2 deletions CRToast/CRToastView.m
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ - (void)layoutSubviews {
- (void)setToast:(CRToast *)toast {
_toast = toast;
_label.text = toast.text;
_label.attributedText = toast.attributedString;
_label.font = toast.font;
_label.textColor = toast.textColor;
_label.textAlignment = toast.textAlignment;
Expand All @@ -210,7 +209,6 @@ - (void)setToast:(CRToast *)toast {
_label.shadowColor = toast.textShadowColor;
if (toast.subtitleText != nil) {
_subtitleLabel.text = toast.subtitleText;
_subtitleLabel.attributedText = toast.subtitleAttributedString;
_subtitleLabel.font = toast.subtitleFont;
_subtitleLabel.textColor = toast.subtitleTextColor;
_subtitleLabel.textAlignment = toast.subtitleTextAlignment;
Expand Down

0 comments on commit 25c95e7

Please sign in to comment.