IPhotoBrowser
A simple iOS Instagram photo browser written in Swift.
Install / Use
/learn @hryk224/IPhotoBrowserREADME
IPhotoBrowser
A simple iOS photo browser written in Swift.
<img src="https://github.com/hryk224/IPhotoBrowser/wiki/images/sample1.gif" width="320" > <img src="https://github.com/hryk224/IPhotoBrowser/wiki/images/sample2.gif" width="320" >
<img src="https://github.com/hryk224/IPhotoBrowser/wiki/images/sample3.gif" width="320" > <img src="https://github.com/hryk224/IPhotoBrowser/wiki/images/sample4.gif" width="320" >
Requirements
- iOS 8.0+
- Swift 3.0+
- ARC
install
CocoaPods
Adding the following to your Podfile and running pod install:
use_frameworks!
pod 'IPhotoBrowser'
import
import IPhotoBrowser
Usage
initialize
init(images: [UIImage], start index:Int)
init(imageUrls: [URL], start index:Int)
init(assets: [PHAsset], start index:Int)
init(photos: [IPhoto], start index:Int)
IPhotoBrowserDelegate
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?
Example
let photoBrowser = IPhotoBrowser(images: images, start: 0)
photoBrowser.delegate = self
navigationController?.pushViewController(photoBrowser, animated: true)
or
present(photoBrowser, animated: true, completion: nil)
IPhotoBrowserAnimatedTransitionProtocol
var iPhotoBrowserSelectedImageViewCopy: UIImageView? { get }
var iPhotoBrowserDestinationImageViewSize: CGSize? { get }
var iPhotoBrowserDestinationImageViewCenter: CGPoint? { get }
func iPhotoBrowserTransitionWillBegin()
func iPhotoBrowserTransitionDidEnded()
Entity
IPhoto
struct IPhoto {
let image: UIImage?
let imageUrl: URL?
let asset: PHAsset?
let title: String?
let description: String?
}
Photos from
- by pakutaso.com
License
This project is made available under the MIT license. See LICENSE file for details.
Related Skills
node-connect
353.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
353.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
353.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
