CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

JoGallery 0.1.0

JoGallery 0.1.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Oct 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by django.



JoGallery 0.1.0

  • By
  • django

JoGallery





Example Project

Installation

Usage

Init

let controller = JoGalleryController()
controller.register(JoGalleryCell.self, forCellWithReuseIdentifier: ...)
controller.delegate = ...
controller.dataSource = ...

Show

controller.present(from: VC, toItem: indexPath)

JoGalleryDataSource

func galleryController(_ galleryController: JoGalleryController, numberOfItemsInSection section: Int) -> Int {
    return ...
}

func galleryController(_ galleryController: JoGalleryController, cellForItemAt indexPath: IndexPath) -> JoGalleryCell{

    let cell = galleryController.dequeueReusableCell(withReuseIdentifier: ...), for: indexPath)
    ...
    return cell
}

JoGalleryDelegate

func presentForTransitioning(in galleryController: JoGalleryController, openAt indexPath: IndexPath) -> JoGalleryLocationAttributes? {
    ...
    return (view, content)
}

func dismissForTransitioning(in galleryController: JoGalleryController, closeAt indexPath: IndexPath) -> JoGalleryLocationAttributes? {
    ...
    return (view, content)
}

func galleryBeginTransforming(in galleryController: JoGalleryController, atIndex indexPath: IndexPath) -> UIView? {
    ...
    return locationView
}

func galleryDidEndTransforming(in galleryController: JoGalleryController, atIndex indexPath: IndexPath, with thresholdValue: CGFloat) -> UIView? {
    ...
    return locationView
}

func gallery(_ galleryController: JoGalleryController, scrolDidDisplay cell: JoGalleryCell, forItemAt indexPath: IndexPath, oldItemFrom oldIndexPath: IndexPath) {
    // scroll to location
    ...
}