{"id":20187359,"url":"https://github.com/wordpress-mobile/mediapicker-ios","last_synced_at":"2025-04-06T12:07:17.665Z","repository":{"id":25384108,"uuid":"28812505","full_name":"wordpress-mobile/MediaPicker-iOS","owner":"wordpress-mobile","description":"WPMediaPicker is an iOS controller that allows capture and picking of media assets.","archived":false,"fork":false,"pushed_at":"2025-03-05T08:43:01.000Z","size":2136,"stargazers_count":110,"open_issues_count":4,"forks_count":37,"subscribers_count":29,"default_branch":"trunk","last_synced_at":"2025-03-30T11:06:12.109Z","etag":null,"topics":["ios","media","photos","video"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wordpress-mobile.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-01-05T12:56:16.000Z","updated_at":"2025-03-05T08:20:10.000Z","dependencies_parsed_at":"2023-02-12T07:46:55.889Z","dependency_job_id":"b4870e29-580f-4287-a398-ad883b13be46","html_url":"https://github.com/wordpress-mobile/MediaPicker-iOS","commit_stats":{"total_commits":937,"total_committers":44,"mean_commits":"21.295454545454547","dds":0.623265741728922,"last_synced_commit":"759b819bea5160c3855e5b06337bb21aef6804c1"},"previous_names":[],"tags_count":111,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wordpress-mobile%2FMediaPicker-iOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wordpress-mobile%2FMediaPicker-iOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wordpress-mobile%2FMediaPicker-iOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wordpress-mobile%2FMediaPicker-iOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wordpress-mobile","download_url":"https://codeload.github.com/wordpress-mobile/MediaPicker-iOS/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478317,"owners_count":20945266,"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","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":["ios","media","photos","video"],"created_at":"2024-11-14T03:23:12.316Z","updated_at":"2025-04-06T12:07:17.638Z","avatar_url":"https://github.com/wordpress-mobile.png","language":"Objective-C","readme":"# WPMediaPicker\n\n[![Version](https://img.shields.io/cocoapods/v/WPMediaPicker.svg?style=flat)](http://cocoadocs.org/docsets/WPMediaPicker)\n[![License](https://img.shields.io/cocoapods/l/WPMediaPicker.svg?style=flat)](http://cocoadocs.org/docsets/WPMediaPicker)\n[![Platform](https://img.shields.io/cocoapods/p/WPMediaPicker.svg?style=flat)](http://cocoadocs.org/docsets/WPMediaPicker)\n\n⚠️ **The WPMediaFramework was decommissioned on Nov 27, 2023, and is no longer maintained.**\n\nWPMediaPicker is an iOS controller that allows capture and picking of media assets.\nIt allows:\n * Allows selection of multiple media objects in one go.\n * Capture of new media while inside the picker.\n * Use different data sources for the media library.\n * Switch between different albums.\n * Filtering by media types.\n * Preview of media (images and video) in full screen.\n * Show the media picker inside as a keyboard input view.\n * Super quick and memory optimized.\n * Allows horizontal and vertical scroll of assets.\n * Allows custom searching/filtering of assets. \n\n![Screenshot](screenshots_1.jpg \"Screenshot\")\n\n## Installation\n\nWPMediaPicker is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n```\npod \"WPMediaPicker\"\n```\n## Usage\n\nTo use the picker do the following:\n\n### Import header\n\n```` objective-c\n#import \u003cWPMediaPicker/WPMediaPicker.h\u003e\n````\n\n### Create and present the picker in modal mode\n\n```` objective-c\nWPNavigationMediaPickerViewController * mediaPicker = [[WPNavigationMediaPickerViewController alloc] init];\nmediaPicker.delegate = self;\n[self presentViewController:mediaPicker animated:YES completion:nil];\n````\n\n### Implement didFinishPickingAssets delegate\n\nThe delegate is responsible for dismissing the picker when the operation completes. To dismiss the picker, call the [dismissViewControllerAnimated:completion:](https://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/index.html#//apple_ref/occ/instm/UIViewController/dismissViewControllerAnimated:completion:) method of the presenting controller responsible for displaying the `WPNavigationMediaPickerController` object. Please refer to the demo app.\n\n```` objective-c\n- (void)mediaPickerController:(WPMediaPickerViewController *)picker didFinishPickingAssets:(NSArray\u003cWPMediaAsset\u003e *)assets\n{\n  [self dismissViewControllerAnimated:YES completion:nil];    \n}\n````\n\n### Other methods to display the picker\n\nThe example above shows the recommended way to show the picker in a modal. There are currently three available controllers to show the picker depending on your application needs:\n\n * [WPMediaPickerViewController](Pod/Classes/WPMediaPickerViewController.h), this is the base collection view controller that displays the media. It can be used inside other view controllers using containment.\n * [WPInputMediaPickerViewController](Pod/Classes/WPInputMediaPickerViewController.h), a wrapper of the WPMediaPickerController to be used as an inputView of an UIControl. \n * [WPNavigationMediaPickerViewController](Pod/Classes/WPNavigationMediaPickerViewController.h), a convenience wrapper of the `WPMediaPickerViewController` inside a UINavigationController to show in a modal context.\n\n### How to configure the appearance of the picker\n\nJust use the standard appearance methods from UIKit. Here is an example how to configure the main components\n\n```` objective-c\n//Configure navigation bar background color\n[[UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[[WPNavigationMediaPickerViewController class]]] setBarTintColor:[UIColor colorWithRed:0/255.0f green:135/255.0f blue:190/255.0f alpha:1.0f]];\n//Configure navigation bar items text color\n[[UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[[WPNavigationMediaPickerViewController class]]] setTintColor:[UIColor whiteColor]];\n//Configure navigation bar title text color\n[[UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[[WPNavigationMediaPickerViewController class]]] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor whiteColor]} ];\n//Configure background color for media scroll view\n[[UICollectionView appearanceWhenContainedInInstancesOfClasses:@[[WPMediaCollectionViewController class]]] setBackgroundColor:[UIColor colorWithRed:233/255.0f green:239/255.0f blue:243/255.0f alpha:1.0f]];\n//Configure background color for media cell while loading image.\n[[WPMediaCollectionViewCell appearanceWhenContainedInInstancesOfClasses:@[[WPMediaCollectionViewController class]]] setBackgroundColor:[UIColor colorWithRed:243/255.0f green:246/255.0f blue:248/255.0f alpha:1.0f]];\n//Configure color for activity indicator while loading media collection\n[[UIActivityIndicatorView appearanceWhenContainedInInstancesOfClasses:@[[WPMediaCollectionViewController class]]] setColor:[UIColor grayColor]];\n````\n\n### How to use a custom data source for the picker\n\nIf you have a custom database of media and you want to display it using the WPMediaPicker you need to implement the following protocols around your data:\n\n * [WPMediaCollectionDataSource](Pod/Classes/WPMediaCollectionDataSource.h)\n * [WPMediaGroup](Pod/Classes/WPMediaCollectionDataSource.h)\n * [WPMediaAsset](Pod/Classes/WPMediaCollectionDataSource.h)\n\nYou can view the protocols documentation for more implementation details. \nAfter you have implemented it you can use it by simple doing the following:\n\n```` objective-c\nself.customDataSource = [[WPCustomAssetDataSource alloc] init];\nmediaPicker.dataSource = self.customDataSource;\n````\n\n### Sample Project\n\nTo run the example project, clone the repo, and run `pod install` from the `Example` directory first.\n\n## Requirements\n\n * ARC \n * Photos, AVFoundation, ImageIO\n * XCode 10 or above\n * iOS 11 or above\n\n## Contributing\n\nRead our [Contributing Guide](CONTRIBUTING.md) to learn about reporting issues, contributing code, and more ways to contribute.\n\n## Getting in Touch\n\nIf you have questions about getting setup or just want to say hi, join the [WordPress Slack](https://chat.wordpress.org) and drop a message on the `#mobile` channel.\n\n## Author\n\nWordPress, mobile@automattic.com\n\n## License\n\nWPMediaPicker is available under the GPL license. See the [LICENSE file](./LICENSE) for more info.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwordpress-mobile%2Fmediapicker-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwordpress-mobile%2Fmediapicker-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwordpress-mobile%2Fmediapicker-ios/lists"}