GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - netguru/CarLensCollectionViewLayout: An easy-to-use Collection View Layout for card-like animation.

This repository was archived by the owner on Oct 18, 2022. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

74 Commits
74 Commits

Folders and files

NameName
Last commit message
Last commit date
CarLensCollectionViewLayout.xcodeproj
CarLensCollectionViewLayout.xcodeproj
 
 
CarLensCollectionViewLayout
CarLensCollectionViewLayout
 
 
CarLensCollectionViewLayoutDemo
CarLensCollectionViewLayoutDemo
 
 
.gitignore
.gitignore
 
 
CarLensCollectionViewLayout.podspec
CarLensCollectionViewLayout.podspec
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
bitrise.yml
bitrise.yml
 
 

Repository files navigation

CarLensCollectionViewLayout

An easy-to-use Collection View Layout for card-like animation ๐ŸŽ‰

CarLensCollectionViewLayout was created out of the implementation in CarLens application ๐Ÿš˜. The image above exactly shows the screen from the app!

Requirements

CarLensCollectionViewLayout is written in Swift 4.2 and supports iOS 9.0+.

Usage

Basic Usage

The two main steps are needed for the configuration of CarLensCollectionViewLayout:

Step 1

Assign CarLensCollectionViewLayout to yours collection view layout:

collectionView.collectionViewLayout = CarLensCollectionViewLayout()

or initialize your collection view with CarLensCollectionViewLayout:

UICollectionView(frame: .zero, collectionViewLayout: CarLensCollectionViewLayout())

Step 2

Subsclass CarLensCollectionViewCell and call configure(topView: UIView, cardView: UIView) during the cellโ€™s initialization:

class CollectionViewCell: CarLensCollectionViewCell {
    override init(frame: CGRect) {
	super.init(frame: frame)
	configure(topView: upperView, cardView: bottomView)
    }
}

The sample implementation is available in Demo project.

Customization

Layout

You can also initialize CarLensCollectionViewLayout with a CarLensCollectionViewLayoutOptions object by passing any of the parameters available. Others will be configured automatically.

Parameters:

minimumSpacing - A minimum spacing between cells.

decelerationRate - A deceleration for a scroll view.

shouldShowScrollIndicator - A value indicating whether collection view should have a scroll indicator.

itemSize - The size to use for cells.

Example:

let options = CarLensCollectionViewLayoutOptions(minimumSpacing: 40)
collectionView.collectionViewLayout = CarLensCollectionViewLayout(options: options)

Cell

While subsclassing CarLensCollectionViewCell you can call configure(...) with an additional parameter topViewHeight. The card view height will be calculated based on this value.

Example:

class CollectionViewCell: CarLensCollectionViewCell {
    override init(frame: CGRect) {
	super.init(frame: frame)
	configure(topView: upperView, cardView: bottomView, topViewHeight: 300)
    }
}

Installation

CocoaPods

If you're using CocoaPods, add the following dependency to your Podfile:

use_frameworks!
pod 'CarLensCollectionViewLayout', '~> 1.2.0'

Carthage

If you're using Carthage, add the following dependency to your Cartfile:

github "netguru/CarLensCollectionViewLayout" ~> 1.2.0

About

This project is made with โค๏ธ by Netguru and maintained by Anna-Mariia Shkarlinska.

License

CarLensCollectionViewLayout is licensed under the MIT License. See LICENSE.md for more info.

Read More

  • Introducing CarLensCollectionViewLayout - a New Open Source iOS Tool by Netguru
  • How We Built CarLens
  • Increasing the Accuracy of the Machine Learning Model in CarLens

Related Links

  • CarLens Page
  • CarLens iOS
  • CarLens in App Store
  • CarLens Android
  • CarLens on Google Play

About

An easy-to-use Collection View Layout for card-like animation.

www.netguru.com/codestories/introducing-carlenscollectionviewlayout-a-new-open-source-ios-tool-by-netguru

Topics

animationcardscollectionviewcollectionviewflowlayoutcollectionviewlayoutflowlayoutiosios-swiftiphoneswiftswift4uiuicollectionviewuicollectionviewflowlayoutuicollectionviewlayout

Resources

Readme
MIT license
Activity
Custom properties

Stars

540 stars

Watchers

1 watching

Forks

39 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.