Permalink
Browse files

Merge pull request #17 from funkadelic/master

iOS 4 compatibility from regression
  • Loading branch information...
2 parents 4c6ec3a + 391c74c commit 486a264e215035e1d7b40b3b23beb7d66833756b @coneybeare coneybeare committed Aug 24, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 UAModalPanel/Panel/Panels/UAModalPanel.m
View
4 UAModalPanel/Panel/Panels/UAModalPanel.m
@@ -138,9 +138,9 @@ - (UIButton*)closeButton {
- (UIButton*)actionButton {
if (!actionButton) {
UIImage *image = [UIImage imageNamed:@"modalButton.png"];
- UIImage *stretch = [image resizableImageWithCapInsets:UIEdgeInsetsMake(0, image.size.width/2.0, 0, image.size.width/2.0)];
+ UIImage *stretch = ([UIImage respondsToSelector:@selector(resizableImageWithCapInsets:)]) ? [image resizableImageWithCapInsets:UIEdgeInsetsMake(0, image.size.width/2.0, 0, image.size.width/2.0)] : [image stretchableImageWithLeftCapWidth:image.size.width/2.0 topCapHeight:image.size.width/2.0];
UIImage *image2 = [UIImage imageNamed:@"modalButton-selected.png"];
- UIImage *stretch2 = [image2 resizableImageWithCapInsets:UIEdgeInsetsMake(0, image2.size.width/2.0, 0, image2.size.width/2.0)];
+ UIImage *stretch2 = ([UIImage respondsToSelector:@selector(resizableImageWithCapInsets:)]) ? [image2 resizableImageWithCapInsets:UIEdgeInsetsMake(0, image2.size.width/2.0, 0, image2.size.width/2.0)] : [image stretchableImageWithLeftCapWidth:image2.size.width/2.0 topCapHeight:image2.size.width/2.0];
self.actionButton = [UIButton buttonWithType:UIButtonTypeCustom];
[self.actionButton setBackgroundImage:stretch forState:UIControlStateNormal];
[self.actionButton setBackgroundImage:stretch2 forState:UIControlStateHighlighted];

0 comments on commit 486a264

Please sign in to comment.