0.0.1 • Published 8 years ago

react-native-simple-action-sheet-ios v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

SimpleActionSheetIOS

Handy wrapper for react-native ActionSheetIOS.

ActionSheetIOS.showActionSheetWithOptions has inconvenient API:

ActionSheetIOS.showActionSheetWithOptions({
    options: [
        'button1',
        'button2',
        'button3',
    ],
    cancelButtonIndex: 2,
    destructiveButtonIndex: 0
}, (buttonIndex) => {
    if (buttonIndex === 0) {
        // do something...    
    } else if (buttonIndex === 1) {
        // do something...
    }
})

SimpleActionSheetIOS simplifies this API

import simpleActionSheetIOS from 'react-native-simple-action-sheet-ios';

simpleActionSheetIOS({
    options: [
        { title: 'button1', callback: myFn1, isDestructive: true },
        { title: 'button2', callback: myFn2 },
        { title: 'button3', callback: myFn3, isCancel: true },
    ]
});