FDTake
Easily take a photo or video or choose from library
Usage
To run the example project, clone the repo, and run pod install
from the Example directory first.
To use it in your project, add an FDTakeController
to your view controller and implement:
fdTakeController.didGetPhoto = {
(_ photo: UIImage, _ info: [AnyHashable : Any]) in
}
then call:
fdTakeController.present()
The full API is:
Other available options are documented at CocoaDocs for FDTake.
How it works
- See if device has camera
- Create action sheet with appropriate options ("Take Photo" or "Choose from Library"), as available
- Localize "Take Photo" and "Choose from Library" into user's language
- Wait for response
- Bring up image picker with selected image picking method
- Default to selfie mode if so configured
- Get response, extract image from a dictionary
- Dismiss picker, send image to delegate
Support
- Supports iPhones, iPods, iPads and tvOS (but not tested)
- Supported languages:
- English
- Chinese Simplified
- Turkish (thanks Suleyman Melikoglu)
- French (thanks Guillaume Algis)
- Dutch (thanks Mathijs Kadijk)
- Chinese Traditional (thanks Qing Ao)
- German (thanks Lars Häuser)
- Russian (thanks Alexander Zubkov)
- Norwegian (thanks Sindre Sorhus)
- Arabic (thanks HadiIOS)
- Polish (thanks Jacek Kwiecień)
- Spanish (thanks David Jorge)
- Hebrew (thanks Asaf Siman-Tov)
- Danish (thanks kaspernissen)
- Sweedish (thanks Paul Peelen)
- Portugese (thanks Natan Rolnik)
- Greek (thanks Konstantinos)
- Italian (thanks Giuseppe Filograno)
- Hungarian (thanks Andras Kadar)
- Please help translate
FDTake.strings
to more languages
- Pure Swift support and iOS 8+ required
- Compile testing running on Travis CI
- In progress: functional test cases (please help)
- In progress: UI test cases (please help)
Installation
Add this to your project using Swift Package Manager. In Xcode that is simply: File > Swift Packages > Add Package Dependency... and you're done. Alternative installation options are shown below for legacy projects.
CocoaPods
If you are already using CocoaPods, just add 'FDTake' to your Podfile
then run pod install
.
Carthage
If you are already using Carthage, just add to your Cartfile
:
Then run carthage update
to build the framework and drag the built FDTake
.framework into your Xcode project.
Author
William Entriken, github.com@phor.net
Project scope
This is a mature project and we do not expect to add new features unless something has already become state-of-the-art in other applications. Please be prepared to cite screenshots of other apps before making a feature request.
We support targets for the latest released versions of Xcode, Carthage, CocoaPods and Swift Package Manager. If there are incompatabilities, for example CocoaPods not supporting the latest version of Xcode, then we will only support the latest released versions/combinations that are supported. If you would like to support pre-release versions of these packages, please open a pull request, not an issue.
License
FDTake is available under the MIT license. See the LICENSE file for more info.