Giter Site home page Giter Site logo

dkimagepickercontroller's Introduction

DKImagePickerController

Build Status Version Status license MIT Carthage compatible

Description

DKImagePickerController is a highly customizable, Pure-Swift library.

Features

  • Supports both single and multiple selection.
  • Supports filtering albums and sorting by type.
  • Supports landscape, iPad, and orientation switching.
  • iCloud Support.
  • Supports batch exports PHAsset to lcoal files.
  • Inline mode Support.
  • Customizable UICollectionViewLayout.
  • Customizable camera, photo gallery and photo editor.
  • Dark Mode Support

Requirements

  • iOS 9.0+ (Drop support for iOS 8 in 4.3.0 or above)
  • ARC
  • Swift 4 & 5

Installation

CocoaPods

iOS 9 and newer

DKImagePickerController is available on CocoaPods. Simply add the following line to your podfile:

# For latest release in cocoapods
pod 'DKImagePickerController'

For Swift 4.1

pod 'DKImagePickerController', :git => 'https://github.com/zhangao0086/DKImagePickerController.git', :branch => 'Swift4'

For iOS 8

pod 'DKImagePickerController', :git => 'https://github.com/zhangao0086/DKImagePickerController.git', :branch => 'iOS8'

Subspecs

There are 7 subspecs available now:

Subspec Description
Core Required.
ImageDataManager Required. The subspec provides data to DKImagePickerController.
Resource Required. The subspec provides resource management and internationalization.
PhotoGallery Optional. The subspec provides preview feature for PHAsset.
Camera Optional. The subspec provides camera feature.
InlineCamera Optional. The subspec should be pushed by UINavigationController, like UIImagePickerController with UIImagePickerControllerSourceType.camera.
PhotoEditor Optional. The subspec provides basic image editing features.

This means you can install only some of the DKImagePickerController modules. By default, you get all subspecs.
If you need to use your own photo editor, simply specify subspecs other than PhotoEditor:

pod 'DKImagePickerController', :subspecs => ['PhotoGallery', 'Camera', 'InlineCamera']

More information, see Extensions.

Carthage

github "zhangao0086/DKImagePickerController"

If you use Carthage to build your dependencies, make sure you have added CropViewController.framework, DKCamera.framework, DKImagePickerController.framework, DKPhotoGallery.framework and SDWebImage.framework to the "Linked Frameworks and Libraries" section of your target, and have included them in your Carthage framework copying build phase.

Getting Started

Initialization and presentation

let pickerController = DKImagePickerController()

pickerController.didSelectAssets = { (assets: [DKAsset]) in
    print("didSelectAssets")
    print(assets)
}

self.presentViewController(pickerController, animated: true) {}

​````

#### Configurations

​```swift
 /// Use UIDelegate to Customize the picker UI.
 @objc public var UIDelegate: DKImagePickerControllerBaseUIDelegate!
 
 /// Forces deselect of previous selected image. allowSwipeToSelect will be ignored.
 @objc public var singleSelect = false
 
 /// Auto close picker on single select
 @objc public var autoCloseOnSingleSelect = true
 
 /// The maximum count of assets which the user will be able to select, a value of 0 means no limit.
 @objc public var maxSelectableCount = 0
 
 /// Photos will be tagged with the location where they are taken.
 /// If true, your Info.plist should include the "Privacy - Location XXX" tag.
 open var containsGPSInMetadata = false
 
 /// Set the defaultAssetGroup to specify which album is the default asset group.
 public var defaultAssetGroup: PHAssetCollectionSubtype?
 
 /// Allow swipe to select images.
 @objc public var allowSwipeToSelect: Bool = false
 
 /// Allow select all
 @objc public var allowSelectAll: Bool = false
 
 /// A Bool value indicating whether the inline mode is enabled.
 @objc public var inline: Bool = false
 
 /// The type of picker interface to be displayed by the controller.
 @objc public var assetType: DKImagePickerControllerAssetType = .allAssets
 
 /// If sourceType is Camera will cause the assetType & maxSelectableCount & allowMultipleTypes & defaultSelectedAssets to be ignored.
 @objc public var sourceType: DKImagePickerControllerSourceType = .both
 
 /// A Bool value indicating whether allows to select photos and videos at the same time.
 @objc public var allowMultipleTypes = true
 
 /// A Bool value indicating whether to allow the picker auto-rotate the screen.
 @objc public var allowsLandscape = false
 
 /// Set the showsEmptyAlbums to specify whether or not the empty albums is shown in the picker.
 @objc public var showsEmptyAlbums = true
 
 /// A Bool value indicating whether to allow the picker shows the cancel button.
 @objc public var showsCancelButton = false
 
 /// The block is executed when the user presses the cancel button.
 @objc public var didCancel: (() -> Void)?
 
 /// The block is executed when the user presses the select button.
 @objc public var didSelectAssets: ((_ assets: [DKAsset]) -> Void)?
 
 /// The block is executed when the number of selected assets is changed.
 @objc public var selectedChanged: (() -> Void)?
 
 /// A Bool value indicating whether to allow the picker to auto-export the selected assets to the specified directory when done is called.
 /// picker will creating a default exporter if exportsWhenCompleted is true and the exporter is nil.
 @objc public var exportsWhenCompleted = false
 
 @objc public var exporter: DKImageAssetExporter?
 
 /// Indicates the status of the exporter.
 @objc public private(set) var exportStatus = DKImagePickerControllerExportStatus.none {
    willSet {
        if self.exportStatus != newValue {
            self.willChangeValue(forKey: #keyPath(DKImagePickerController.exportStatus))
        }
    }
    
    didSet {
        if self.exportStatus != oldValue {
            self.didChangeValue(forKey: #keyPath(DKImagePickerController.exportStatus))
            
            self.exportStatusChanged?(self.exportStatus)
        }
    }
 }
 
 /// The block is executed when the exportStatus is changed.
 @objc public var exportStatusChanged: ((DKImagePickerControllerExportStatus) -> Void)?
 
 /// The object that acts as the data source of the picker.
 @objc public private(set) lazy var groupDataManager: DKImageGroupDataManager

Inline Mode

let groupDataManagerConfiguration = DKImageGroupDataManagerConfiguration()
groupDataManagerConfiguration.fetchLimit = 10
groupDataManagerConfiguration.assetGroupTypes = [.smartAlbumUserLibrary]

let groupDataManager = DKImageGroupDataManager(configuration: groupDataManagerConfiguration)

self.pickerController = DKImagePickerController(groupDataManager: groupDataManager)
pickerController.inline = true
pickerController.UIDelegate = CustomInlineLayoutUIDelegate(imagePickerController: pickerController)
pickerController.assetType = .allPhotos
pickerController.sourceType = .photo

let pickerView = self.pickerController.view!
pickerView.frame = CGRect(x: 0, y: 170, width: self.view.bounds.width, height: 200)
self.view.addSubview(pickerView)

Customizable UI

For example, see CustomUIDelegate.

Customizable Layout

For example, see CustomLayoutUIDelegate.

Conforms UIAppearance protocol

You can easily customize the appearance of the navigation bar using the appearance proxy.

UINavigationBar.appearance().titleTextAttributes = [
    NSFontAttributeName : UIFont(name: "Optima-BoldItalic", size: 21)!,
    NSForegroundColorAttributeName : UIColor.redColor()
]

Exporting to file

By default, the picker uses a singleton object of DKImageAssetExporter to export DKAsset to local files.

/*
 Configuration options for a DKImageAssetExporter.  When an exporter is created,
 a copy of the configuration object is made - you cannot modify the configuration
 of an exporter after it has been created.
 */
@objc
public class DKImageAssetExporterConfiguration: NSObject, NSCopying {
    
    @objc public var imageExportPreset = DKImageExportPresent.compatible
    
    /// videoExportPreset can be used to specify the transcoding quality for videos (via a AVAssetExportPreset* string).
    @objc public var videoExportPreset = AVAssetExportPresetHighestQuality
    
    #if swift(>=4.0)
    @objc public var avOutputFileType = AVFileType.mov
    #else
    @objc public var avOutputFileType = AVFileTypeQuickTimeMovie
    #endif
    
    @objc public var exportDirectory = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("DKImageAssetExporter")
}

/*
 A DKImageAssetExporter object exports DKAsset(PHAsset) from album (or iCloud) to the app's tmp directory (by default).
 It automatically deletes the exported directories when it receives a UIApplicationWillTerminate notification.
 */
@objc
open class DKImageAssetExporter: DKBaseManager {
    
    /// This method starts an asynchronous export operation of a batch of asset.
    @discardableResult
    @objc public func exportAssetsAsynchronously(assets: [DKAsset], completion: ((_ info: [AnyHashable : Any]) -> Void)?) -> DKImageAssetExportRequestID
}

This exporter can automatically convert HEIF to JPEG:

@objc
public enum DKImageExportPresent: Int {
    case
    compatible, // A preset for converting HEIF formatted images to JPEG.
    current     // A preset for passing image data as-is to the client.
}

You also can observe the export progress of each asset:

@objc
public protocol DKImageAssetExporterObserver {
    
    @objc optional func exporterWillBeginExporting(exporter: DKImageAssetExporter, asset: DKAsset)
    
    /// The progress can be obtained from the DKAsset.
    @objc optional func exporterDidUpdateProgress(exporter: DKImageAssetExporter, asset: DKAsset)
    
    /// When the asset's error is not nil, it indicates that an error occurred while exporting.
    @objc optional func exporterDidEndExporting(exporter: DKImageAssetExporter, asset: DKAsset)
}

extension DKAsset {
    
    /// The exported file will be placed in this location.
    /// All exported files can be automatically cleaned by the DKImageAssetDiskPurger when appropriate.
    @objc public var localTemporaryPath: URL?
    
    @objc public var fileName: String?
    
    /// Indicates the file's size in bytes.
    @objc public var fileSize: UInt
        
    /// If you export an asset whose data is not on the local device, and you have enabled downloading with the isNetworkAccessAllowed property, the progress indicates the progress of the download. A value of 0.0 indicates that the download has just started, and a value of 1.0 indicates the download is complete.
    @objc public var progress: Double
    
    /// Describes the error that occurred if the export has failed or been cancelled.
    @objc public var error: Error?
}

For example, see Export automatically and Export manually.

Extensions

This picker uses DKImageExtensionController manages all extensions, you can register it with a DKImageBaseExtension and a specified DKImageExtensionType to customize camera, photo gallery and photo editor:

/// Registers an extension for the specified type.
public class func registerExtension(extensionClass: DKImageBaseExtension.Type, for type: DKImageExtensionType)

public class func unregisterExtension(for type: DKImageExtensionType)

The perform function will be called with a dictionary providing current context information when an extension is triggered:

/// Starts the extension.
func perform(with extraInfo: [AnyHashable: Any])

/// Completes the extension.
func finish()

The extraInfo will provide different information for different DKImageExtensionType:

Camera
let didFinishCapturingImage = extraInfo["didFinishCapturingImage"] as? ((UIImage, [AnyHashable : Any]?) -> Void)
let didCancel = extraInfo["didCancel"] as? (() -> Void)

For a custom camera example, see CustomCameraExtension.

InlineCamera

The extraInfo is the same as for Camera.

Photo Gallery
let groupId = extraInfo["groupId"] as? String
let presentationIndex = extraInfo["presentationIndex"] as? Int
let presentingFromImageView = extraInfo["presentingFromImageView"] as? UIImageView
Photo Editor
let image = extraInfo["image"] as? UIImage
let didFinishEditing = extraInfo["didFinishEditing"] as? ((UIImage, [AnyHashable : Any]?) -> Void)
let metadata = extraInfo["metadata"] as? [AnyHashable : Any]

How to use in Objective-C

If you use CocoaPods

  • Add the following two lines into your Podfile:

    pod 'DKImagePickerController'
    use_frameworks!
    
  • Import the library into your Objective-C file:

    #import <DKImagePickerController/DKImagePickerController-Swift.h>

If you use it directly in your project

See also:Swift and Objective-C in the Same Project

  • Drag and drop the DKCamera, DKImageManager and DKImagePickerController to your project

  • Import the library into your Objective-C file:

    #import "YourProductModuleName-Swift.h"

then you can:

DKImagePickerController *pickerController = [DKImagePickerController new];

 [pickerController setDidSelectAssets:^(NSArray * __nonnull assets) {
     NSLog(@"didSelectAssets");
 }];
 
 [self presentViewController:pickerController animated:YES completion:nil];

Localization

The default supported languages:

en, es, da, de, fr, hu, ja, ko, nb-NO, pt_BR, ru, tr, ur, vi, ar, it, zh-Hans, zh-Hant

You can also add a hook to return your own localized string:

DKImagePickerControllerResource.customLocalizationBlock = { title in
    if title == "picker.select.title" {
        return "Test(%@)"
    } else {
        return nil
    }
}

or images:

DKImagePickerControllerResource.customImageBlock = { imageName in
    if imageName == "camera" {
        return DKImagePickerControllerResource.photoGalleryCheckedImage()
    } else {
        return nil
    }
}

Contributing to this project

If you have feature requests or bug reports, feel free to help out by sending pull requests or by creating new issues.

License

DKImagePickerController is released under the MIT license. See LICENSE for details.

dkimagepickercontroller's People

Contributors

abjurato avatar anthonymdev avatar avinpr-pgr avatar azurechen avatar crazyfanfan avatar digisplash avatar dneykov avatar dominicmdev avatar duylinh avatar eric-robinson avatar erychagov avatar gesantung avatar gregoriol avatar hunaid-hassan-confiz avatar hyouuu avatar jasonjanofsky avatar jettf avatar jlnquere avatar julianshen avatar lawicko avatar lucasromanomr avatar mspasov avatar ruberik avatar scottdelly avatar sorianog avatar vladtoader avatar yosritimraz avatar zhangao0086 avatar zrn-ns avatar zxkane avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dkimagepickercontroller's Issues

Crash when get the `fullScreenImage` in Xcode 6.4

invalid attempt to access <ALAssetPrivate: 0x7f8946220cd0> past the lifetime of its owning ALAssetsLibrary
fatal error: unexpectedly found nil while unwrapping an Optional value

How to solove it?

Unable to save the selected assets array

I have implemented this project via cocoa pods. I wanted to save the selected images (path) to an array and retrieve and upload in another view controller.

Failed to work out. Appreciate your help.

How to change image of first cell

Hi!

I need to change image of first cell when select DKImagePickerControllerAssetType
Image selection is one other picture and filming is another image

Select multi image!

When i select multi image at many album it got wrong number image selected.
Fix it please.

Update AssetsLibrary to Photos framework, deprecated

Unfortunately I'm getting warnings left and right about how the AssetsLibrary is deprecated and certain methods need to be updated to the Photos framework; they all have to do with the originalAsset variable in the DKAsset class. Please fix this, I would but I'm new to iOS development :/

Unable to replicate FB upload new profile pic functionality

So, this is 95% there for it. There just isn't a way to click a pic -> Go to a crop view, then crop pic.

Further, it seems like you use a custom button for the Done as the right button for Navigation bar. Why don't you use the default .Done, which looks better? A tad redundant to number the selected pics on the pics and then have the selected number on the top right as well. It doesn't look very aesthetically pleasing like that and the reason someone would use this is for it to mimic 100% the functionality they're looking for.

Anyways, just an FYI, but I'll see if I can get a crop thing going and make a pull request.

keep the ratio when using fetchImageWithSize

Is there an option to detect or keep the ratio when using this size one? In that case, the size specified would be the max height and the max width for the compressed image.

For example, if I specify the size to be CGSize(width: 1200, height: 1200), the image will always be cut into 1200 * 1200 square. If the original ratio is 4:3 and 2000:1500, I'd like to have the UIImage to be 1200 * 900. Thanks!

Installation Error

First off all thank you for yours working. It is really amazing.
I did all steps which you write. It looks correctly but when I want to instance DKAsset or DKImagePickerController gives me the error undefined. I researched it and when I change the shcema on my project error fix and build success but in this case application is not run. I use swift in my project.

May you share something to me about how can ı import the framework and use it correctly in swift.

Thank you so much.

Best Regards.

Suggestion, Add "Cancel" button on picker

Please add the cancel button on picker, show that user can dismiss the picker for example by mistake user open the picker and don't want to select the image. or not want to select any image then he/she able to dismiss the picker on cancel button click. I know the done button click dismiss. But as per user experience we need add the "cancel" button.

Obj C HighQualityFormat does not return images

When using option for HighQualityFormat in Objective C, images never return.

Code as used (aSelected is array of selected images):

for (int i = 0; i < aSelected.count; i++)
{
CGSize imageSize=CGSizeMake(1153, 1153);

        PHImageRequestOptions* options = [[PHImageRequestOptions alloc] init] ;
        options.synchronous = YES;
        options.version = PHImageRequestOptionsVersionCurrent;
        options.deliveryMode = PHImageRequestOptionsDeliveryModeHighQualityFormat;
        options.resizeMode=PHImageRequestOptionsResizeModeFast;
        options.networkAccessAllowed = YES;

        DKImageManager *cont = [DKImageManager new];

[cont fetchImageForAsset:aSelected[i] size:imageSize options:options completeBlock:^(UIImage * imageSelected, NSDictionary * info){
[self uploadContentImage:imageSelected];
}];

Deselecting photos does not update the numbering.

If you have selected a number of photos and decide to deselect one (or more), the relative numbering of the rest of the photos does not get updated.

For example if you have selected 3 photos, and then deselect number 2, then the remaining two photos will still be numbered 1 and 3. Expected behaviour would be that number 3 would change to 2.

This also has the effect that when you then continue to select another photo, then there will be three photos with the numbers 1, 3 and 3.

Quick Question For A Beginner

Hello, Can I just start off by saying thank you for such an incredible project. I've created something similar but far less complicated. My question is this, Is it possible to call an image picker on view did load. For the demo that you provided in VIewController at view did load I called for your show method providing the needed specifications.
I end up getting an error <DKImagePickerControllerDemo.DKImagePickerController: 0x12582ee00> on <DKImagePickerControllerDemo.ViewController: 0x124e458f0> whose view is not in the window hierarchy!. Not sure where I am going wrong
override func viewDidLoad() {
super.viewDidLoad()
showImagePickerWithAssetType(
.AllAssets,
allowMultipleType: false,
sourceType: .Photo,
allowsLandscape: true,
singleSelect: false
)

}

Can we have an intermediate view for Camera

Can we have an intermediate view where the picture taken from camera will be shown along with the Accept and Cancel as the available options so that the user can discard the pic if see any issue with that

App crash when click on group button

Step to reproduce:
1. Open DKImagePickerController
2. Leave the app and open Photos app. Create or delete a album
3. Back to the application and tap on group button ==> app crash.

crash in iphone 6

hi
i have selected 20 images and each image size like 1.5 to 3 mb .after select 20 images it will show received memory warning and crash

It crashed

Hi,

Thanks for sharing wonderful library. I have just installed on my phone and it was crash when you choose photos only option from examples.

in DKAsset:
self.thumbnailImage = UIImage(CGImage:originalAsset.thumbnail().takeRetainedValue())

with error message "fatal error: unexpectedly found nil while unwrapping an Optional value"

Not sure what is reason but when I tried to open camera it was asking me permission but when it was allowed it was crashed again. No debug statment generated that time.

Let me know if you need more information for this issues.

Thanks
Manoj

Cannot get all photos?

Hi . I m facing a problem . When i selected multiple photo e.x 18 photos selected ..It return me less photo instead of all.Here is my code
let pickerController = DKImagePickerController()
var images:[UIImage] = []

pickerController.didSelectAssets = { (assets: [DKAsset]) in
print(assets.count) // This return me exact same value which i select
for asset in assets {
asset.fetchOriginalImageWithCompleteBlock({ (image, info) -> Void in
print(image) //return less images
self.images.append(image!)
print(self.images.count) //Return less images count
})
}
}
self.presentViewController(pickerController, animated: true) {}

can u help me out . Am i wrong someWhere ?

Please Allow Camera Access shows in camera view even if accepted allowing access.

For what it is worth, I'm using the version where you haven't created DKCamera, so I don't know if new versions fix this, but this is a problem I've run into. The only way to get rid of it is to close the app, reopen and then try again.

If I decide not to accept allowing access, I see the prompt again, it takes me to settings, but when I change the settings, then go back to app, the prompt is still there.

Does DKCamera fix this?

Edit: I just checked and DKCamera doesn't seem to have this fixed.

capturing video

If i want to add an option to capture a video, what changes should I make in takePicture method of DKCamera class in order to support this feature ?

How can i convert DkAssets to PHAsset

in my app i m trying to delete selected photos from camera roll . I tried a lot . But could not figure it out. I also tried to take the value from info which is "PHImageFileURLKey" and delete using PHAsset.fetchAssetsWithALAssetURLs ..But its not working..so i wanna try fetchAssetsInAssetCollection which is looking for PHAssets instead of DKAssets....Thanks

convert data and post image in server

i am using DKImagePickerController then i select multipal image in self.assets!
like.[<DKImagePickerControllerDemo.DKAsset: 0x7fe168e34d70>, <DKImagePickerControllerDemo.DKAsset: 0x7fe168d3c020>, <DKImagePickerControllerDemo.DKAsset: 0x7fe168d71980>]
but how to convert data and post image

Cannot use DKAsset.fetchImageWithSize with iCloud photos (Perhaps?)

Is there a way to disallow the user from seeing and selecting iCloud photos in the photo picker? I've discovered a problem when the user selects a photo from their library that hasn't been downloaded to the device yet. I'm not 100% sure that this means the photo is from iCloud and they are only seeing a small thumbnail preview in the picker.

Below are some scenarios to help you understand how I've determined that the failing photo is from iCloud or some other off-device storage.

Test Case 01:

  1. User picks a photo that hasn't been downloaded to device yet.
  2. Eventually my code will call "fetchImageWithSize" with a bounds of w:1200.0 and h:1200.0
  3. The UIImage that is expected is "nil"

Test Case 02:

  1. First I went to the Photo library outside of my app and found a photo
  2. I zoomed into the photo and noticed a circular loading icon in the bottom right hand corner of the image - I am guessing this means the image is downloading from iCloud???
  3. User opens my app, initiates the DKPicker and selects the same photo from (1 & 2)
  4. My code will call "fetchImageWithSize" with a bounds of w:1200.0 and h:1200.0
  5. The UIImage that is expected is set correctly and is not "nil"

Everything else has been great BTW! Nice work!

Can I use this from Objective-C?

Im just finding new ImagePicker controller and I found yours is very cool one. Is there any advice to use it from obj-c ?

Thx a lot.
// sry for my bad Eng and Knowledge.

didSelectAssets block is called twice.

I am using DKImagePickerController with all of the default settings.

After opening the picker, I select the camera button, then take a photo. This calls the didSelectAssets block when the camera is dismissed. Then when I select the 'done' button, didSelectAssets is called again.

In my didSelectAssets block, I am appending the new images to my array, and because didSelectAssets is called twice, a copy of the photo from the camera is added to my array.

I advocate that didSelectAssets only be called once when the picker is dismissed. That way duplicates are not created if appending to an array, or resetting the array.

Getting the name of the image.

I am trying out your wonderful ImagePicker in my new project. I am allowing users to select multiple images & hence in turn,when they select the images *I want to display the user the name of the images. How can I achieve that? *

Allow selection of no photos, like Facebook application does

Right now, if I select zero photos, the select button goes away and only cancel is available.

If the user already has photos selected and would like to remove all selected photos, I'd like to be able to select zero photos and push Done. This is the current functionality in the Facebook iOS application, and I'd love to see that functionality make it's way into this library.

Thanks!

Video Thumbnails

Hello,

This is not issue, just suggestion.

In system controller, there is a little camera icon and video duration bottom of the video thumbnails. Is it possible to do that with DKImagePickerController?

Problem when show more than one time the picker

I have a problem with the second and next times after first execution of picker, the problem occurs with this picker configuration:

let pickerController = DKImagePickerController()
pickerController.allowMultipleTypes = false
pickerController.assetType = .allPhotos
pickerController.singleSelect = true
pickerController.maxSelectableCount = 1

The next executions of the code increases the assets in pickerController.didSelectAssets = { [unowned self] (assets: [DKAsset]) in with the previous asset or assets...

I can't get data from assets in new version

With the new version (3.0.0) I can't get NSData from assets... If I do this:

assets.first!.fetchImageWithSize(sender.view!.bounds.size, completeBlock: {
          (image: UIImage?) -> Void in

           if let imageToSave = image {
                   let data: NSData = UIImageJPEGRepresentation(imageToSave, 0.7) //data always nil
                    self.saveImage(data!)
        }
}

data is always nil an image never is nil... What is the problem?

Twitter Like Implementation

Hello, Can anyone assist me in using this to create a twitter like post view controller where the image picker loads under the post option and once the image picker view is swiped up the image picker loads fully
img_1181

Change Default Folder

Is there a way to change the default album to be displayed. That is, I want the Camera Roll to be the first thing a user sees.

CompleteBlock executes twice

Another issue is this method... the code inside block executes twice for each asset...

image.fetchFullScreenImageWithCompleteBlock({
        (image: UIImage?) -> Void in
       //code here executes twice for each asset
})

Original Picture

Hello, my question is about the pic, in the example select but is a thumbnail (low quality and small), How to select the image, video original from the library or camera?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.