A simple iOS photo browser written in Swift.
- iOS 8.0+
- Swift 3.0+
- ARC
Adding the following to your Podfile
and running pod install
:
use_frameworks!
pod 'IPhotoBrowser'
import IPhotoBrowser
init(images: [UIImage], start index:Int)
init(imageUrls: [URL], start index:Int)
init(assets: [PHAsset], start index:Int)
init(photos: [IPhoto], start index:Int)
func iPhotoBrowser(_ iPhotoBrowser: IPhotoBrowser, didChange index: Int)
// Dismiss
@objc optional func iPhotoBrowserDidDismissing(_ iPhotoBrowser: IPhotoBrowser)
@objc optional func iPhotoBrowserDidCanceledDismiss(_ iPhotoBrowser: IPhotoBrowser)
// Pop
@objc optional func iPhotoBrowserDidPop(_ iPhotoBrowser: IPhotoBrowser)
@objc optional func iPhotoBrowserDidCanceledPop(_ iPhotoBrowser: IPhotoBrowser)
/// This screenshot is used for pop transitions.
/// Used background image to IPhotoBrowser.
@objc optional func iPhotoBrowserMakeViewScreenshotIfNeeded(_ iPhotoBrowser: IPhotoBrowser) -> UIImage?
let photoBrowser = IPhotoBrowser(images: images, start: 0)
photoBrowser.delegate = self
navigationController?.pushViewController(photoBrowser, animated: true)
or
present(photoBrowser, animated: true, completion: nil)
var iPhotoBrowserSelectedImageViewCopy: UIImageView? { get }
var iPhotoBrowserDestinationImageViewSize: CGSize? { get }
var iPhotoBrowserDestinationImageViewCenter: CGPoint? { get }
func iPhotoBrowserTransitionWillBegin()
func iPhotoBrowserTransitionDidEnded()
IPhoto
struct IPhoto {
let image: UIImage?
let imageUrl: URL?
let asset: PHAsset?
let title: String?
let description: String?
}
- by pakutaso.com
This project is made available under the MIT license. See LICENSE file for details.