Latest 0.1.1
Homepage https://github.com/bluepi0j/BPPopCardTransition
License MIT
Platforms ios 8.0
Authors

Version
License
Platform

Overview

Overview

Overview

Example

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

Installation

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

pod "BPPopCardTransition"

Usage

Add BPPopCardAnimtionDelegate

class ViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource, BPPopCardAnimtionDelegate
let transitionDelegate:BPPopCardTransitionsDelegate = BPPopCardTransitionsDelegate()
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {

    let cell: ImageCollectionViewCell = collectionView.cellForItem(at: indexPath)! as! ImageCollectionViewCell

    selectedCellFrame = collectionView.convert(cell.frame, to: self.view)
    selectedCellImageView = cell.cellImageView

    let popCardViewController: PopCardViewController = self.storyboard?.instantiateViewController(withIdentifier: "PopCardViewController") as! PopCardViewController

    transitionDelegate.delegate = self

    popCardViewController.transitioningDelegate = transitionDelegate
    popCardViewController.bannerImage = self.selectedCellImageView!.image
    popCardViewController.modalPresentationStyle = .custom
    self.present(popCardViewController, animated: true, completion: nil)

}

// MARK: - BPPopCardAnimtionDelegate
func rectZoomPosition() -> CGRect {
    return selectedCellFrame!
}

func cellImageView() -> UIImageView {
    return selectedCellImageView!
}

func popCardViewBannerHeight() -> CGFloat {
    return CGFloat(267)
}

TODO

  • [ ] Make more generic.

Author

bluepi0j, [email protected]

License

BPPopCardTransition is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "BPPopCardTransition",
    "version": "0.1.1",
    "summary": "Simple iOS11 style card transition",
    "description": "Simple iOS11 style card transition with different design.",
    "homepage": "https://github.com/bluepi0j/BPPopCardTransition",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "bluepi0j": "[email protected]"
    },
    "source": {
        "git": "https://github.com/bluepi0j/BPPopCardTransition.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "Source/**/*",
    "pushed_with_swift_version": "3.2"
}

Pin It on Pinterest

Share This