https://github.com/thoughtbot/bean
Simplify documents
https://github.com/thoughtbot/bean
documents ios swift swiftpackage
Last synced: about 1 year ago
JSON representation
Simplify documents
- Host: GitHub
- URL: https://github.com/thoughtbot/bean
- Owner: thoughtbot
- License: mit
- Archived: true
- Created: 2020-02-07T17:20:06.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2021-09-24T16:16:09.000Z (over 4 years ago)
- Last Synced: 2025-03-14T15:49:18.879Z (about 1 year ago)
- Topics: documents, ios, swift, swiftpackage
- Language: Swift
- Size: 1.8 MB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bean [](https://circleci.com/gh/thoughtbot/Bean) [](https://swift.org/package-manager/) [](https://github.com/Carthage/Carthage)
A library that simplifies the way you deal with documents
## Requirements
- iOS 13.0 or later
- Swift 4.0 or later
## Supported Files
- Image
- Video
- Audio
- Text
## Installation
### [SwiftPM]
[SwiftPM]: https://github.com/apple/swift-package-manager
In Xcode: File > Swift Packages > Add Package Dependency
Paste: https://github.com/thoughtbot/Bean.git
## Usage
A Bean is a subclass of UIDocument that is returned after documents are selected
### Conforming to DocumentPickable
```swift
class ViewController: UIViewController, DocumentPickable {
```
### Present document picker
```swift
self.pickDocuments()
```
### Respond to protocal method
```swift
func didPickDocument(document: Bean?) {
// handle the bean
}
```
### Preview a bean
```swift
self.presentPreview(document: Bean)
```
## License
Bean is Copyright © 2020 Abe Mangona and thoughtbot. It is free
software, and may be redistributed under the terms specified in the
[LICENSE](/LICENSE) file.
### About thoughtbot

Bean is maintained and funded by thoughtbot, inc.
The names and logos for thoughtbot are trademarks of thoughtbot, inc.
We love open source software!
See [our other projects][community] or
[hire us][hire] to design, develop, and grow your product.
[community]: https://thoughtbot.com/community?utm_source=github
[hire]: https://thoughtbot.com/hire-us?utm_source=github