lbrndnr / imagepickersheetcontroller Goto Github PK
View Code? Open in Web Editor NEWImagePickerSheetController replicates the custom photo action sheet in iMessage.
Home Page: http://laurinbrandner.ch
License: MIT License
ImagePickerSheetController replicates the custom photo action sheet in iMessage.
Home Page: http://laurinbrandner.ch
License: MIT License
In many situations, "Add Comment" is not necessary. How can i remove it? Or can someone share a version without it?
Hi,
I'm currently testing your library on iOS8 device and when camera Roll is empty or with just an image the controller crash.
Thank you,
Omar.
Can't use with Xcode 7 beta2
I installed iOS 9 on an iPhone 6 and the library is don't working anymore.
Indeed if you tab on any pictures inside the collection view to select one it crashes with the following error :
2015-06-09 23:05:04.010 barter[592:608643] *** Assertion failure in -[UICollectionViewData validateLayoutInRect:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3473.13/UICollectionViewData.m:408
2015-06-09 23:05:04.015 barter[592:608643] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'layout attributes for supplementary item at index path (<NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 0}) changed from <UICollectionViewLayoutAttributes: 0x135b39780> index path: (<NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 0}); element kind: (UICollectionElementKindSectionHeader); frame = (73 5; 29 130); hidden = YES; zIndex = 1; to <UICollectionViewLayoutAttributes: 0x135c32f00> index path: (<NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 0}); element kind: (UICollectionElementKindSectionHeader); frame = (73 5; 29 233); hidden = YES; zIndex = 1; without invalidating the layout'
*** First throw call stack:
However I fixed the issue in the didSelectItemAtIndexPath method of the library more precisely inside the animateWithDuration block by adding * layout.showsSupplementaryViews = true* between the tableview updates methods.
self.setNeedsLayout()
UIView.animateWithDuration(enlargementAnimationDuration, animations: {
self.tableView.beginUpdates()
layout.showsSupplementaryViews = true
self.tableView.endUpdates()
self.layoutIfNeeded()
}, completion: { finished in
self.reloadButtonTitles()
layout.showsSupplementaryViews = true
self.delegate?.imagePickerSheetDidEnlargePreviews?(self)
})
It is maybe not a real fix because ios9 is under beta. Moreover the fixe appears to make the collectionview scrolling at the beginning so the selected picture will not be at the center of the collection view.
But it can still help someone who is facing the same issue.
hi,
can you recommend a component like this one that target from ios7.0
thank you
I run the demo in the project, when camera roll has very few photo, select will cause crash on iOS 9, iPhone 6s
Here is the crash log and call stack
2015-10-10 14:48:19.865 Example[37983:1364492] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'layout attributes for supplementary item at index path (<NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 0}) changed from <UICollectionViewLayoutAttributes: 0x7f874a7708d0> index path: (<NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 0}); element kind: (UICollectionElementKindSectionHeader); frame = (46.7011 5; 47 119); hidden = YES; zIndex = 1; to <UICollectionViewLayoutAttributes: 0x7f874a45f6d0> index path: (<NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 0}); element kind: (UICollectionElementKindSectionHeader); frame = (46.7011 5; 47 271); hidden = YES; zIndex = 1; without invalidating the layout'
*** First throw call stack:
(
0 CoreFoundation 0x0000000109be5f65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010b9a4deb objc_exception_throw + 48
2 CoreFoundation 0x0000000109be5dca +[NSException raise:format:arguments:] + 106
3 Foundation 0x000000010a02eae2 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
4 UIKit 0x000000010ad8cafd __45-[UICollectionViewData validateLayoutInRect:]_block_invoke + 921
5 UIKit 0x000000010ad8c240 -[UICollectionViewData validateLayoutInRect:] + 3067
6 UIKit 0x000000010ad3c83e -[UICollectionView layoutSubviews] + 196
7 UIKit 0x000000010a5dd11c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 710
8 QuartzCore 0x000000010c71036a -[CALayer layoutSublayers] + 146
9 QuartzCore 0x000000010c704bd0 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
Using the latest version when I run on my 5s and select 11 or more photos from my camera roll the app uses too much memory and crashes. Can the images be returned as reference, or can you return indexes in getSelectedImagesWithCompletion() and we can grab the high quality version and process it one at a time.
Thanks.
2015-07-03 14:33:37.217 Example[15609:4906189] Connection to assetsd was interrupted or assetsd died
2015-07-03 14:33:37.623 Example[15609:4906072] Received memory warning.
2015-07-03 14:33:37.895 Example[15609:4906072] Received memory warning.
There is a problem with 'burst mode' photos, if you have those kind of photos in library, app crashes.
It's not a problem for my app currently, I can skip those photos, so I just checking if photo is in burst mode in fetchAssets() method, and don't append them to assets, but that's suggestion if you want to show these. My 'solution':
private func fetchAssets() {
......
let result = PHAsset.fetchAssetsWithMediaType(.Image, options: options)
result.enumerateObjectsUsingBlock { obj, _, _ in
if let asset = obj as> PHAsset {
if(asset.burstIdentifier == nil){
self.assets.append(asset)
}
}
}
}
So the problem on my end is that when I tested the example on iPhone 5, iOS 8.3 the scrolling, between the images, was not smooth at all. In iMessage is very smooth.
Thank you!
2015-03-16 01:16:38.893 Example[1186:217454] Could not obtain unique identifier for attached screen <UIScreen: 0x1755fd90; bounds = {{0, 0}, {768, 576}}; mode = <UIScreenMode: 0x17662db0; size = 720.000000 x 576.000000; pixel aspect ratio = 1.092593>>
The documentation is 0.1.7
But it should be 0.9 to reflect the most updated version.
Also sample code isn't correct in comparison with master's example code.
Hello,
I was wondering how can I integrate this with my current objective c code?
Best,
Bennett
This might be useful
error:
*** Assertion failure in -[UICollectionViewData validateLayoutInRect:]
ImagePickerSheetController.swift - line:287
I'm trying to integrate IPSC with carthage. However the building process of IPSC involves all testing stuffs including Nimble/Quick/KIF and fails eventually when trying to build Quick. I suppose apps link against IPSC should not rely on its unit tests.
@larcus94 could you please set the target to iOS 8.0?
It works great in the simulator but when ran on my phone it crashes. I'm running ios 8.1.1 on a 5s. To be sure it was not my implementation, I used your code sample to test.
When the user takes a photo manually, the didFinishPickingWithOptions (or something really similar) method gets called so you can get the image from there. This also works when manually selecting from Photo Library. The problem I'm encountering it when using the slider to pick an image and click send, I can't get the image file. I can use controller.selectedImageAssets but it's a [phasset] file.
How am I actually able to get a UIImage from the slider? I'm using the example code.
Thanks for your help, really like the layout of the custom picker!
In order to test the component thoroughly, KIF tests need to be written. Help would be appreciated :)
Can you add type of selected media to SecondaryHandler?
I want to show title like in iMessage -> 1 Video, 1 Photo or 2 objects.
Hi,
I downloaded it through Carthage, imported the ImagePickerSheetController in Build Phases, and copied the swift files with the classes in it, but Xcode doesn't find the XCTest, Nimble,... So I thought I needed to import them, but I can't seem to find them in the Carthage build. Am I doing this the totally wrong way?
Awesome ImagePicker design!
Thanks
Hello and thanks for this lib. :)
Is there any change this can be ported to Obj-C?
thanks
Scrolling in the picker's collection view is very choppy.
I am trying to use carthage to get this into a project. It fails to build with the following:
=== BUILD TARGET BRNImagePickerSheet OF PROJECT BRNImagePickerSheet WITH CONFIGURATION Release ===
Check dependencies
Code Sign error: No code signing identities found: No valid signing identities (i.e. certificate and private key pair) matching the team ID “XXXXXXXXXX” were found.
CodeSign error: code signing is required for product type 'Framework' in SDK 'iOS 8.2'
I just started giving carthage a go so it could be something I am doing wrong. Any thoughts?
ImagePickerSheetController should be requesting the PHPhotoLibrary
access by itself, to make it easier to use.
Can't use with Xcode 7 beta2
I get an error very randomly when trying to compile the asset catalog...
I don't seem to get any more information than this. Most of the time it passes compilation sometimes it fails...
The following build commands failed:
CompileAssetCatalog /Users/greenhouse/tmp4ZakUq/build/Debug-iphoneos/ImagePickerSheetController.framework ImagePickerSheetController/ImagePickerSheetController/ImagePickerSheetController/Images.xcassets
(1 failure)
Build failed :|
Running xcodebuild failed```
I'm not sure what's the problem (maybe it's my app, but you can check that if you want :), after editing image in iphone library I can't get original size of the image (if I choose it from image picker). But if I choose edited image from Photo Library everything is fine. I took some screenshots from my app, Second photo is original photo picked from picker, fourth photo is edited (picked from picker, too), and fifth is same edited photo picked from Photo Library -> Camera Roll.
Hi Larcus94
I have an objective c project.Could you please help me with the installation steps of this framework in the project.If you could share the steps it would be helpful.
ImagePickerSheet in a story board app produces an error when using the member selectedPhotos for ImagePickerSheet.
The error reported is:
'ImagePickerSheet' does not have a member named 'selectedPhotos'
I've created a test story board app here: https://github.com/gluecode/ImagePickerSheetStoryBoard
pod 'ImagePickerSheetController', :git => 'https://github.com/larcus94/ImagePickerSheetController.git', :branch => 'ios9'
but have many error ,like
Use of undeclared type 'SheetController'
Use of unresolved identifier 'PreviewSupplementaryView'
Use of unresolved identifier 'PreviewCollectionViewCell'
Is there any delegate method that allows only one image to be selected?
Installing instructions via CocoaPods are outdated, version 0.1.7 does not support Swift 2. So please update your ReadMe file :)
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.