{"id":1803,"url":"https://github.com/RxSwiftCommunity/RxMediaPicker","last_synced_at":"2025-08-02T04:32:33.750Z","repository":{"id":54511625,"uuid":"51183483","full_name":"RxSwiftCommunity/RxMediaPicker","owner":"RxSwiftCommunity","description":"A reactive wrapper built around UIImagePickerController.","archived":false,"fork":false,"pushed_at":"2021-02-14T13:31:52.000Z","size":74,"stargazers_count":182,"open_issues_count":12,"forks_count":61,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-08-01T06:19:13.261Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RxSwiftCommunity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-06T00:54:43.000Z","updated_at":"2025-06-12T10:46:06.000Z","dependencies_parsed_at":"2022-08-13T18:10:59.263Z","dependency_job_id":null,"html_url":"https://github.com/RxSwiftCommunity/RxMediaPicker","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/RxSwiftCommunity/RxMediaPicker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxMediaPicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxMediaPicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxMediaPicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxMediaPicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RxSwiftCommunity","download_url":"https://codeload.github.com/RxSwiftCommunity/RxMediaPicker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxMediaPicker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268334618,"owners_count":24233793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:15:56.175Z","updated_at":"2025-08-02T04:32:33.491Z","avatar_url":"https://github.com/RxSwiftCommunity.png","language":"Swift","funding_links":[],"categories":["Reactive Programming","Libraries"],"sub_categories":["Other free courses","Prototyping","Other Parsing"],"readme":"# RxMediaPicker\n\nRxMediaPicker is a RxSwift wrapper built around UIImagePickerController consisting in a simple interface for common actions like picking photos or videos stored on the device, recording a video or taking a photo.\n\n![Swift](https://img.shields.io/badge/Swift-4.2-orange.svg)\n[![Version](https://img.shields.io/cocoapods/v/RxMediaPicker.svg?style=flat)](http://cocoapods.org/pods/RxMediaPicker)\n[![License](https://img.shields.io/cocoapods/l/RxMediaPicker.svg?style=flat)](http://cocoapods.org/pods/RxMediaPicker)\n[![Platform](https://img.shields.io/cocoapods/p/RxMediaPicker.svg?style=flat)](http://cocoapods.org/pods/RxMediaPicker)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\nIf you ever used UIImagePickerController you know how it can become quite verbose and introduce some unnecessary complexity, as you use the same class to do everything, from picking photos or videos from the library, recording videos, etc. At the same time, you have all these different properties and methods which can be used when you are dealing with photos, others for when you're dealing with videos, and others in all cases.\n\nIf you're interested, check the resulting article [RxMediaPicker — picking photos and videos the cool kids’ way!](https://medium.com/@ruipfcosta/rxmediapicker-picking-photos-and-videos-the-cool-kids-way-4df81df0c778#.1wq0xp99o)\n\n**Note:** As RxMediaPicker is still in its early days, the interface may change in future versions. \n\n## Features\n\n- [x] Reactive wrapper built around UIImagePickerController.\n- [x] Provides an interface for common operations like picking photos from the library, recording videos, etc.\n- [x] Handles edited videos properly - something UIImagePickerController doesn't do for you!\n- [x] Decouples the typical UIImagePickerController boilerplate from your code.\n- [x] Reduces the complexity when compared to UIImagePickerController.\n- [x] Easy to integrate and reuse accross your app.\n\n## Example\n\nFor a more complete example please check the demo app included (ideally run it on a device). This is how you would record a video using the camera:\n\n```swift\nimport RxMediaPicker\nimport RxSwift\n\nvar picker: RxMediaPicker!\nlet disposeBag = DisposeBag()\n\noverride func viewDidLoad() {\n    super.viewDidLoad()\n    picker = RxMediaPicker(delegate: self)\n}\n\nfunc recordVideo() {\n    picker.recordVideo(maximumDuration: 10, editable: true)\n        .observeOn(MainScheduler.instance)\n        .subscribe(onNext: { url in\n            // Do something with the video url obtained!\n        }, onError: { error in\n            print(\"Error occurred!\")\n        }, onCompleted: {\n            print(\"Completed\")\n        }, onDisposed: {\n            print(\"Disposed\")\n        })\n        .disposed(by: disposeBag)\n}\n```\n\n## Usage\n\n### Available operations\n\nBased on their names, the operations available on RxMediaPicker should be self-explanatory. You can record a video, or pick an existing one stored on the device, and the same thing happens for photos. The only thing to note here is that picking a video will get you the video url, and picking a photo will get you a tuple consisting in the original image and an optional edited image (if any edits were made).\n\n```swift\nfunc recordVideo(device: UIImagePickerController.CameraDevice = .rear, \n                 quality: UIImagePickerController.QualityType = .typeMedium, \n                 maximumDuration: TimeInterval = 600,\n                 editable: Bool = false) -\u003e Observable\u003cURL\u003e\n```\n\n```swift\nfunc selectVideo(source: UIImagePickerController.SourceType = .photoLibrary, \n                 maximumDuration: TimeInterval = 600,\n                 editable: Bool = false) -\u003e Observable\u003cURL\u003e\n```\n\n```swift\nfunc takePhoto(device: UIImagePickerController.CameraDevice = .rear, \n               flashMode: UIImagePickerController.CameraFlashMode = .auto, \n               editable: Bool = false) -\u003e Observable\u003c(UIImage, UIImage?)\u003e\n```\n\n```swift\nfunc selectImage(source: UIImagePickerController.SourceType = .photoLibrary, \n                 editable: Bool = false) -\u003e Observable\u003c(UIImage, UIImage?)\u003e\n```\n\n### RxMediaPickerDelegate\n\n```swift\nfunc present(picker: UIImagePickerController)\nfunc dismiss(picker: UIImagePickerController) \n```\n\nTo be able to use RxMediaPicker you will need to adopt the protocol RxMediaPickerDelegate. This is required to indicate RxMediaPicker how the camera/photos picker should be presented. For example, you may want to present the photos library picker in a popover on the iPad, and use the entire screen on the iPhone.\n\n\n## Requirements\n\n* iOS 8.0+\n* Xcode 7.0+\n\n## Instalation\n\n### CocoaPods\n\n[CocoaPods](https://cocoapods.org/) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\nTo integrate RxMediaPicker into your Xcode project using CocoaPods, include this in your Podfile:\n\n```ruby\nplatform :ios, '8.0'\nuse_frameworks!\n\npod 'RxMediaPicker'\n```\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with [Homebrew](http://brew.sh/) using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate RxMediaPicker into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"RxSwiftCommunity/RxMediaPicker\" \"master\"\n```\n\nRun `carthage` to build the framework and drag the built `RxMediaPicker.framework` into your Xcode project.\n\n### [Swift Package Manager](https://github.com/apple/swift-package-manager)\n\nCreate a `Package.swift` file.\n\n```swift\n// swift-tools-version:5.0\n\nimport PackageDescription\n\nlet package = Package(\n  name: \"YOUR_PROJECT_NAME\",\n  dependencies: [\n    .package(url: \"https://github.com/RxSwiftCommunity/RxMediaPicker.git\", from: \"2.0.0\")\n  ],\n  targets: [\n    .target(name: \"YOUR_PROJECT_NAME\", dependencies: [\"RxMediaPicker\"])\n  ]\n)\n```\n\n## Credits\n\nOwned and maintained by Rui Costa ([@ruipfcosta](https://twitter.com/ruipfcosta)). \n\n## Contributing\n\nBug reports and pull requests are welcome.\n\n## License\n\nRxMediaPicker is released under the MIT license. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRxSwiftCommunity%2FRxMediaPicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRxSwiftCommunity%2FRxMediaPicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRxSwiftCommunity%2FRxMediaPicker/lists"}