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

Commit

Permalink
1.0.3
Browse files Browse the repository at this point in the history
• Fixes for iOS 5
  • Loading branch information
JonasGessner committed Aug 26, 2014
1 parent b5e4dee commit 49a393d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ - (void)viewDidLoad {

self.title = @"JGActionSheet";

[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"Cell"];
if ([self.tableView respondsToSelector:@selector(registerClass:forCellReuseIdentifier:)]) {
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"Cell"];
}

// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
Expand Down Expand Up @@ -137,6 +139,10 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];

if (!cell){
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
}

if (!cell.accessoryView) {
UIButton *accessory = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[accessory addTarget:self action:@selector(accessoryTapped:) forControlEvents:UIControlEventTouchUpInside];
Expand Down
14 changes: 3 additions & 11 deletions JGActionSheet.podspec
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
Pod::Spec.new do |s|

s.name = "JGActionSheet"
s.version = "1.0.2"
s.summary = "A feature rich action sheet for iOS."
s.description = <<-DESC
<b>JGActionSheet has all features of UIActionSheet but it goes even further than that:<b>
• Multiple sections.
• Full customization for buttons and labels.
• Sections can contain custom views.
• Blocks.
• Unlimited content capacity, thanks to UIScrollView.
DESC
s.version = "1.0.3"
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.2" }
s.source = { :git => "https://github.com/JonasGessner/JGActionSheet.git", :tag => "v1.0.3" }
s.source_files = "JGActionSheet/*.{h,m}"
s.frameworks = "Foundation", "UIKit", "QuartzCore"
s.requires_arc = true
Expand Down
15 changes: 14 additions & 1 deletion JGActionSheet/JGActionSheet.m
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ - (CGRect)layoutForWidth:(CGFloat)width {

#pragma mark - JGActionSheet

@implementation JGActionSheet {
@interface JGActionSheet () <UIGestureRecognizerDelegate> {
UIScrollView *_scrollView;
JGActionSheetTriangle *_arrowView;
JGActionSheetView *_scrollViewHost;
Expand All @@ -490,6 +490,10 @@ @implementation JGActionSheet {
JGActionSheetArrowDirection _anchoredArrowDirection;
}

@end

@implementation JGActionSheet

@dynamic visible;

#pragma mark Initializers
Expand All @@ -505,6 +509,7 @@ - (instancetype)initWithSections:(NSArray *)sections {

if (self) {
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)];
tap.delegate = self;

[self addGestureRecognizer:tap];

Expand Down Expand Up @@ -557,6 +562,14 @@ - (void)dealloc {

#pragma mark Callbacks

- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
if ([self hitTest:[gestureRecognizer locationInView:self] withEvent:nil] == self && self.outsidePressBlock) {
return YES;
}

return NO;
}

- (void)tapped:(UITapGestureRecognizer *)gesture {
if ([self hitTest:[gesture locationInView:self] withEvent:nil] == self && self.outsidePressBlock) {
self.outsidePressBlock(self);
Expand Down
2 changes: 1 addition & 1 deletion 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.2
#####Current Version: 1.0.3

Introduction
===========
Expand Down

0 comments on commit 49a393d

Please sign in to comment.