FLImagePicker - A simple image picker supported multiple selection

Related tags

Image FLImagePicker
Overview

Version Platform License Date

FLImagePicker

A simple image picker supported multiple selection.

demo

Features

  • Multiple selection
  • Gesture supported
  • Dark mode
  • Easy modification

Installation

CocoaPods

pod 'FLImagePicker'

Usage

Basic Usage

let picker = FLImagePicker()
picker.imageDelegation = self
present(vc, animated: true, completion: nil)

You have to implement FLImagePickerDelegate to your viewController.

Delegation

/* triggered by tap */
func flImagePicker(_ picker: FLImagePicker, singleAssetChanged imageAsset: PHAsset, isSelected: Bool)

/* triggered when pan over images, imageAssets show current selected items.*/    
func flImagePicker(_ picker: FLImagePicker, multiAssetsChanged imageAssets: [PHAsset], isSelected: Bool)

/* triggered when reach the maximum of the selection, imageAssets show current selected items.*/
func flImagePicker(_ picker: FLImagePicker, reachMaxSelected imageAssets: [PHAsset])

/* required at implement, call by finish pressed */
func flImagePicker(_ picker: FLImagePicker, didFinished imageAssets: [PHAsset])

/* call by cancel pressed*/
func flImagePicker(didCancelled picker: FLImagePicker)

Get Images

The results of picker are PHAsset format, you can use PHImageManager to get UIImage.

You can read this and this for more Info.

PHImageManager().requestImage(for: PHAsset(),
                                targetSize: PHImageManagerMaximumSize,
                                contentMode: .default,
                                options: nil){ (image, info) in
                                    // ...
                                    // deal with image
                                    // ...
                                }

Options

Settings of FLImagePicker

// images
vc.maxPick = 10 // max selection
vc.numsOfRow = 3 // nums of images in each row

// scrolling
/// The max scrolling speed will be fps * ppm
/// ex. If ppm = 3, fps = 120
/// while reaching to max speed, it will be 3 * 120 = 360(pixel/sec)
vc.fps = 120 // update freq. of scrolling (times/ sec)
vc.ppm = 3 // pixels per move. 

// gesture
/// detectAreaHeight will are start from top and bottom.
/// -------------  
/// |     ^     |
/// |     |     |
/// |    200    |
/// |     |     |
/// |     ⌄     |
/// -------------
/// |           |  <- your phone
/// |           |
/// -------------
/// |     ^     |
/// |     |     |
/// |    200    |
/// |     |     |
/// |     ⌄     |
/// -------------
vc.detectAreaHeight = 200 // gesture detection range

Styles

// default, create FLImagePickerStyle and set vc'style to it.
var style = FLImagePickerStyle()

/* use FLDefaults to get default value */
// nav btn
style.btnColor = FLDefaults.Colors.primary

// selected cover
style.coverColor = FLDefaults.Colors.coverBackground

// check hinter
style.checkImage = FLDefaults.Images.checkImg
style.checkBorderColor = FLDefaults.Colors.checkBorderColor
style.checkBackgroundColor = FLDefaults.Colors.primary


vc.style = style

Add done and cancel to your Localizable.strings for Nav Btn Localization.

Knowing Issue

  • Multi-selection won't be trigger if finger stop moving while scrolling (need to shake a little bit.)

Next feature

  • Photo preview

Author

Allen Lee

License

This project is under MIT License.

You might also like...
📹 Your next favorite image and video picker
📹 Your next favorite image and video picker

Description We all love image pickers, don't we? You may already know of ImagePicker, the all in one solution for capturing pictures and selecting ima

A very useful and unique iOS library to open image picker in just few lines of code.
A very useful and unique iOS library to open image picker in just few lines of code.

ImagePickerEasy A very simple solution to implement UIImagePickerController() in your application. Requirements Swift 4.2 and above Installation Image

FlaneurImagePicker is an iOS image picker that allows users to pick images from different sources (ex: user's library, user's camera, Instagram...).                            It's highly customizable.
FlaneurImagePicker is an iOS image picker that allows users to pick images from different sources (ex: user's library, user's camera, Instagram...). It's highly customizable.

FlaneurImagePicker is a highly customizable iOS image picker that allows users to pick images from different sources (ex: device's library, device's c

📷 A composable image editor using Core Image and Metal.
📷 A composable image editor using Core Image and Metal.

Brightroom - Composable image editor - building your own UI Classic Image Editor PhotosCrop Face detection Masking component 🎉 v2.0.0-alpha now open!

An image download extension of the image view written in Swift for iOS, tvOS and macOS.
An image download extension of the image view written in Swift for iOS, tvOS and macOS.

Moa, an image downloader written in Swift for iOS, tvOS and macOS Moa is an image download library written in Swift. It allows to download and show an

📷 A composable image editor using Core Image and Metal.
📷 A composable image editor using Core Image and Metal.

Brightroom - Composable image editor - building your own UI Classic Image Editor PhotosCrop Face detection Masking component 🎉 v2.0.0-alpha now open!

AsyncImage before iOS 15. Lightweight, pure SwiftUI Image view, that displays an image downloaded from URL, with auxiliary views and local cache.

URLImage URLImage is a SwiftUI view that displays an image downloaded from provided URL. URLImage manages downloading remote image and caching it loca

AYImageKit is a Swift Library for Async Image Downloading, Show Name's Initials and Can View image in Separate Screen.
AYImageKit is a Swift Library for Async Image Downloading, Show Name's Initials and Can View image in Separate Screen.

AYImageKit AYImageKit is a Swift Library for Async Image Downloading. Features Async Image Downloading. Can Show Text Initials. Can have Custom Styles

A complete Mac App: drag an image file to the top section and the bottom section will show you the text of any QRCodes in the image.

QRDecode A complete Mac App: drag an image file to the top section and the bottom section will show you the text of any QRCodes in the image. QRDecode

Releases(0.1.3)
Owner
Allen Lee
Jr. iOS & Android :)
Allen Lee
Example of adding marching ants selection to the edges of the image.

JMCMarchingAnts Library that lets you add marching ants (animated) selection to the edges of the images. Usage: * Copy the JMCMarchingAnts.swift file

Izotx 143 Dec 17, 2022
📷 multiple phassets picker for iOS lib. like a facebook

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

junhyi park 1.8k Jan 2, 2023
FMPhotoPicker is a modern, simple and zero-dependency photo picker with an elegant and customizable image editor

FMPhotoPicker is a modern, simple and zero-dependency photo picker with an elegant and customizable image editor Quick demo Batch select/deselect Smoo

Cong Nguyen 648 Dec 27, 2022
Agrume - 🍋 An iOS image viewer written in Swift with support for multiple images.

Agrume An iOS image viewer written in Swift with support for multiple images. Requirements Swift 5.0 iOS 9.0+ Xcode 10.2+ Installation Use Swift Packa

Jan Gorman 601 Dec 26, 2022
Image slide-show viewer with multiple predefined transition styles, with ability to create new transitions with ease.

ATGMediaBrowser ATGMediaBrowser is an image slide-show viewer that supports multiple predefined transition styles, and also allows the client to defin

null 200 Dec 19, 2022
add text(multiple line support) to imageView, edit, rotate or resize them as you want, then render the text on image

StickerTextView is an subclass of UIImageView. You can add multiple text to it, edit, rotate, resize the text as you want with one finger, then render the text on Image.

Textcat 478 Dec 17, 2022
BeatboxiOS - A sample implementation for merging multiple video files and/or image files using AVFoundation

MergeVideos This is a sample implementation for merging multiple video files and

null 3 Oct 24, 2022
📸 Instagram-like image picker & filters for iOS

YPImagePicker YPImagePicker is an instagram-like photo/video picker for iOS written in pure Swift. It is feature-rich and highly customizable to match

Yummypets 4k Dec 27, 2022
Image picker with custom crop rect for iOS written in Swift (Ported over from GKImagePicker)

WDImagePicker Ever wanted a custom crop area for the UIImagePickerController? Now you can have it with WDImagePicker. Just set your custom crop area a

Wu Di 96 Dec 19, 2022
📸 iMessage-like, Image Picker Controller Provides custom features.

RAImagePicker Description RAImagePicker is a protocol-oriented framework that provides custom features from the built-in Image Picker Edit. Overview O

Rashed Al-Lahaseh 14 Aug 18, 2022