Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions GCDiscreetNotificationView.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
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 => '[email protected]:gcamp/GCDiscreetNotificationView.git' }
s.source_files = 'GCDiscreetNotificationView/*.{c,h,m,mm}'
end
7 changes: 6 additions & 1 deletion GCDiscreetNotificationView/GCDiscreetNotificationView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -405,4 +410,4 @@ - (void)willMoveToSuperview:(UIView *)newSuperview {
}
}

@end
@end