Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seivan/SHActionSheetBlocks
Prefixed UIActionSheet category with blocks, auto-removed. Swizzle free!
https://github.com/seivan/SHActionSheetBlocks
Last synced: 3 months ago
JSON representation
Prefixed UIActionSheet category with blocks, auto-removed. Swizzle free!
- Host: GitHub
- URL: https://github.com/seivan/SHActionSheetBlocks
- Owner: seivan
- License: mit
- Created: 2013-07-05T00:33:32.000Z (over 11 years ago)
- Default Branch: develop
- Last Pushed: 2016-12-09T20:39:24.000Z (almost 8 years ago)
- Last Synced: 2024-07-23T09:32:54.436Z (4 months ago)
- Language: Objective-C
- Size: 2.92 MB
- Stars: 60
- Watchers: 7
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
Deprecated, please use [RxCocoa](https://github.com/ReactiveX/RxSwift)
SHActionSheetBlocks
==========
[![CI Status](https://img.shields.io/travis/seivan/SHActionSheetBlocks.svg?style=flat)](https://travis-ci.org/seivan/SHActionSheetBlocks)
[![Version](https://img.shields.io/cocoapods/v/SHActionSheetBlocks.svg?style=flat)](http://cocoadocs.org/docsets/SHActionSheetBlocks)
[![Platform](https://img.shields.io/cocoapods/p/SHActionSheetBlocks.svg?style=flat)](http://cocoadocs.org/docsets/SHActionSheetBlocks)
[![License](https://img.shields.io/cocoapods/l/SHActionSheetBlocks.svg?style=flat)](http://cocoadocs.org/docsets/SHActionSheetBlocks)> This pod is used by [`SHUIKitBlocks`](https://github.com/seivan/SHUIKitBlocks) as part of many components covering to plug the holes missing from Foundation, UIKit, CoreLocation, GameKit, MapKit and other aspects of an iOS application's architecture.
Overview
--------
The blocks are automatically removed once the sheet is gone, so it isn't necessary to clean up - Swizzle Free(™)### API
#### [Init](#init-1)
#### [Add](#add-1)
#### [Properties](#properties-1)
Installation
------------```ruby
pod 'SHActionSheetBlocks'
```***
Setup
-----Put this either in specific files or your project prefix file
```objective-c
#import "UIActionSheet+SHActionSheetBlocks.h"
```
or```objective-c
#import "SHActionSheetBlocks.h"
```API
-----### Init
```objective-c
#pragma mark -
#pragma mark Init
+(instancetype)SH_actionSheetWithTitle:(NSString *)theTitle;+(instancetype)SH_actionSheetWithTitle:(NSString *)theTitle
buttonTitles:(id)theButtonTitles
cancelTitle:(NSString *)theCancelTitle
destructiveTitle:(NSString *)theDestructiveTitle
withBlock:(SHActionSheetBlock)theBlock;```
### Add
```objective-c
#pragma mark -
#pragma mark Adding
-(NSInteger)SH_addButtonWithTitle:(NSString *)theTitle
withBlock:(SHActionSheetBlock)theBlock;///Will add a new destructive button and make previous Destructive buttons to normal
-(NSInteger)SH_addButtonDestructiveWithTitle:(NSString *)theTitle
withBlock:(SHActionSheetBlock)theBlock;///Will add a new destructive button and make previous Destructive buttons to normal
-(NSInteger)SH_addButtonCancelWithTitle:(NSString *)theTitle
withBlock:(SHActionSheetBlock)theBlock;```
### Properties
```objective-c
#pragma mark -
#pragma mark Properties#pragma mark -
#pragma mark Setters
-(void)SH_setButtonBlockForIndex:(NSInteger)theButtonIndex
withBlock:(SHActionSheetBlock)theBlock;-(void)SH_setButtonDestructiveBlock:(SHActionSheetBlock)theBlock;
-(void)SH_setButtonCancelBlock:(SHActionSheetBlock)theBlock;-(void)SH_setWillShowBlock:(SHActionSheetShowBlock)theBlock;
-(void)SH_setDidShowBlock:(SHActionSheetShowBlock)theBlock;-(void)SH_setWillDismissBlock:(SHActionSheetDismissBlock)theBlock;
-(void)SH_setDidDismissBlock:(SHActionSheetDismissBlock)theBlock;#pragma mark -
#pragma mark Getters
-(SHActionSheetBlock)SH_blockForButtonIndex:(NSInteger)theButtonIndex;@property(nonatomic,readonly) SHActionSheetBlock SH_blockForDestructiveButton;
@property(nonatomic,readonly) SHActionSheetBlock SH_blockForCancelButton;@property(nonatomic,readonly) SHActionSheetShowBlock SH_blockWillShow;
@property(nonatomic,readonly) SHActionSheetShowBlock SH_blockDidShow;@property(nonatomic,readonly) SHActionSheetDismissBlock SH_blockWillDismiss;
@property(nonatomic,readonly) SHActionSheetDismissBlock SH_blockDidDismiss;```
Contact
-------If you end up using SHActionSheetBlocks in a project, I'd love to hear about it.
email: [[email protected]](mailto:[email protected])
twitter: [@seivanheidari](https://twitter.com/seivanheidari)## License
SHActionSheetBlocks is © 2013 [Seivan](http://www.github.com/seivan) and may be freely
distributed under the [MIT license](http://opensource.org/licenses/MIT).
See the [`LICENSE.md`](https://github.com/seivan/SHActionSheetBlocks/blob/master/LICENSE.md) file.