From 2c9ffb65cb09d71678c6d359a6eb48d6d93d3927 Mon Sep 17 00:00:00 2001 From: Jian Yin Shen <@alienbat@gmail.com> Date: Mon, 15 Jun 2015 17:12:02 -0700 Subject: [PATCH] Provides means to use a custom symbol view --- CSNotificationView/CSNotificationView.h | 6 ++++++ CSNotificationView/CSNotificationView.m | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CSNotificationView/CSNotificationView.h b/CSNotificationView/CSNotificationView.h index 084a6b5..0094c18 100755 --- a/CSNotificationView/CSNotificationView.h +++ b/CSNotificationView/CSNotificationView.h @@ -108,4 +108,10 @@ typedef void(^CSVoidBlock)(); */ @property (nonatomic, copy) CSVoidBlock tapHandler; +/* + * If given, this view will be used in place of the image or the activity view. + * The size of the symbol view will be adjusted automatically; + * the setter should not set width/height constraints + */ +@property (nonatomic, strong) UIView* customSymbolView; @end diff --git a/CSNotificationView/CSNotificationView.m b/CSNotificationView/CSNotificationView.m index 4f4fbb0..7be6617 100644 --- a/CSNotificationView/CSNotificationView.m +++ b/CSNotificationView/CSNotificationView.m @@ -439,7 +439,10 @@ - (void)updateSymbolView { [self.symbolView removeFromSuperview]; - if (self.isShowingActivity) { + if (self.customSymbolView) { + _symbolView = self.customSymbolView; + } + else if (self.isShowingActivity) { UIActivityIndicatorView* indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; indicator.color = self.contentColor; [indicator startAnimating];