GithubHelp home page GithubHelp logo

runt18 / jgactionsheet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jonasgessner/jgactionsheet

0.0 2.0 0.0 569 KB

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

License: MIT License

Objective-C 98.87% Ruby 1.13%

jgactionsheet's Introduction

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.

jgactionsheet's People

Contributors

jonasgessner avatar paynechu avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.