Giter Club home page Giter Club logo

tlphotopicker's Introduction

Version License Platform Swift

Written in Swift 5.0

TLPhotoPicker enables application to pick images and videos from multiple smart album in iOS, similar to the current facebook app.

Demo ๐Ÿ™‰

Facebook Picker TLPhotoPicker
Facebook Picker TLPhotoPicker

Features

  • support smart album collection.
    • camera roll, selfies, panoramas, favorites, videos, custom users album
  • selected order index.
  • playback video and live photos.
    • just one. playback first video or live Photo in bounds of visible cell.
  • display video duration.
  • async phasset request and displayed cell.
    • scrolling performance is better than facebook in displaying video assets collection.
  • custom cell
  • custom display and selection rules
  • reload of changes that occur in the Photos library.
  • support iCloud Photo Library
  • adds long press preview to images. ( to @smeshko ) Preview
Smart album collection LivePhotoCell VideoPhotoCell PhotoCell CustomCell(instagram)
Facebook Picker LivePhotoCell VideoPhotoCell PhotoCell PhotoCell

Custom Camera Cell

Live CameraCell
Like Line

Installation

Requirements

  • Swift 5.0 ( Swift 4.2 -> use 'version 1.8.3' )
  • iOS 9.1 (for use live photos)

Cocoapods

TLPhotoPicker is available through CocoaPods. To install it, simply add the following line to your Podfile:

platform :ios, '9.1'
pod "TLPhotoPicker"

Carthage

Carthage is a simple, decentralized dependency manager for Cocoa.

Specify TLPhotoPicker into your project's Cartfile:

github "tilltue/TLPhotoPicker"

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. It is in early development, but TLPhotoPicker does support its use on supported platforms.

Once you have your Swift package set up, adding Alamofire as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/tilltue/TLPhotoPicker.git", .upToNextMajor(from: "2.1.0"))
]

Don't forget the Privacy Description in info.plist.

iOS 14 You can suppress the automatic prompting from the system by setting this key to yes in your apps info plist. PHPhotoLibraryPreventAutomaticLimitedAccessAlert = YES https://developer.apple.com/videos/play/wwdc2020/10641/

Usage

use delegate

You can choose delegate method or closure for handle picker event.

class ViewController: UIViewController,TLPhotosPickerViewControllerDelegate {
    var selectedAssets = [TLPHAsset]()
    @IBAction func pickerButtonTap() {
        let viewController = TLPhotosPickerViewController()
        viewController.delegate = self
        var configure = TLPhotosPickerConfigure()
        //configure.nibSet = (nibName: "CustomCell_Instagram", bundle: Bundle.main) // If you want use your custom cell..
        self.present(viewController, animated: true, completion: nil)
    }
    //TLPhotosPickerViewControllerDelegate
    func shouldDismissPhotoPicker(withTLPHAssets: [TLPHAsset]) -> Bool {
        // use selected order, fullresolution image
        self.selectedAssets = withTLPHAssets
	return true
    }
    func dismissPhotoPicker(withPHAssets: [PHAsset]) {
        // if you want to used phasset. 
    }
    func photoPickerDidCancel() {
        // cancel
    }
    func dismissComplete() {
        // picker viewcontroller dismiss completion
    }
    func canSelectAsset(phAsset: PHAsset) -> Bool {
        //Custom Rules & Display
        //You can decide in which case the selection of the cell could be forbidden. 
    }
    func didExceedMaximumNumberOfSelection(picker: TLPhotosPickerViewController) {
        // exceed max selection
    }
    func handleNoAlbumPermissions(picker: TLPhotosPickerViewController) {
        // handle denied albums permissions case
    }
    func handleNoCameraPermissions(picker: TLPhotosPickerViewController) {
        // handle denied camera permissions case
    }
}

use closure

    init(withPHAssets: (([PHAsset]) -> Void)? = nil, didCancel: ((Void) -> Void)? = nil)
    init(withTLPHAssets: (([TLPHAsset]) -> Void)? = nil, didCancel: ((Void) -> Void)? = nil)
    var canSelectAsset: ((PHAsset) -> Bool)? = nil
    var didExceedMaximumNumberOfSelection: ((TLPhotosPickerViewController) -> Void)? = nil
    var handleNoAlbumPermissions: ((TLPhotosPickerViewController) -> Void)? = nil
    var handleNoCameraPermissions: ((TLPhotosPickerViewController) -> Void)? = nil
    var dismissCompletion: (() -> Void)? = nil
class ViewController: UIViewController,TLPhotosPickerViewControllerDelegate {
    var selectedAssets = [TLPHAsset]()
    @IBAction func pickerButtonTap() {
        let viewController = TLPhotosPickerViewController(withTLPHAssets: { [weak self] (assets) in // TLAssets
            self?.selectedAssets = assets
        }, didCancel: nil)
        viewController.didExceedMaximumNumberOfSelection = { [weak self] (picker) in
            //exceed max selection
        }
        viewController.handleNoAlbumPermissions = { [weak self] (picker) in
            // handle denied albums permissions case
        }
        viewController.handleNoCameraPermissions = { [weak self] (picker) in
            // handle denied camera permissions case
        }
        viewController.selectedAssets = self.selectedAssets
        self.present(viewController, animated: true, completion: nil)
    }
}

Custom Cell Custom Cell must subclass TLPhotoCollectionViewCell

class CustomCell_Instagram: TLPhotoCollectionViewCell {

}

//If you want custom camera cell?
//only used camera cell
[Sample](https://github.com/tilltue/TLPhotoPicker/blob/master/Example/TLPhotoPicker/CustomCameraCell.swift)

//Adding the possibility to handle cell display according to a specific conditions
func update(with phAsset: PHAsset)
func selectedCell()
func willDisplayCell()
func endDisplayingCell()

Custom Rules & Display

You can implement your own rules to handle the cell display. You can decide in which case the selection of the cell could be forbidden.

For example, if you want to disable the selection of a cell if its width is under 300, you can follow these steps:

  • Override the update method of your custom cell and add your own display rule
override func update(with phAsset: PHAsset) {
    super.update(with: phAsset)
    self.sizeRequiredOverlayView?.isHidden = !(phAsset.pixelHeight <= 300 && phAsset.pixelWidth <= 300)
}

In this code, we show an overlay when the height and width required values are not satisified.

  • When you instanciate a TLPhotosPickerViewController subclass, you can pass a closure called canSelectAsset to handle the selection according to some rules. ( or delegate)
//use delegate 
public protocol TLPhotosPickerViewControllerDelegate: class {
    ...
    func canSelectAsset(phAsset: PHAsset) -> Bool
    ...
}

extension UserViewController: TLPhotosPickerViewControllerDelegate {
    func canSelectAsset(phAsset: PHAsset) -> Bool {
        if asset.pixelHeight < 100 || asset.pixelWidth < 100 {
            self?.showUnsatisifiedSizeAlert(vc: viewController)
            return false
        }
        return true
    }
}

//or use closure
viewController.canSelectAsset = { [weak self] asset -> Bool in
    if asset.pixelHeight < 100 || asset.pixelWidth < 100 {
        self?.showUnsatisifiedSizeAlert(vc: viewController)
        return false
    }
    return true
}

In this code, we show an alert when the condition in the closure are not satisfiied.

TLPHAsset

public struct TLPHAsset {
    public enum AssetType {
        case photo,video,livePhoto
    }
    // phasset 
    public var phAsset: PHAsset? = nil
    // selected order index
    public var selectedOrder: Int = 0
    // asset type
    public var type: AssetType
    // get full resolution image 
    public var fullResolutionImage: UIImage?
    // get photo file size (async)
    public func photoSize(options: PHImageRequestOptions? = nil ,completion: @escaping ((Int)->Void), livePhotoVideoSize: Bool = false)
    // get video file size (async)
    public func videoSize(options: PHVideoRequestOptions? = nil, completion: @escaping ((Int)->Void))
    // get async icloud image (download)
    @discardableResult
    public func cloudImageDownload(progressBlock: @escaping (Double) -> Void, completionBlock:@escaping (UIImage?)-> Void ) -> PHImageRequestID?
    // get original media file async copy temporary media file ( photo(png,gif...etc.) and video ) -> Don't forget, You should delete temporary file.
    // parmeter : convertLivePhotosToJPG
    // false : If you want mov file at live photos
    // true  : If you want png file at live photos ( HEIC )
    public func tempCopyMediaFile(videoRequestOptions: PHVideoRequestOptions? = nil, 
                                  imageRequestOptions: PHImageRequestOptions? = nil,
                                  livePhotoRequestOptions: PHLivePhotoRequestOptions? = nil,
                                  exportPreset: String = AVAssetExportPresetHighestQuality, 
                                  convertLivePhotosToJPG: Bool = false, 
                                  progressBlock:((Double) -> Void)? = nil, 
                                  completionBlock:@escaping ((URL,String) -> Void)) -> PHImageRequestID?
    //Apparently, This is not the only way to export video.
    //There is many way that export a video.
    //This method was one of them.
    public func exportVideoFile(options: PHVideoRequestOptions? = nil,
                                outputURL: URL? = nil,
                                outputFileType: AVFileType = .mov,
                                progressBlock:((Double) -> Void)? = nil,
                                completionBlock:@escaping ((URL,String) -> Void))
    // get original asset file name
    public var originalFileName: String?
}

Note: convenience export method fullResolutionImage, cloudImageDownload, tempCopyMediaFile, exportVideoFile It's not enough if you wanted to use more complicated export asset options. ( progress, export type, etc..)

Customize

let viewController = TLPhotosPickerViewController()
var configure = TLPhotosPickerConfigure()
viewController.configure = configure

public struct TLPhotosPickerConfigure {
    public var customLocalizedTitle: [String: String] = ["Camera Roll": "Camera Roll"] // Set [:] if you want use default localized title of album
    public var tapHereToChange = "Tap here to change"
    public var cancelTitle = "Cancel"
    public var doneTitle = "Done"
    public var emptyMessage = "No albums"
    public var emptyImage: UIImage? = nil
    public var usedCameraButton = true
    public var usedPrefetch = false
    public var previewAtForceTouch = false
    public var allowedLivePhotos = true
    public var allowedVideo = true
    public var allowedAlbumCloudShared = false
    public var allowedPhotograph = true // for camera : allow this option when you want to take a photos
    public var allowedVideoRecording = true //for camera : allow this option when you want to recording video.
    public var recordingVideoQuality: UIImagePickerControllerQualityType = .typeMedium //for camera : recording video quality
    public var maxVideoDuration:TimeInterval? = nil //for camera : max video recording duration
    public var autoPlay = true
    public var muteAudio = true
    public var preventAutomaticLimitedAccessAlert = true // newest iOS 14
    public var mediaType: PHAssetMediaType? = nil
    public var numberOfColumn = 3
    public var minimumLineSpacing: CGFloat = 5
    public var minimumInteritemSpacing: CGFloat = 5
    public var singleSelectedMode = false
    public var maxSelectedAssets: Int? = nil //default: inf
    public var fetchOption: PHFetchOptions? = nil //default: creationDate
    public var fetchCollectionOption: [FetchCollectionType: PHFetchOptions] = [:] 
    public var singleSelectedMode = false
    public var selectedColor = UIColor(red: 88/255, green: 144/255, blue: 255/255, alpha: 1.0)
    public var cameraBgColor = UIColor(red: 221/255, green: 223/255, blue: 226/255, alpha: 1)
    public var cameraIcon = TLBundle.podBundleImage(named: "camera")
    public var videoIcon = TLBundle.podBundleImage(named: "video")
    public var placeholderIcon = TLBundle.podBundleImage(named: "insertPhotoMaterial")
    public var nibSet: (nibName: String, bundle:Bundle)? = nil // custom cell
    public var cameraCellNibSet: (nibName: String, bundle:Bundle)? = nil // custom camera cell
    public var fetchCollectionTypes: [(PHAssetCollectionType,PHAssetCollectionSubtype)]? = nil
    public var groupByFetch: PHFetchedResultGroupedBy? = nil // cannot be used prefetch options
    public var supportedInterfaceOrientations: UIInterfaceOrientationMask = .portrait
    public var popup: [PopupConfigure] = []
    public init() {
    }
}

//Related issue: https://github.com/tilltue/TLPhotoPicker/issues/201
//e.g.
//let option = PHFetchOptions()
//configure.fetchCollectionOption[.assetCollections(.smartAlbum)] = option
//configure.fetchCollectionOption[.assetCollections(.album)] = option
//configure.fetchCollectionOption[.topLevelUserCollections] = option

public enum FetchCollectionType {
    case assetCollections(PHAssetCollectionType)
    case topLevelUserCollections
}

public enum PopupConfigure {
    //Popup album view animation duration
    case animation(TimeInterval)
}

// PHFetchedResultGroupedBy
//
// CGrouped by date, cannot be used prefetch options
// take about few seconds ( 5000 image iPhoneX: 1 ~ 1.5 sec ) 
public enum PHFetchedResultGroupedBy {
    case year
    case month
    case week
    case day
    case hour
    case custom(dateFormat: String)
}

//customizable photos picker viewcontroller
class CustomPhotoPickerViewController: TLPhotosPickerViewController {
    override func makeUI() {
        super.makeUI()
        self.customNavItem.leftBarButtonItem = UIBarButtonItem.init(barButtonSystemItem: .stop, target: nil, action: #selector(customAction))
    }
    func customAction() {
        self.dismiss(animated: true, completion: nil)
    }
}

//for log
public protocol TLPhotosPickerLogDelegate: class {
    func selectedCameraCell(picker: TLPhotosPickerViewController)
    func deselectedPhoto(picker: TLPhotosPickerViewController, at: Int)
    func selectedPhoto(picker: TLPhotosPickerViewController, at: Int)
    func selectedAlbum(picker: TLPhotosPickerViewController, title: String, at: Int)
}

//for collection supplement view 
let viewController = TLPhotosPickerViewController()
viewController.customDataSouces = CustomDataSources() // inherit TLPhotopickerDataSourcesProtocol

public protocol TLPhotopickerDataSourcesProtocol {
    func headerReferenceSize() -> CGSize
    func footerReferenceSize() -> CGSize
    func registerSupplementView(collectionView: UICollectionView)
    func supplementIdentifier(kind: String) -> String
    func configure(supplement view: UICollectionReusableView, section: (title: String, assets: [TLPHAsset]))
}

Author

Does your organization or project use TLPhotoPicker? Please let me know by email.

wade.hawk, [email protected]

License

TLPhotoPicker is available under the MIT license. See the LICENSE file for more info.

tlphotopicker's People

Contributors

5stralia avatar abhishekfk avatar aliabbas90 avatar ariiyu avatar azone avatar bradykzg avatar chloe202 avatar chrismaddern avatar danqing avatar dataich avatar elonpark avatar ephemera avatar fra3il avatar graemeharrison avatar intmain avatar intoxicated avatar jakeatsportsyou avatar jihyuns1217 avatar jimsmithm3 avatar jpang1 avatar juyeonyu avatar mahdi-asal avatar marciliojrs avatar microbee23 avatar mknippen avatar odyflame avatar quentinfasquel avatar tilltue avatar tiny2n avatar woookdev 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

tlphotopicker's Issues

Image always nil on real device

When using pod on simulator, code work like charm but when using on real device fullResolutionImage is always nil.
I've been working on this for 3 hours ... and i'm going nowhere do you have a solution for this ?

PS: I'm using iPhone 7+ with iOS 11.1

func dismissPhotoPicker(withTLPHAssets: [TLPHAsset]) {
        if withTLPHAssets.count != 0 {
            let asset = withTLPHAssets[0]

            if asset.type == .photo || asset.type == .livePhoto {
                self.photoArray[self.selectedRow] = asset.fullResolutionImage
            }

            self.refreshUI()
        }
    }

How to use embedded in a ViewController

I would like to use the TLPhotoPicker in a ViewController within a defined view frame instead of modal display in a separate ViewController. I think what I would like is to use the TLAlbumPopView in a view container in the ViewController that I'm developing.

The result I'm looking for is to have 2 main views on the ViewController. One that will display the results of what the user picked (plus some other features) and the Album view.

I tried embedding the TLPhotosPickerViewController in the ViewController but the images were small and blurry. Plus the nav bar is also embedded. Just curious on how I can use the TLAlbumPopView or embed the TLPhotosPickerViewController with some customization.

Cancelling Image Picker submits change on the Image Picker instance

Select 3 photos, press Done.

Open Image Picker again, deselect 1 photo, and Cancel.

Open Image Picker again, it should be 3 photos, but it has changed to 2


Same with the opposite scenario.

Open Image Picker, select 3 photos, and Cancel.

Open Image Picker again, there are 3 photos already selected.

///

Just wanted to point this case out to you. This is only in the case where the view controller presenting the image picker is holding a reference to the image picker. You show your code instantiating a new image picker each time so this wouldn't happen in your example code.

You can close this issue if you intended to never instantiate and hold a reference within the calling view controller.

iCloud Photo Library

It looks as if photos are not loaded from iCloud Photo Library. It only works if I open the photo in photos app first and download the original photo. After that I can select it in TLPhotoPicker.

Is it possible to get the images path?

I want to upload the images I get to the Firebase, and based on Firebase docs, I need to get the images location on the device.

How can I get the path of the selected images in var selectedAssets = [TLPHAsset]()?
I went through the methods of selectedAssets, i could find functions like selectedAssets.count and selectedAssets[0].originalFileName but nothing were related to the file path.

How can I get the files path in the device?

Any guidance will be appreciated

Cropping pictures

Hi!! I liked TLPhotoPicker, but I need to be able to crop pictures... Do you have any intention to add this feature?

How to reload photoPicker ViewController after take photo?

What I need is tapping camera cell in photopicker controller to take a photo, and display it in photopicker after tap done button in camera view.

I try to override function
imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]), and call self.reloadCollectionView() method inside. But it doesn't work, new photos doesn't display. Any idea? Thanks.

iPad Support

Hi, just wondering to know, is it support iPad?

Crash when use camera

Preconditions:

  1. Instantiate TLPhotosPickerConfigure with parameter includeVideos: false
  2. Take a picture from Camera
  3. Crash

Can not display images

When I use the TLPhotosPickerViewController or custom controller ,they all can not display any images ,Only I deleted the app and reinstall could be display once ,after dismiss the controller ,re presnet the pickerViewcontroller could not display amy images.

I dont know what it is the problem , but your demo could run normally .

Support for Objective C projects.

Is it possible to support the integration of TLPhotoPicker with Objective C projects as well? We are unable to use TLPHAssets in Objective C class because it is a struct and Swift structs are not accessible via Objective C classes.

How to perform segue after the user clicks "Done"?

I want to segue to another view after the user chooses the pictures. Is it possible to do this after the user clicks on "Done"?

I tried the following:

self.present(viewController, animated: true, completion: { () in
                print("Testing...")
                self.performSegue(withIdentifier: "locationMap", sender: self)
            })

it prints "Testing" to the console once the @IBAction Button is clicked.

When I tried to use the function dismissComplete as follows:

  func dismissComplete() {
        print("dismissComplete")
    }

nothing is printed to the console.

Does the library offer a way to perform segue once the user press "Done" ? if yes, how is it done?

How can you start in the videos section

Hi, thank you so much for doing this framework.

I was wondering how can I present the viewcontroller not in the photos section but in the Videos one?

Thank you.

iOS Development Target

Does it support the iOS 8.0 and Swift 3.0? We don't use "live photos" service. Thanks.

Picker auto-plays videos with sound

Picker auto-plays videos as they are selected in the thumbnail state, which I don't mind and I think is configurable anyways. However the audio plays as well, and I don't see any audio related configuration in the Configuration structure? Please advise. Thanks!

is downloading a video from ICloud Supported ?

I am using ICloud to store my old videos in camera roll. I don't see a method for getting video from ICloud. I only see cloudImageDownload(progressBlock: @escaping (Double) -> Void, completionBlock:@escaping (UIImage?)-> Void ) -> PHImageRequestID?

Please let me know how I can download cloud video.

New config options

Hi, this is an awesome component.
Can you add some options like: support to record video, maxVideoDuration (in video record and in video selection with duration predicate)?

Thanks

Please adjust dismiss method should be process beside completion

fileprivate func dismiss(done: Bool) {
self.dismiss(animated: true) {
if done {
self.delegate?.dismissPhotoPicker(withPHAssets: self.selectedAssets.flatMap{ $0.phAsset })
self.delegate?.dismissPhotoPicker(withTLPHAssets: self.selectedAssets)
self.completionWithTLPHAssets?(self.selectedAssets)
self.completionWithPHAssets?(self.selectedAssets.flatMap{ $0.phAsset })
}else {
self.delegate?.photoPickerDidCancel()
self.didCancel?()
}
}
}

Can't get the real size of videos in album?

In TLPHAsset struct, I find a function named videoSize(options:,completion:((Int)->Void)) , which is to get video size of PHAsset, but I find the sizes of videos are -1 after calling it.
After checking the function, I find the url is always nil, that is to say neither of the if nor the else branch is entered.

BTW
plateforms are Xcode 9.2 and iOS 11.2.

App crashes when switching to video recording mode.

The app crashes when we select video recording from the library in the sample project. You have to add Microphone access permission in the .plist file.

Here is the crash log

"This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSMicrophoneUsageDescription key with a string value explaining to the user how the app uses this data."

Can you add 'pushToViewController' delegate method after select images?

Hi tilltue,

First, thank you for your awewome work!
Actual this is not a issue. All I need is push to my customer view controller after tap done button of photo picker, but now we can dismiss the picker only. Could you please add a delegate method to implement push to my custom View Controller with PHAsset array? Thanks.

nil UI after allowing app to access photos

I'm hitting a fatal error: unexpectedly found nil while unwrapping an Optional value after allowing the app to access photos.

screen shot 2017-09-19 at 11 34 02 am

screen shot 2017-09-19 at 11 35 25 am

I'm opening it using the example code in the readme from a button tap. Also if I re-run the app, everything works fine.

Any thoughts?

Crash when switch to video mode

screen shot 2017-12-12 at 15 44 57

I added all privacy in info.plist but the problem still here. All config which i had included to the project I cited below
    var config = TLPhotosPickerConfigure()
    config.maxSelectedAssets = pickLimit
    config.allowedVideo = true
    config.allowedVideoRecording = true
    config.selectedColor = UIColor(r: 230, g: 95, b: 95)
    config.cancelTitle = "ui.common.cancel".localized
    config.doneTitle = "ui.common.add".localized
    config.tapHereToChange = "ui.gallery.tap-here.button".localized
    self.configure = config
    
    self.delegate = self

Getting Video File

Could you help me get the URL for when they select a video file.

I am trying to upload the selected video to my backend (Firebase), and currently I can't seem to figure out how to get the file URL for the selected video.

Is there something similar to
public var fullResolutionImage: UIImage? {
get {
guard let phAsset = self.phAsset else { return nil }
return TLPhotoLibrary.fullResolutionImageData(asset: phAsset)
}
}

That can be accessed within dismissPhotoPicker(withTLPHAssets:) so I can get the URL for the video I selected? Or am I going about this the wrong way.

Single Select Mode

Is it possible to configure a single selection mode? I found out that it can be partially achieved by configure.maxSelectedAssets = 1. But single selection mode means that when a user taps on a new photo, the newer photo will get selected (and old selected photo will get deselected) without alerting any error.

How to allow only Video

How to allow only video. I don't have to show photo but only video?

By the below code i can restrict video.
viewController.configure.allowedVideo = false

is there any method like this so that i can restrict Photo

Thanks

Add TLPhotosPickerViewController Subclass Support

Since init(coder) is not implemented, I can't customize the xib to replace the navigation bar with my custom one. It would be nice to have the option to subclass (with a custom xib). I can't find any other way to adjust the navigation bar. Also the titleView should be a button instead of a view with a tap gesture.

required public init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
}

Video file with size limitation

Hi, thanks for you to share this library.
I found that I can choose videos with duration limitation.
Would you like to let me know if it is possible to pick videos by size limitation?
eg. I want to choose videos which is smaller than 10 MB...
I'll appreciate if you can help me.
Thanks again.

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.