Eko's Custom Action Sheet Controller for iOS
EkoActionSheetController requires iOS 8.0 or later.
- Drag the code itself (Source folder) to your project.
- Make sure that the files are added to the Target membership.
Using Carthage
-
Add the
EkoCommunications/EkoActionSheetController
project to your Cartfile.github "EkoCommunications/EkoActionSheetController"
-
Run
carthage update
, then follow the additional steps required to add the iOS and/or Mac frameworks into your project.
Import framework.
@import EkoActionSheetController;
Just create EkoActionSheetItem instances and pass them to EkoActionSheetController
- (IBAction)onButtonTouch:(UIButton *)sender
{
EkoActionSheetItem *item1 = [EkoActionSheetItem itemWithTitle:@"iOS"
handler:^(EkoActionSheetItem * _Nonnull item, UIViewController * _Nonnull actionSheetViewController)
{
itemActionHandler(item.title, item.image, actionSheetViewController);
}];
EkoActionSheetItem *item2 = [EkoActionSheetItem itemWithTitle:@"Android"
handler:^(EkoActionSheetItem * _Nonnull item, UIViewController * _Nonnull actionSheetViewController)
{
itemActionHandler(item.title, item.image, actionSheetViewController);
}];
[EkoActionSheetViewController presentOnViewController:self
items:@[item1, item2]
headerBackgroundColor:[UIColor purpleColor]
separatorLineColor:[UIColor purpleColor]
title:@"Select OS"
cancelItem:nil
applyItem:nil];
}
Build and run the EkoActionSheet Example
project in Xcode to see EkoActionSheetController
in action.