Latest 0.2.0
Homepage https://github.com/lawrnce/PopUpCollectionView
License MIT
Platforms ios 9.0, requires ARC
Authors

Pop-Up Collection View

Pop-Up Collection View is a replacement for the traditional
navigation collection view style and is written in Swift.

Version
License
Platform

Features

  • Coolness
  • Fast and lightweight
  • Preserves content animations (see below)

Usage

Pop-Up Collection View mimics the behavior of a normal collection view. Instantiate via code or in the interface builder. Do not forget to set the delegate and data source.

// Init Pop-Up Collection View
let popUpCollectionView = PopUpCollectionView(frame: CGRectZero)
popUpCollectionView.delegate = self
popUpCollectionView.dataSource = self

Documentation

Variables

var delegate: PopUpCollectionViewDelegate
var dataSource: PopUpCollectionViewDataSource

Methods

func reloadData()

Refreshes Pop-Up Collection View.

Delegate

func popUpCollectionView(popUpCollectionView: PopUpCollectionView, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize

Pop-Up Collection View dynamically sets its cells. This method asks the delegate for the size of the content at the given index path. Put in any size, and Pop-Up Collection View will automatically scale it to fit its layout.

func setStatusBarHidden(hidden: Bool)

Implement this method to hide/reveal the status bar. (See the demo for implementation)

Data Source

func popUpCollectionView(popUpCollectionView: PopUpCollectionView, numberOfItemsInSection section: Int) -> Int

Set the number of items in each section. Note that Pop-Up Collection View works best when there is only one section as section headers are currently not supported.

func popUpCollectionView(popUpCollectionView: PopUpCollectionView, contentViewAtIndexPath indexPath: NSIndexPath) -> UIView

Asks the data source for the content view for a given index path. This can be any implementation of a UIView.

func popUpCollectionView(popUpCollectionView: PopUpCollectionView, infoViewForItemAtIndexPath indexPath: NSIndexPath) -> UIView

Asks the data source for the info view for the given index path. Set the view’s frame to the size for when it is displayed. Pop-Up Collection View will automatically handle scaling.

Preserving Animations

Pop-Up Collection View preserves content animations during transitions. This was tested using FLAnimatedImage.

Note, this does not work with an UIImage extension such as SwiftGif.

Demo

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Swift 3.0+
  • iOS 9.0+

Installation

PopUpCollectionView is available through CocoaPods. To install
it, simply add the following line to your Podfile:

use_frameworks!
pod "PopUpCollectionView"

Roadmap

Pop-Up Collection View is still in beta and should not be considered stable.

Author

Lawrence Tran

License

See the LICENSE file for more info.

Latest podspec

{
    "name": "PopUpCollectionView",
    "version": "0.2.0",
    "summary": "A rethinking of the traditional collection view.",
    "description": "Pop-Up Collection View is a redesign of a collection view with a vertical focus.",
    "homepage": "https://github.com/lawrnce/PopUpCollectionView",
    "license": "MIT",
    "authors": {
        "Lawrence Tran": "[email protected]"
    },
    "source": {
        "git": "https://github.com/lawrnce/PopUpCollectionView.git",
        "tag": "0.2.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This