Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Source/Configuration/YPImagePickerConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public struct YPImagePickerConfiguration {
/// Encapsulates library specific settings.
public struct YPConfigLibrary {

public var options: PHFetchOptions? = nil
public var options: PHFetchOptions? = nil

/// Set this to true if you want to force the library output to be a squared image. Defaults to false
public var onlySquare = false
Expand All @@ -164,7 +164,10 @@ public struct YPConfigLibrary {

/// Choose what media types are available in the library. Defaults to `.photo`
public var mediaType = YPlibraryMediaType.photo


/// Initial state of multiple selection button.
public var defaultMultipleSelection = false

/// Anything superior than 1 will enable the multiple selection feature.
public var maxNumberOfItems = 1

Expand Down
5 changes: 4 additions & 1 deletion Source/Pages/Gallery/YPLibraryVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ public class YPLibraryVC: UIViewController, YPPermissionCheckable {
panGestureHelper.registerForPanGesture(on: v)
registerForTapOnPreview()
refreshMediaRequest()


if YPConfig.library.defaultMultipleSelection {
multipleSelectionButtonTapped()
}
v.assetViewContainer.multipleSelectionButton.isHidden = !(YPConfig.library.maxNumberOfItems > 1)
v.maxNumberWarningLabel.text = String(format: YPConfig.wordings.warningMaxItemsLimit, YPConfig.library.maxNumberOfItems)
}
Expand Down