Swiftpack.co - jaesung-0o0/limited-selectable-photos as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by jaesung-0o0.
jaesung-0o0/limited-selectable-photos 1.0.0
Use `PreselectedPhotoViewController` to handle limited photo access case in your app.
⭐️ 5
🕓 2 weeks ago
iOS
.package(url: "https://github.com/jaesung-0o0/limited-selectable-photos.git", from: "1.0.0")

PreselectedPhotoUI

Use PreselectedPhotoViewController to handle limited photo access case in your app.

Overview

Supports

  • iOS 14.0 or later

How to use?

IMPORTANT

Don't forget to add Privacy - Photo Library Usage Description to info.plist

let vc = PreselectedPhotoViewController()
vc.delegate = self
let nav = UINavigationController(rootViewController: vc)

present(nav, animated: true, completion: nil)
  1. Conform to PreselectedPhotoViewDelegate.
// ViewController.swift
class ViewController: UIViewController, PreselectedPhotoViewDelegate { 
    func didTapSendImageData(_ data: Data) {
        // process image data
    }
    
    func didTapSendVideoURL(_ url: URL) {
        // process video url
    }
}
  1. Ready to show PreselectedPhotoViewController
// ViewController.swift
func showLimitedPhotoLibraryPicker() {
    PreselectedPhotoViewController.StringSet.viewLibrary = "{your_own_title}"
    let selectablePhotoVC = PreselectedPhotoViewController()
    selectablePhotoVC.delegate = self
    let nav = UINavigationController(rootViewController: selectablePhotoVC)
    self.present(nav, animated: true, completion: nil)
}
  1. Connect showLimitedPhotoLibraryPicker() method to your button action
// ViewController.swift
@IBAction func didTapPhotoSelection() {
    showLimitedPhotoLibraryPicker()
}

GitHub

link
Stars: 5
Last commit: 2 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

2 weeks ago

🚀 Jun 14 (Tue)

🎉 PreselectedPhotoUI has been released! Use PreselectedPhotoViewController to handle limited photo access case in your app.

import PreselectedPhotoUI
let vc = PreselectedPhotoViewController()
vc.delegate = self
let nav = UINavigationController(rootViewController: vc)

present(nav, animated: true, completion: nil)

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics