Latest 1.0.0
Homepage https://github.com/winsonGali/YSActionsheet
License MIT
Platforms ios 7.0
Frameworks UIKit
Authors

效果图

YSActionsheet

使用方法:

  • block

    YSActionSheet *actionSheet = [[YSActionSheet alloc] initWithButtonTitles:@[@"拍照", @"从相册选取"] cancelButtonTitle:@"取消"];
    actionSheet.selectBlock = ^(NSInteger selectIndex, NSString *selectStr) {
    if (selectIndex == 0) {
    //拍照
    _desLB.text = @"你点击了拍照";
    }
    if (selectIndex == 1) {
    //从相册选取
    _desLB.text = @"你点击了从相册选取";
    }
    };
    [actionSheet show];
  • delegate

    1. 遵循协议<YSActionSheetDelegate>
    2. 弹出 YSActionSheet
      YSActionSheet *actionSheet = [[YSActionSheet alloc] initWithButtonTitles:@[@"拍照", @"从相册选取"] cancelButtonTitle:@"取消"];
      actionSheet.delegate = self;
      [actionSheet show];
    3. 实现协议
  • (void)ysActionSheet:(YSActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)index {
    if (index == 0) {
    //拍照
    _desLB.text = @"你点击了拍照";
    }
    if (index == 1) {
    //从相册选取
    _desLB.text = @"你点击了从相册选取";
    }
    }

Latest podspec

{
    "name": "YSActionsheet",
    "version": "1.0.0",
    "summary": "A bottom actionsheet like WeChat",
    "homepage": "https://github.com/winsonGali/YSActionsheet",
    "authors": {
        "winsonGali": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "source": {
        "git": "https://github.com/winsonGali/YSActionsheet.git",
        "tag": "1.0.0"
    },
    "source_files": [
        "YSActionsheetDemo/YSActionSheet",
        "YSActionsheetDemo/YSActionSheet/**/*.{h,m}"
    ],
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This