Skip to content
This repository has been archived by the owner on Oct 30, 2020. It is now read-only.

Commit

Permalink
1.0.4
Browse files Browse the repository at this point in the history
• Removed deprecated method.
• Added option to modify the backgroundColor behind the actionsheet.
  • Loading branch information
JonasGessner committed Sep 2, 2014
1 parent 49a393d commit 2d40645
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions JGActionSheet.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Pod::Spec.new do |s|

s.name = "JGActionSheet"
s.version = "1.0.3"
s.version = "1.0.4"
s.summary = "A feature-rich and modern action sheet for iOS."
s.homepage = "https://github.com/JonasGessner/JGActionSheet"
s.license = { :type => "MIT", :file => "LICENSE.txt" }
s.author = "Jonas Gessner"
s.social_media_url = "http://twitter.com/JonasGessner"
s.platform = :ios, "5.0"
s.source = { :git => "https://github.com/JonasGessner/JGActionSheet.git", :tag => "v1.0.3" }
s.source = { :git => "https://github.com/JonasGessner/JGActionSheet.git", :tag => "v1.0.4" }
s.source_files = "JGActionSheet/*.{h,m}"
s.frameworks = "Foundation", "UIKit", "QuartzCore"
s.requires_arc = true
Expand Down
2 changes: 1 addition & 1 deletion JGActionSheet/JGActionSheet.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ typedef NS_ENUM(NSUInteger, JGActionSheetArrowDirection) {
@property (nonatomic, strong, readonly) UILabel *messageLabel;

/**
If the section was initialized with button titles, the corresponding buttons are in this array.
If the section was initialized with button titles, the corresponding buttons are in this array. You may access these to modify the text color, the font etc.
*/
@property (nonatomic, strong, readonly) NSArray *buttons;

Expand Down
15 changes: 11 additions & 4 deletions JGActionSheet/JGActionSheet.m
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ - (UIImage *)pixelImageWithColor:(UIColor *)color {

UIGraphicsEndImageContext();

return [img stretchableImageWithLeftCapWidth:0 topCapHeight:0];
return [img resizableImageWithCapInsets:UIEdgeInsetsZero];
}

- (void)setButtonStyle:(JGActionSheetButtonStyle)buttonStyle forButton:(UIButton *)button {
Expand Down Expand Up @@ -485,6 +485,8 @@ @interface JGActionSheet () <UIGestureRecognizerDelegate> {

CGRect _finalContentFrame;

UIColor *_realBGColor;

BOOL _anchoredAtPoint;
CGPoint _anchorPoint;
JGActionSheetArrowDirection _anchoredArrowDirection;
Expand Down Expand Up @@ -524,7 +526,7 @@ - (instancetype)initWithSections:(NSArray *)sections {
[_scrollViewHost addSubview:_scrollView];
[self addSubview:_scrollViewHost];

self.backgroundColor = [UIColor clearColor];
self.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.3f];

_sections = sections;

Expand Down Expand Up @@ -560,6 +562,11 @@ - (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (void)setBackgroundColor:(UIColor *)backgroundColor {
[super setBackgroundColor:backgroundColor];
_realBGColor = backgroundColor;
}

#pragma mark Callbacks

- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
Expand Down Expand Up @@ -677,7 +684,7 @@ - (void)layoutForVisible:(BOOL)visible {
UIView *viewToModify = _scrollViewHost;

if (visible) {
self.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.3f];
self.backgroundColor = _realBGColor;

if (iPad) {
viewToModify.alpha = 1.0f;
Expand All @@ -688,7 +695,7 @@ - (void)layoutForVisible:(BOOL)visible {
}
}
else {
self.backgroundColor = [UIColor clearColor];
super.backgroundColor = [UIColor clearColor];

if (iPad) {
viewToModify.alpha = 0.0f;
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A feature-rich and modern action sheet for iOS.
<img src="JGActionSheet Tests/Screenshots/1.png" width="36.2%"/>&nbsp;
<img src="JGActionSheet Tests/Screenshots/2.png" width="48%"/></p>

#####Current Version: 1.0.3
#####Current Version: 1.0.4

Introduction
===========
Expand All @@ -18,7 +18,7 @@ JGActionSheet has all features of UIActionSheet but it goes even further than th
• Unlimited content capacity, thanks to UIScrollView.<br></b>

####iPad support:
While of course offering iPhone suppott, iPad support is crucial, as many UIActionSheet alternatives don't offer iPad support.<br>
While of course offering iPhone support, iPad support is crucial, as many UIActionSheet alternatives don't offer iPad support.<br>
JGActionSheet takes the ideas of UIActionSheet but implements them much better. You can precisely show the action sheet from a specific point in a view and set the arrow direction like in a UIPopoverController!<br><br>
The action sheet can also just be shown in the center of a view on iPads, like UIActionSheet.

Expand All @@ -28,8 +28,8 @@ On iOS 8 `UIAlertController` replaces `UIActionSheet` and `UIAlertView`. UIAlert
Requirements
=================

• iOS 5 or higher<br>
• ARC
Deployment Target of iOS 5 or higher, Base SDK of iOS 7 or higher.<br>
• ARC.

Examples
=================
Expand Down

0 comments on commit 2d40645

Please sign in to comment.