From 2e2ecbbaa16eafc3ebdbaf98fe6c5409dc70ad97 Mon Sep 17 00:00:00 2001 From: Paulo Coutinho Date: Wed, 29 Jan 2014 15:47:00 -0200 Subject: [PATCH 1/4] added podspec file for cocoapods --- GCDiscreetNotificationView.podspec | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 GCDiscreetNotificationView.podspec diff --git a/GCDiscreetNotificationView.podspec b/GCDiscreetNotificationView.podspec new file mode 100644 index 0000000..6f781d1 --- /dev/null +++ b/GCDiscreetNotificationView.podspec @@ -0,0 +1,11 @@ +Pod::Spec.new do |s| + s.name = 'GCDiscreetNotificationView' + s.version = '1.0' + s.license = 'MIT' + s.summary = 'GCDiscreetNotificationView is a discreet, non-modal, notification view for iOS' + s.homepage = 'https://github.com/gcamp/GCDiscreetNotificationView' + s.author = 'gcamp' + s.source = { :git => 'git@github.com:gcamp/GCDiscreetNotificationView.git' } + s.source_files = 'GCDiscreetNotificationView/**/*.{c,h,m,mm}' + s.requires_arc = true +end From 9257e2df65c3e842e04e80d341626c1c8985bd17 Mon Sep 17 00:00:00 2001 From: prsolucoes Date: Wed, 29 Jan 2014 15:56:24 -0200 Subject: [PATCH 2/4] Update GCDiscreetNotificationView.podspec --- GCDiscreetNotificationView.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GCDiscreetNotificationView.podspec b/GCDiscreetNotificationView.podspec index 6f781d1..ae11d23 100644 --- a/GCDiscreetNotificationView.podspec +++ b/GCDiscreetNotificationView.podspec @@ -6,6 +6,6 @@ Pod::Spec.new do |s| s.homepage = 'https://github.com/gcamp/GCDiscreetNotificationView' s.author = 'gcamp' s.source = { :git => 'git@github.com:gcamp/GCDiscreetNotificationView.git' } - s.source_files = 'GCDiscreetNotificationView/**/*.{c,h,m,mm}' + s.source_files = 'GCDiscreetNotificationView/*.{c,h,m,mm}' s.requires_arc = true end From 072dd7b994aff4e5d0fedc28b006353c5ab7f712 Mon Sep 17 00:00:00 2001 From: prsolucoes Date: Wed, 29 Jan 2014 15:57:06 -0200 Subject: [PATCH 3/4] Update GCDiscreetNotificationView.podspec --- GCDiscreetNotificationView.podspec | 1 - 1 file changed, 1 deletion(-) diff --git a/GCDiscreetNotificationView.podspec b/GCDiscreetNotificationView.podspec index ae11d23..7875539 100644 --- a/GCDiscreetNotificationView.podspec +++ b/GCDiscreetNotificationView.podspec @@ -7,5 +7,4 @@ Pod::Spec.new do |s| s.author = 'gcamp' s.source = { :git => 'git@github.com:gcamp/GCDiscreetNotificationView.git' } s.source_files = 'GCDiscreetNotificationView/*.{c,h,m,mm}' - s.requires_arc = true end From 78086d149367d3ee87b85193740e1193cb2c17b3 Mon Sep 17 00:00:00 2001 From: Paulo Coutinho Date: Thu, 30 Jan 2014 03:24:18 -0200 Subject: [PATCH 4/4] added support for iOS6 --- GCDiscreetNotificationView/GCDiscreetNotificationView.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/GCDiscreetNotificationView/GCDiscreetNotificationView.m b/GCDiscreetNotificationView/GCDiscreetNotificationView.m index d2bae8f..aa293f6 100644 --- a/GCDiscreetNotificationView/GCDiscreetNotificationView.m +++ b/GCDiscreetNotificationView/GCDiscreetNotificationView.m @@ -89,7 +89,12 @@ - (void) layoutSubviews { CGFloat maxLabelWidth = self.view.frame.size.width - self.activityIndicator.frame.size.width * withActivity - baseWidth; CGSize maxLabelSize = CGSizeMake(maxLabelWidth, GCDiscreetNotificationViewHeight); + +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 CGFloat textSizeWidth = (self.textLabel != nil) ? [self.textLabel boundingRectWithSize:maxLabelSize options:NSStringDrawingTruncatesLastVisibleLine|NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:self.label.font} context:nil].size.width : 0; +#else + CGFloat textSizeWidth = (self.textLabel != nil) ? [self.textLabel sizeWithFont:self.label.font constrainedToSize:maxLabelSize].width : 0; +#endif CGFloat activityIndicatorWidth = (self.activityIndicator != nil) ? self.activityIndicator.frame.size.width : 0; CGRect bounds = CGRectMake(0, 0, baseWidth + textSizeWidth + activityIndicatorWidth, GCDiscreetNotificationViewHeight); @@ -405,4 +410,4 @@ - (void)willMoveToSuperview:(UIView *)newSuperview { } } -@end +@end \ No newline at end of file