Now I fixed most of the things and merge PR' (thanks to ).
I did much work to support this library from iOS 5. (and till iOS 13 and we keep going) π
Regards, Petr Korolev
Please welcome: ActionSheetPicker-3.0!
Well, that's how it started. Now, the following is more accurate:
Easily present an ActionSheet with a PickerView, allowing the user to select from a number of immutable options.
There are 4 distinct picker view options:
ActionSheetStringPicker
ActionSheetDistancePicker
ActionSheetDatePicker
ActionSheetCustomPicker
We'll focus here on how to use the ActionSheetStringPicker
since it's most likely the one you want to use.
For detailed info about customizations, please look BASIC USAGE
For detailed examples, please check Example Projects in this repo.
Swift
ActionSheetMultipleStringPicker.show(withTitle: "Multiple String Picker", rows: [
["One", "Two", "A lot"],
["Many", "Many more", "Infinite"]
], initialSelection: [2, 2], doneBlock: {
picker, indexes, values in
print("values = \(values)")
print("indexes = \(indexes)")
print("picker = \(picker)")
return
}, cancel: { ActionMultipleStringCancelBlock in return }, origin: sender)
Objective-C
// Inside a IBAction method:
// Create an array of strings you want to show in the picker:
NSArray *colors = @[@"Red", @"Green", @"Blue", @"Orange"];
// Done block:
ActionStringDoneBlock done = ^(ActionSheetStringPicker *picker, NSInteger selectedIndex, id selectedValue) {
NSLog(@"Picker: %@", picker);
NSLog(@"Selected Index: %@", @(selectedIndex));
NSLog(@"Selected Value: %@", selectedValue);
};
// cancel block:
ActionStringCancelBlock cancel = ^(ActionSheetStringPicker *picker) {
NSLog(@"Block Picker Canceled");
};
// Run!
[ActionSheetStringPicker showPickerWithTitle:@"Select a Color" rows:colors initialSelection:0 doneBlock:done cancelBlock:cancel origin:sender];
pod 'ActionSheetPicker-3.0'
(iOS 5.1.1-13.x compatible!)
CocoaPods is a dependency manager for Cocoa projects.
You can install it with the following command:
gem install cocoapods
To integrate ActionSheetPicker-3.0 into your Xcode project using CocoaPods, specify it in your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
pod 'ActionSheetPicker-3.0'
Then, run the following command:
pod install
To import pod you should add string:
Obj-c
projects: #import "ActionSheetPicker.h"
Swift
projects: import ActionSheetPicker_3_0
Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.
You can install Carthage with Homebrew using the following command:
brew update
brew install carthage
To integrate ActionSheetPicker-3.0 into your Xcode project using Carthage, specify it in your Cartfile
:
github "skywinder/ActionSheetPicker-3.0"
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into Xcode and the Swift compiler.
If you are using Xcode 11 or later:
File
Swift Packages
Add Package Dependency...
https://github.com/skywinder/ActionSheetPicker-3.0
If you prefer not to use either of the aforementioned dependency managers, you can integrate ActionSheetPicker-3.0 into your project manually.
The "old school" way is manually added to your project all from Pickers folder.
cd
-ing into your top-level project directory, and entering the following command:git submodule add https://github.com/skywinder/ActionSheetPicker-3.0.git
ActionSheetPicker-3.0
folder, and drag CoreActionSheetPicker.xcodeproj
into the file navigator of your app project.CoreActionSheetPicker.framework
.+
button at the top left of the panel and select "New Copy Files Phase". Rename this new phase to "Copy Frameworks", set the "Destination" to "Frameworks", and add CoreActionSheetPicker.framework
.open ActionSheetPicker-3.0.xcworkspace
Here is 3 projects:
iOS 8
)ActionSheetPicker
project)
If you've used this project in a live app, please let me know! Nothing makes me happier than seeing someone else take my work and go wild with it.
If you are using ActionSheetPicker-3.0
in your app or know of an app that uses it, please add it to this list.
Now I fixed most of the things and merge PR' (thanks to !).
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Bug reports, feature requests, patches, well-wishes, and rap demo tapes are always welcome.
We have a Discord channel where discuss about new ideas and implementation. Feel free to join and discuss with us!
You can join our Discord using this link.
ActionSheetPicker was originally created by Tim Cinel (@TimCinel) Since the Tim's repo is not support iOS 7+, I forked from his repo and implement iOS 7-8 support, and also a bunch of UI fixes, crash-fixes, and different customization abilities.
And most of all, thanks to ActionSheetPicker-3.0's growing list of contributors.
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
link |
Stars: 3398 |
Last commit: 5 weeks ago |
Full Changelog: https://github.com/skywinder/ActionSheetPicker-3.0/compare/2.7.3...2.7.4
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics