1and2papa / ctassetspickercontroller Goto Github PK
View Code? Open in Web Editor NEWiOS control that allows picking multiple photos and videos from user's photo library.
License: MIT License
iOS control that allows picking multiple photos and videos from user's photo library.
License: MIT License
If no photo has been selected and I pressed Done button , it will crashed.
I think it is better to make "Done" button not enabled until the minimum number of Photos is met and then activate "Done".
Maybe also make "Cancel" instead of "Done" before the minimum is met.
Can I select more than 10 image?
It didn't help:
What ever i do i cant seem to change the navigation bar color?
Where do i need to put the code for that?
Hello, I suggest to use a separate file for the location eg. CTAssetsPicketController.string and add a property for the colors used (fonts and buttons).
thanks for you work!
m.
Sort and group assets by date just similar to 'Moments' of Photos.app
When using a global setting for the text appearance in UIBarButtonItem
, the bottom toolbar ignores the setting. For example when setting:
[[UIBarButtonItem appearance] setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10], NSForegroundColorAttributeName: [UIColor whiteColor]} forState:UIControlStateNormal];
The bottom toolbar will still be black, due to these lines of code.
Change the picker to a container view controller rather than a navigation controller.
I am using this control mostly successfully, however, I can only see the photos which are in "Albums", I don't see the Photos which are in "Photos".
The control is only showing me "Recently Added", "Favorites", "Panoramas", "Videos", "Bursts". The total # of photos in these albums is about 150. However, I have close to 3,000 photos on my phone and they are accessible from the native Photos app using the "Moments" tab.
Could it be that the missing photos are not associated with an album?
Surprised to see no one else mentioned this..
I am using the latest master version.
If I have the filter set to "videos" only, the group thumbnail should not use a photo as a thumbnail
Allows the picker to initially show the content of default assets group (e.g. Camera roll) instead of a list of albums
While you may find having 10 different classes in one file cute, it makes for a hell of a time trying to make any updates or changes.
Please refactor this into separate classes for the love of god.
If we restrict the user can select only one, is there no need to display the selection markers and the Done button?
We should immediately dismiss the controller and callback when user selects one picture or video.
Whether it would be better to do so?
So I mean, this library does not seem to support the radio mode.
Using the generic iOS7 methods to hide the status bar, it shows back up.
How would I hide it in the full size image view?
UPDATE:
Ok I found the code for the hiding actions, but it doesn't appear to be working on iOS 7.
I can get it to hide, but it just shows right back up.
Hi,
At first, thank you for making the CTAssetsPickerController! ;)
I want to disable the selection of videos in my camera roll! I already tried to remove the shouldEnableAssetForSelection boolean and return the shouldEnableAssetForSelection to FALSE, but nothing seems to work.
Could you explain to me why these solutions doesn't work?!
Thankyou!
I've add CTAssetsPickerController in my Project. And i have a few errors in CTAssetsPickerConstants.h:
/CTAssetsPickerController/CTAssetsPickerConstants.h:29:8: Unknown type name 'CGFloat'
/CTAssetsPickerController/CTAssetsPickerConstants.h:29:16: Expected identifier or '('
/CTAssetsPickerController/CTAssetsPickerConstants.h:31:15: Expected identifier or '('
@ NSDate+TimeInterval.m line:53
change:
NSInteger roundedSeconds = lround(timeInterval - (components.hour * 60) - (components.minute * 60 * 60));
To:
NSInteger roundedSeconds = lround(timeInterval - (components.hour * 60 * 60) - (components.minute * 60));
I don't Pull Request.
When selecting an album after the album after all the albums are shown in iOS < 7.0 (in my case was using an iPhone 5 with iOS 6.1.3) there is a crash in the CTAssetsPickerController.m in line 907, because using the selector sizeWithAttributes:
I checked and noticed you are using this macro:
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
but actually that macro is not validating if the current version of the iOS is 7 or lower, i think you guys should use __IPHONE_OS_VERSION_MIN_REQUIRED
Update data type for optimising 64bit processor. Experiment code attached. 526c479
Tester required. Anyone have iPhone 5s please help to verify.
This delegate method allows hiding unwanted assets.
Hey!
It would be awesome to choose the camera as a source to pick a photo or shoot a video. Any plans on including such a feature?
-- HS
Hi,
When a user attempt to select more than the allow Max Selection, is it possible to show a alert message or some overlay message?
Hello,
First of all good work!
I am having a small issue:
could you please tell me why it is not possible to select some videos? (white overlay on top of them)
Thanks
This property allows hiding the number of assets under the group name.
Application crash on iphone4 when select a album, with error
-[__NSDate doubleValue]: unrecognized selector sent to instance 0x1578b9b0
Hi,
I use cocoapods pod 'CTAssetsPickerController', '~> 1.2.0'
when i open to choose photos, it crash at line 752 in "CTAssetsPickerController.m"
self.title = [NSDate timeDescriptionOfTimeInterval:[[asset valueForProperty:ALAssetPropertyDuration] doubleValue]];
i saw [asset valueForProperty:ALAssetPropertyDuration] return ALErrorInvalidProperty, not a string can parse to double.
Please help!
Would be nice if Done button is enabled only if a user selected something...
I have a viewcontroller embedded in a navigationcontroller. When I call presentViewController on the picker controller, the navigationbar doesn't show up. I'm using xcode 5. I'm using this code:
CTAssetsPickerController *picker = [[CTAssetsPickerController alloc] init];
picker.delegate = self;
picker.showsCancelButton = YES;
[self presentViewController:picker animated:YES completion:nil];
Can you please return this option?
I used it to for single asset picking.
apologies, I meant to put this feature req on a different control I'm using, makes absolutely no sense for this control :/
I need to extend this class to only include videos which have a minimum duration. I'd figured I could simply extend ALAssetsFilter but it doesn't seem that Apple exposes the interface to the point that you could do that....
Rather than add explicit minimum duration, I thought about maybe adding some sort of predicate block that could be assigned to the asset picker providing arbitrary filtering. Any better ideas?
I'm keeping the picker around between selections, so the user doesn't have to navigate back and forth to the album multiple times. The item count (5 videos, etc) doesn't reset between appears, unless you destroy and re-create the picker, which of course loses the context.
Xcode: Version 5.1
iOS SDK : 7.1
CTAssetsPickerController *picker = [[CTAssetsPickerController alloc] init];
picker.delegate = self;
[picker setMaximumNumberOfSelection:10];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
[self presentViewController:picker animated:YES completion:NULL];
} else {
self.popOverVC = [[UIPopoverController alloc] initWithContentViewController:picker];
self.popOverVC.delegate = self;
[self.popOverVC presentPopoverFromRect:sender.bounds inView:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
This is a feature request.
I have set my maximum number of selection is to one so I only can select one photo ,but I wanted to toggle selection If I have already selected one photo and wanted to click on another to mark the new as selected and remove selection from older one.
I am new in IOS and I can not understand how to play video after saving from camera roll? Thank You !
Hello !
could you add an option to not dismiss the view controller automatically when we have done picking ? It would be nice for my app !
Thanks !
The code works on both 6.1 and 7.0 simulator. But for the iOS 7 device(iPhone 5s), it only display a blank collection view after I click the add button in the demo project. (same situation as in my on project). But it do work on an iPhone 4 with iOS 6.1.3. Would you help to figure out what's wrong with it?
I am using CTAssetsPickerController for multi select gallery items.
But application crashes if I select 4-5 images and there are multiples applications running in background.
Its seems to be RAM problem.
Any idea regards to solve this problem.
Amit Battan
I know you specifically mentioned we have to use the old version.
Thing is, only handful of users of my app need the PickerController to select images.
Most users don't need to select images at all.
Would it be possible to include the library in a way such that only ios7 user is allowed to use the picker?
if(ios.version>= 7) { show button for picker controller. }
Please bring a build that supports Autolayout.
Instead of "%d Photos Selected" show "%d of %d", where last parameter is total photos count in curent folder.
Hi,
First of all, thank you for this great pod!
When using it in a iOS7 project there are some deprecation warnings, namely:
Pods/CTAssetsPickerController/CTAssetsPickerController/CTAssetsPickerController.m:144:19: 'setContentSizeForViewInPopover:' is deprecated: first deprecated in iOS 7.0 - Use UIViewController.preferredContentSize instead.
Pods/CTAssetsPickerController/CTAssetsPickerController/CTAssetsPickerController.m:175:19: 'setContentSizeForViewInPopover:' is deprecated: first deprecated in iOS 7.0 - Use UIViewController.preferredContentSize instead.
Pods/CTAssetsPickerController/CTAssetsPickerController/CTAssetsPickerController.m:540:19: 'setContentSizeForViewInPopover:' is deprecated: first deprecated in iOS 7.0 - Use UIViewController.preferredContentSize instead.
Pods/CTAssetsPickerController/CTAssetsPickerController/CTAssetsPickerController.m:861:47: 'sizeWithFont:' is deprecated: first deprecated in iOS 7.0 - Use -sizeWithAttributes:
Pods/CTAssetsPickerController/CTAssetsPickerController/CTAssetsPickerController.m:863:21: 'drawAtPoint:forWidth:withFont:fontSize:lineBreakMode:baselineAdjustment:' is deprecated: first deprecated in iOS 7.0 - Use -drawInRect:withAttributes:
I think these would be quite easy to fix. The hardest part is keeping iOS6 compatibility I guess. Thoughts?
Regards, Miguel Cabeça
It would be great if the CTAssetScrollView contained an AirPlay picker.
I believe this should be fairly easy to add with an MPVolumeView
I tried hacking in one myself, but I was certain of the best approach in keeping with your architecture.
Would love to hold on an item in the item selection view (checked and unchecked) for 1.5seconds and it popup with a fullscreen preview and done button for the item be it a photo or video for playback.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.