GithubHelp home page GithubHelp logo

hryk224 / iphotobrowser Goto Github PK

View Code? Open in Web Editor NEW
18.0 2.0 7.0 56.26 MB

A simple iOS Instagram photo browser written in Swift.

License: MIT License

Ruby 0.67% Swift 98.79% Objective-C 0.54%
image-gallery swift cocoapods

iphotobrowser's Introduction

IPhotoBrowser

A simple iOS photo browser written in Swift.

CocoaPods Compatible Swift 3.0

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

License

This project is made available under the MIT license. See LICENSE file for details.

iphotobrowser's People

Contributors

hryk224 avatar tamanyan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.