Photo Picker supporting multiple selections and UI customizations. Designed for iOS 8 with Photo framework ( PhotoKit )
https://github.com/guillermomuntaner/GMImagePicker
- Allows selection of multiple photos
and videosTODO, even from different albums. - Optional single selection mode.
- Optional camera access.
- Optional bottom toolbar with information about users selection.
- Full and customizable acces to smart collections(Favorites, Slo-mo or Recently deleted).
- Filter by collections & albums.
- Filter by media type.
- Customizable colors, fonts and labels to ease branding of the App.
- By default mimics UIImagePickerController in terms of features, appearance and behaviour.
- Dynamically sized grid view, easy to customize and fully compatible with iPhone 6/6+ and iPad.
- Works in landscape orientation and allow screen rotation!
It can be used as Popover on iPad, with customizable size.TODO- Fast & small memory footprint powered by PHCachingImageManager.
- Full adoption of new iOS8 PhotoKit. Returns and array of PHAssets.
<ios>
<plist>
<dict>
<key>NSPhotoLibraryUsageDescription</key>
<string>Access media in Photos</string>
</dict>
</plist>
</ios>
var picker = require('ti.gmimagepicker');
var sv;
(function() {
var w = Ti.UI.createWindow({ layout: 'vertical' });
var btn = Ti.UI.createButton({ title: 'Pick Photos', backgroundColor: 'blue', tintColor: 'white', width: 120, top: 60 });
btn.addEventListener('click', showGMImagePicker);
sv = Ti.UI.createScrollableView({ showPagingControl: true, backgroundColor: 'grey' });
w.add(btn);
w.add(sv);
w.open();
})();
function showGMImagePicker() {
sv.removeAllChildren();
picker.openPhotoGallery({
maxSelectablePhotos: 10,
// allowMultiple: false, // default is true
success: function (e) {
Ti.API.error('success: ' + JSON.stringify(e));
renderPhotos(e.media);
},
cancel: function (e) {
Ti.API.error('cancel: ' + JSON.stringify(e));
},
error: function (e) {
Ti.API.error('error: ' + JSON.stringify(e));
}
});
}
function renderPhotos(media) {
var views = [];
for (var i=0; i < media.length; i++) {
views.push( Ti.UI.createImageView({ image: media[i], width: '100%', height: Ti.UI.SIZE }) );
};
sv.setViews(views);
}
Xcode 6 and iOS 8.
Copyright (c) 2016 Minh Nguyen