• This repository has been archived on 30/Oct/2020
  • Stars
    star
    855
  • Rank 53,320 (Top 2 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Feature-rich action sheet for iOS. This ActionSheet is a replacement for UIActionSheet, with iPad support!

JGActionSheet

A feature-rich and modern action sheet for iOS.

Β 

#####Current Version: 1.0.5

Introduction

JGActionSheet has all features of UIActionSheet but it goes even further than that:
β€’ Multiple sections.
β€’ Full customization for buttons and labels.
β€’ Sections can contain custom views.
β€’ Block callbacks.
β€’ Unlimited content capacity, thanks to UIScrollView.

####iPad support: While of course offering iPhone support, iPad support is crucial, as many UIActionSheet alternatives don't offer iPad support.
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!

The action sheet can also just be shown in the center of a view on iPads, like UIActionSheet.

####UIAlertController on iOS 8: On iOS 8 UIAlertController replaces UIActionSheet and UIAlertView. UIAlertController has even less features than UIActionSheet on iPads. Controlling whether the action sheet should show in the center of a view without an arrow or with an arrow is gone. And setting the location of the action sheet when using an arrow has become even more difficult and annoying. JGActionSheet gets rid of all these limitations and makes placing your action sheet so much easier!

Requirements

β€’ Deployment Target of iOS 5 or higher, Base SDK of iOS 7 or higher.
β€’ ARC.

Examples

#####Simple example:

JGActionSheetSection *section1 = [JGActionSheetSection sectionWithTitle:@"Title" message:@"Message" buttonTitles:@[@"Yes", @"No"] buttonStyle:JGActionSheetButtonStyleDefault];
JGActionSheetSection *cancelSection = [JGActionSheetSection sectionWithTitle:nil message:nil buttonTitles:@[@"Cancel"] buttonStyle:JGActionSheetButtonStyleCancel];

NSArray *sections = @[section1, cancelSection];

JGActionSheet *sheet = [JGActionSheet actionSheetWithSections:sections];

[sheet setButtonPressedBlock:^(JGActionSheet *sheet, NSIndexPath *indexPath) {
    [sheet dismissAnimated:YES];
}];
    
[sheet showInView:self.view animated:YES];

This displays an action sheet with a section with the title "Title", the message "Message", two buttons saying "Yes" and "No", and a second section containing just a cancel button. The action sheet will be dismissed with every tap of a button (The buttonPressedBlock block dismisses the action sheet for every pressed button in this case!).

See the JGActionSheet Tests project for more example implementations.

Documentation

Detailed documentation can be found on CocoaDocs.
The header file also contains detailed documentation for each method call. See JGActionSheet.h.

Installation

CocoaPods:
Add this to your Podfile:

pod 'JGActionSheet'

Add source files:
JGActionSheet consist of only the JGActionSheet.h and JGActionSheet.m files. To use JGActionSheet in your project, simply drag these two files located in the JGActionSheet folder into your project.

After you have included JGActionSheet in your project simply do #import "JGActionSheet.h" and you are ready to go!

License

MIT License.
Β©2014 Jonas Gessner.

Credits

Created by Jonas Gessner Β© 2014.

More Repositories

1

JGProgressHUD

An elegant and simple progress HUD for iOS and tvOS, compatible with Swift and ObjC.
Objective-C
3,285
star
2

JGScrollableTableViewCell

A simple UITableViewCell subclass with a scrollable content view, exposing an accessory view when scrolled. Inspired by the iOS 7 mail app. Supports iOS 5+
Objective-C
196
star
3

JGDownloadAcceleration

Download acceleration for iOS. Based on NSURLConnection and NSOperation.
Objective-C
140
star
4

JGMethodSwizzler

Powerful and easy to use Objective-C swizzling API.
Objective-C
125
star
5

JGProgressHUD-SwiftUI

Easily show HUDs with SwiftUI! Lightweight SwiftUI wrapper for JGProgressHUD for iOS, tvOS, Catalyst.
Swift
99
star
6

JGProgressView

UIProgressView subclass with an animated "Indeterminate" setting (OS X Inspired)
Objective-C
52
star
7

ImageReducer

Drag & drop image reducer. Creates 2x and 1x images out of 3x images on the fly.
Objective-C
42
star
8

CCLoader

Developer utility for loading custom plugins into Control Center on iOS 7 and higher.
Objective-C
38
star
9

JGDetailScrubber

UISlider subclass with variable scrubbing speeds. Inspired by the iOS Music app.
Objective-C
35
star
10

Theos-NIC-Templates

Modern templates for NIC.
C
35
star
11

BrightnessFix

Restore Brightness after killing SpringBoard on iOS 6
Logos
8
star
12

Share-Widget-for-Control-Center

An example widget for Control Center. To be used with CCLoader
Objective-C
5
star
13

Theos-Install-Scripts

Useful scripts for theos projects to install packages via USB rather than SSH.
Python
5
star
14

Open-in-ProTube-2

Opens YouTube links directly in ProTube
Objective-C
4
star
15

SCION-WebRTC

Video Calls over SCION with advanced path control
Swift
4
star
16

SevenCenter

iOS 7 style NotificationCenter for iOS 5 & iOS 6
Logos
4
star
17

ETH-Algolab-2019

Solutions for the ETH Algorithms Lab problems for HS 2019
C++
3
star
18

BridgeConnect

Library for importing media using Bridge.
Objective-C
2
star
19

NoCarrier

Remove the carrier logo from the status bar on iOS.
C
2
star
20

Open-in-ProTube

Opens youtube URLs in ProTube app instead of YouTube app.
Objective-C
2
star
21

WebRTC

WebRTC builds for iOS and macOS that actually (hopefully) work...
C++
1
star
22

ascii85

macOS command line tool for ascii85 encoding and decoding
Swift
1
star
23

Flipswitch-Toggles

Additional switches for Flipswitch
C
1
star