https://github.com/4catalyzer/react-native-countdown-picker
A wrapper on top of ActionSheetPicker-3.0 for displaying countdown timer in an actionsheet
https://github.com/4catalyzer/react-native-countdown-picker
Last synced: about 1 month ago
JSON representation
A wrapper on top of ActionSheetPicker-3.0 for displaying countdown timer in an actionsheet
- Host: GitHub
- URL: https://github.com/4catalyzer/react-native-countdown-picker
- Owner: 4Catalyzer
- Created: 2016-02-08T18:28:22.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-10-26T10:54:42.000Z (over 4 years ago)
- Last Synced: 2024-08-10T11:52:25.771Z (10 months ago)
- Language: Objective-C
- Size: 4.88 KB
- Stars: 5
- Watchers: 5
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-countdown-picker
A wrapper on top of [ActionSheetPicker-3.0](https://github.com/skywinder/ActionSheetPicker-3.0) for displaying countdown timer in an actionsheet
### Installation
```bash
npm i --save react-native-countdown-picker
```You need CocoaPods to install `ActionSheetPicker-3.0`.
To integrate ActionSheetPicker-3.0 into your Xcode project using CocoaPods, specify it in your `Podfile`:```ruby
pod 'ActionSheetPicker-3.0'
```Then, run the following command:
```bash
$ pod install
```### Add it to your iOS project
1. Run `npm install react-native-countdown-picker --save`
2. Open your project in XCode, right click on `Libraries` and click `Add
Files to "Your Project Name"` [(Screenshot)](http://url.brentvatne.ca/jQp8) then [(Screenshot)](http://url.brentvatne.ca/1gqUD).
3. Add `libCJCountDownPicker.a` to `Build Phases -> Link Binary With Libraries`
[(Screenshot)](http://url.brentvatne.ca/17Xfe).
4. Whenever you want to use it within React code now you can: `var CountDownPicker = require('NativeModules').CountDownPicker;`## Example
```javascript
var CountDownPicker = require('NativeModules').CJCountDownPicker;var ExampleApp = React.createClass({
showPicker: function() {
CountDownPicker.showCountDownPickerWithOptions({
title: 'show', //optional
countDownDuration: '' //optional intial time
}, (cancelled, duration) => {
if(cancelled) {
AlertIOS.alert('Error', 'select a time');
}
//duration is in seconds.
});
},
render: function() {
return (
);
}
});
```