diff --git a/CWStatusBarNotification.podspec b/CWStatusBarNotification.podspec index 81fde64..6250e0f 100644 --- a/CWStatusBarNotification.podspec +++ b/CWStatusBarNotification.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "CWStatusBarNotification" - s.version = "2.3.1" + s.version = "2.3.2" s.summary = "A library that creates status bar notifications." s.description = "CWStatusBarNotification is a library allows you to present a beautiful text-based notification in the status bar." s.homepage = "https://github.com/cezarywojcik/CWStatusBarNotification" diff --git a/CWStatusBarNotification/CWStatusBarNotification.m b/CWStatusBarNotification/CWStatusBarNotification.m index 61992d3..c73b05c 100644 --- a/CWStatusBarNotification/CWStatusBarNotification.m +++ b/CWStatusBarNotification/CWStatusBarNotification.m @@ -194,7 +194,11 @@ - (CWStatusBarNotification *)init self = [super init]; if (self) { // set default - self.notificationLabelBackgroundColor = [[UIApplication sharedApplication] delegate].window.tintColor; + if ([[UIApplication sharedApplication] delegate].window != nil) { + self.notificationLabelBackgroundColor = [[UIApplication sharedApplication] delegate].window.tintColor; + } else { + self.notificationLabelBackgroundColor = [UIColor blackColor]; + } self.notificationLabelTextColor = [UIColor whiteColor]; self.notificationLabelFont = [UIFont systemFontOfSize:FONT_SIZE]; self.notificationLabelHeight = 0.0; diff --git a/README.md b/README.md index 5eea7c0..1dc74a9 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Works for iPhone and iPad. ### CocoaPods -`pod 'CWStatusBarNotification', '~> 2.3.1'` +`pod 'CWStatusBarNotification', '~> 2.3.2'` ### Manual