awkward / Tatsi

A drop-in replacement for UIImagePickerController with the ability to select multiple images and/or videos
MIT License
110 stars 30 forks source link

Last selected album or library #41

Closed ravivlb closed 4 years ago

ravivlb commented 4 years ago

How to keep last selected album or library

renssies commented 4 years ago

Good question! It is possible to open the picker onto a certain album with the following code:

let collection = self.lastCollection // This is a PHAssetCollection which you retreive from PhotosKit
var config = TatsiConfig.default
config.firstView = .album(collection)
let pickerViewController = TatsiPickerViewController(config: config)
pickerViewController.pickerDelegate = self
self.present(pickerViewController, animated: true, completion: nil)

However, now that you ask this question, Tasti doesn't return the current album the user has selected.

I'm working on adding a delegate method that communicates which album the user has selected so you can retain that information.

renssies commented 4 years ago

I have just pushed the change to the repository and Cocoapods repo. Version 1.2 should contain the delegate method that gives you the user's selected album.

I've also added the retaining of the last selected album to the example.