mikaoj / bsimagepicker Goto Github PK
View Code? Open in Web Editor NEWA multiple image picker for iOS
License: MIT License
A multiple image picker for iOS
License: MIT License
In AlbumCellFactory.cellForIndexPath, PHAsset.fetchAssetsInAssetCollection is being called twice which causes a huge hit on performance. The first call appears to be a mistake because it ignores the results.
Video support got dropped for 1.0.
Reimplement it
I recommend changing the title from 'A multiple image picker for iOS 8' to 'A multiple image picker for iOS'. The lib works excellent in iOS 9.3 too. :-)
My app crashes after the picker view is presented. I have enabled the coredata concurrency debugging option with the following in build arguments: -com.apple.CoreData.ConcurrencyDebug 1
.
Seems like its using NSManagedObjectContext the wrong way. Although i don't know if this library uses it or its just ALAssetsLibrary messing up.
That would probably be a cool feature :p
I am using cocoa pods to get this in my project but I fail to build my project because I am getting 'build error' in PreviewViewController and PhotosViewController. The error is coming because of usage of action: #selector syntax
➜ Example git:(master) ✗ pod install
Updating local specs repositories
Analyzing dependencies
Fetching podspec for `BSImagePicker` from `../`
[!] Unable to satisfy the following requirements:
- `BSImagePicker (from `../`)` required by `Podfile`
- `BSImagePicker (from `../`)` required by `Podfile`
- `BSImagePicker (from `../`)` required by `Podfile`
- `BSImagePicker (= 1.3.0)` required by `Podfile.lock`
I want to redirect to other screen when done button is clicked with data of all the images. But i don't know how to create a segue programatically.
http://stackoverflow.com/questions/9674685/creating-a-segue-programmatically
My reference
Great stuff, I really appreciate it! I do however think that there is a bug when setting itemSize as it has no effect.
The quality of the thumbnails makes 3 images in width on an iPad look terrible. Im guessing this is why we have the itemSize attribute? If it would be possible to have 6 images in width, that would change a lot!
Hello,
I know this is not a bug, but I just want to ask:
Is there a way to deselect pragmatically an asset from the current selections? I haven't figure it out how. :(
Thanks
G.
When I first time invoke this picker I see empty screen with "Button" title. After that if I again open the picker it's ok.
I think the problem is related to the asked permutations.
Hey there, I'm trying to install this w/ CocoaPods 0.38.2 but I'm getting:
[!] Unable to satisfy the following requirements:
- BSImagePicker (= 1.4.0) required by Podfile
Not sure if this is an issue with the BSImagePicker .podspec or something to do with their new Cocoapods Trunk stuff: https://guides.cocoapods.org/making/getting-setup-with-trunk.html
Update: if I completely remove any versioning in the Podfile, it seems like an older version of BSImage is installed, one that uses ALAssets instead of PHAssets.
Update 2: as a workaround I downgraded CocoaPods to 0.37.2
The transition when going to preview mode needs ALOT of love
Crashed when i use first, app request photo permission and crashed.
this also happened Example app
2015-07-29 14:09:37.980 BSImagePickerExample[13520:125544] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 0 beyond bounds for empty array'
*** First throw call stack:
(
0 CoreFoundation 0x000000010cebfc65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010eb4cbb7 objc_exception_throw + 45
2 CoreFoundation 0x000000010cdb617e -[__NSArrayI objectAtIndex:] + 190
3 Photos 0x000000010d7b8ed0 -[PHFetchResult objectAtIndexedSubscript:] + 57
4 BSImagePicker 0x000000010cc74d21 _TFC13BSImagePicker22FetchResultsDataSource17objectAtIndexPathfS0_FCSo11NSIndexPathCSo8PHObject + 145
5 BSImagePicker 0x000000010cc75031 _TFC13BSImagePicker22FetchResultsDataSource27isObjectAtIndexPathSelectedfS0_FCSo11NSIndexPathSb + 65
6 BSImagePicker 0x000000010cc74e71 _TFC13BSImagePicker22FetchResultsDataSource23selectObjectAtIndexPathfS0_FCSo11NSIndexPathT_ + 65
7 BSImagePicker 0x000000010cc76e71 _TTWC13BSImagePicker22FetchResultsDataSourceS_20SelectableDataSourceS_FS1_23selectObjectAtIndexPathUS1___fQPS1_FCSo11NSIndexPathT_ + 17
8 BSImagePicker 0x000000010cc8001a _TFC13BSImagePicker20PhotosViewControllercfMS0_FT10dataSourcePS_20SelectableDataSource_8settingsPS_21BSImagePickerSettings_10selectionsGSaCSo7PHAsset__S0_ + 1594
9 BSImagePicker 0x000000010cc7f99a _TFC13BSImagePicker20PhotosViewControllerCfMS0_FT10dataSourcePS_20SelectableDataSource_8settingsPS_21BSImagePickerSettings_10selectionsGSaCSo7PHAsset__S0_ + 90
10 BSImagePicker 0x000000010cc6ee25 _TFFC13BSImagePicker27BSImagePickerViewControllerg20photosViewControllerCS_20PhotosViewControllerU_FT_S1_ + 181
11 BSImagePicker 0x000000010cc67167 _TFC13BSImagePicker27BSImagePickerViewControllerg20photosViewControllerCS_20PhotosViewController + 279
12 BSImagePicker 0x000000010cc6a435 _TFC13BSImagePicker27BSImagePickerViewControllers16selectionClosureGSqFT5assetCSo7PHAsset_T__ + 53
13 BSImagePicker 0x000000010cc9706f _TFFE13BSImagePickerCSo16UIViewController31bs_presentImagePickerControllerFS0_FTCS_27BSImagePickerViewController8animatedSb6selectGSqFT5assetCSo7PHAsset_T__8deselectGSqFT5assetS2__T__6cancelGSqFGSaS2__T__6finishGSqFGSaS2__T__10completionGSqFT_T___T_U_FT_T_ + 271
14 BSImagePicker 0x000000010cc95d92 _TPA__TFFE13BSImagePickerCSo16UIViewController31bs_presentImagePickerControllerFS0_FTCS_27BSImagePickerViewController8animatedSb6selectGSqFT5assetCSo7PHAsset_T__8deselectGSqFT5assetS2__T__6cancelGSqFGSaS2__T__6finishGSqFGSaS2__T__10completionGSqFT_T___T_U_FT_T_ + 370
15 BSImagePicker 0x000000010cc67391 _TZFC13BSImagePicker27BSImagePickerViewController9authorizefMS0_FT6statusOSC21PHAuthorizationStatus18fromViewControllerCSo16UIViewController10completionFT_T__T_ + 129
16 BSImagePicker 0x000000010cc6d8da _TFFZFC13BSImagePicker27BSImagePickerViewController9authorizeFMS0_FT6statusOSC21PHAuthorizationStatus18fromViewControllerCSo16UIViewController10completionFT_T__T_U_FS1_T_U_FT_T_ + 90
17 BSImagePicker 0x000000010cc6d927 _TTRXFo__dT__XFdCb__dT__ + 39
18 libdispatch.dylib 0x000000011164e186 _dispatch_call_block_and_release + 12
19 libdispatch.dylib 0x000000011166d614 _dispatch_client_callout + 8
20 libdispatch.dylib 0x0000000111655a1c _dispatch_main_queue_callback_4CF + 1664
21 CoreFoundation 0x000000010ce271f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
22 CoreFoundation 0x000000010cde8dcb __CFRunLoopRun + 2043
23 CoreFoundation 0x000000010cde8366 CFRunLoopRunSpecific + 470
24 GraphicsServices 0x0000000110e01a3e GSEventRunModal + 161
25 UIKit 0x000000010d8808c0 UIApplicationMain + 1282
26 BSImagePickerExample 0x000000010cb8ebe7 main + 135
27 libdyld.dylib 0x00000001116a1145 start + 1
28 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Hi,
I come across your controll and i must say it is a great peace of work!
But in my case i would like to have it more like telegram style:
Tap to preview, and tap in little icon to select. Also select in preview mode and tap to dismiss the preview.
I was thinking to implement this changes on my own.
Should i fork and pull a request with a optional mode.
Ex:
@Property BOOL facebookStyleORTelegramStyle ;
Or should i just keep this private and you dont care about this way?
Currently it doesn't work very well in a popover on ipad. I have fixed a couple of issues in feature/ipad_popover if anyone needs it NOW.
There is still an issue with the animation when going to preview
I can't see how to pick videos or only videos.
Is it not supported? or I'm missing something?
On the demo on CocoaControls, there is a very interesting feature which is why I choose your great component, really its very good! :).
The feature Im talking about is the posibility to select images while previewing them. Also while on preview is supposed to be possible to navigate thru the images in the library, but now it seems those 2 things are gone or I have something very wrongly configured... :(
Thx
G.
It seems like the background color for selection numbers are the same as navigation bar title.
I would like to have the background color to be the same as my navigation bar.
If I set the navigation title color to white, it changes the selection background color to white, but the selection title color is also white.
Hi, it would be great if you could add a screenshot to the podspec and push the update to the specs repo. The screenshot is currently displayed on http://feeds.cocoapods.org and in future it will displayed on the search of http://cocoapods.org.
To learn more about the screenshot attribute, you can check the documentation here: http://guides.cocoapods.org/syntax/podspec.html#screenshots
I want to change the cancelButton title from "Cancel" to another one!
is there some ways to change it?
thank you!
To reflect last weeks changes :)
Hi,
It would be great if the camera icon is customizable when takePhotos is true. The blue color is not convenient for some people challenged with bad vision.
Thank you very much.
Sunil
Make use of the new UI test features in Xcode 7!
Hi!
If i minimize the application during BSImagePicker is open, and then take picture by camera, after when i return back to the application i have fatal error in BSImagePicker.AssetsModel.photoLibraryDidChange:
fatal error: unexpectedly found nil while unwrapping an Optional value
i use SDK 8.3, deployment target :8.2 (iphone 5s)
Hi,
It would be great if the camera icon size can be changed (or passed a new image) when takePhotos is true. The icon is a small as per user feedback from visually challenged testers.
Thank you very much again :-)
Sunil
Hi there!
Found a fringe case that you might want to know about:
If a user were to fetch the image from PHImageManager based on the asset, this might cause a crash.
Again, fringe case, but thought you might want to know. Thanks for maintaining this awesome library! :)
in function didUpdateModel when no photos no collectionview
OS: iOS8.2
device: iPhone6
It should be possible to swipe to the next image in preview mode.
Add support for taking new pictures.
Make it an optional subspec?
Hello
I just use your api it's working fine in xcode 6 but not working in xcode 7.
Please help me.
Is it possible to customise the navigation bar header text colour and the dismiss X UIButton colour?
I can't see camera button sometimes.
https://www.dropbox.com/s/3bmdgrzp3s56rxd/Camera%20button.mp4?dl=0#
and what is the correct BSImagePicker?
Another path: https://github.com/asefnoor/BSImagePicker
When you go into an album you have on your device 1 photo is always missing. If you only have 1 photo in the album there is none present. If you have 4, there is 3 present.
That is retarded, so stop it!
let vc = PhotosViewController(fetchResults: self.fetchResults,
defaultSelections: self.defaultSelections,
settings: self.settings)
vc.finishClosure = { (assets: [PHAsset]) in
` for (index, asset) in assets.enumerate()
{
let manager = PHImageManager.defaultManager()
manager.requestImageForAsset(asset, targetSize: CGSize(width: 100.0, height: 100.0), contentMode: .AspectFit, options: nil, resultHandler: {(result, info)->Void in
// crash here sometimes while I'm trying to use this result, and it say can't unwrap it.
})
}
}`
nice job,but I have a scene, when a picker some image,but i need change the first time's image.When I open the BSImagePicker again, i need to show the first time selected Status . i don't how to solve it .
To make it a full UIImagePicker replacement
Every time assets change, the UICollectionView is reset and goes back to top position.
This is a problem in several scenarios:
I actually wanted to create a pull request with this fixed (and also with video support) but I'm on a really tight schedule and management has already told me to scrap that and stop caching images (workaround for first scenario), and hope the user has already all its photos' thumbnails downloaded... which is not my case at all (as a user), so it's really making me unable to use BSImagePicker at all.
As native gallery in iOS 9
A little collection view in the bottom that displays the images in a row and highlights the current image
I want to override preferredStatusBarStyle()
on BSImagePickerViewController
, but can't do that with a subclass, because the class is final
.
Instead of predicting all desired functionalities, IMO BSImagePickerViewController
shouldn't be final, so developers could customize it.
i have an issue when building my app since i have updated Xcode from 7.2 to 7.3
I'm using :
This is what xcode says :
CpResource /Users/alexandreguibert/Library/Developer/Xcode/DerivedData/Evaneos-detujkeddycfbxdybrazrjyowroh/Build/Products/Dev-iphonesimulator/BSImagePicker/BSImagePicker.bundle /Users/alexandreguibert/Library/Developer/Xcode/DerivedData/Evaneos-detujkeddycfbxdybrazrjyowroh/Build/Products/Dev-iphonesimulator/BSImagePicker/BSImagePicker.framework/BSImagePicker.bundle
cd /Users/alexandreguibert/Documents/Apps/evaneos/Pods
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -strip-debug-symbols -strip-tool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -resolve-src-symlinks /Users/alexandreguibert/Library/Developer/Xcode/DerivedData/Evaneos-detujkeddycfbxdybrazrjyowroh/Build/Products/Dev-iphonesimulator/BSImagePicker/BSImagePicker.bundle /Users/alexandreguibert/Library/Developer/Xcode/DerivedData/Evaneos-detujkeddycfbxdybrazrjyowroh/Build/Products/Dev-iphonesimulator/BSImagePicker/BSImagePicker.framework
error: /Users/alexandreguibert/Library/Developer/Xcode/DerivedData/Evaneos-detujkeddycfbxdybrazrjyowroh/Build/Products/Dev-iphonesimulator/BSImagePicker/BSImagePicker.bundle: No such file or directory
Perhaps a sad smiley?
The following code from your sample with added assetType property doesn't change at all what's being presented. In both cases I'm given only photos. Am I doing something wrong or is it a bug?
Tested on iPhone 6+ with latest iOS 8
BSImagePickerController *imagePicker = nil;
if([sender tag] == 1) {
imagePicker = self.imagePicker;
} else {
imagePicker = self.darkImagePicker;
}
imagePicker.assetType = BSAssetTypeVideo;
[self.window.rootViewController presentImagePickerController:imagePicker
animated:YES
completion:nil
toggle:^(ALAsset *asset, BOOL select) {
if(select) {
NSLog(@"Image selected");
} else {
NSLog(@"Image deselected");
}
}
cancel:^(NSArray *assets) {
NSLog(@"User canceled...!");
[imagePicker dismissViewControllerAnimated:YES completion:nil];
}
finish:^(NSArray *assets) {
NSLog(@"User finished :)!");
[imagePicker dismissViewControllerAnimated:YES completion:nil];
}];
Hi, I think that private variables doneBarButton, cancelBarButton and albumTitleView in BSImagePickerViewController should be marked public. For example my app supports multiple languages, and I had to remove private prefix in order to set titles from my controller and next time i update my pods that change will be canceled. Also someone might prefer to have done button titled as upload or something similar. It's not a bug but i think it would be more useful to have them as public. Great library btw.
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.