Coder Social home page Coder Social logo

edmundng1 / ybslantedcollectionviewlayout Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yacir/collectionviewslantedlayout

0.0 1.0 0.0 24.35 MB

YBSlantedCollectionViewLayout is a subclass of UICollectionViewLayout allowing the display of slanted content on UICollectionView.

License: MIT License

Swift 91.96% Objective-C 4.01% Ruby 2.86% Shell 1.16%

ybslantedcollectionviewlayout's Introduction

YBSlantedCollectionViewLayout

Version License Platform Carthage compatible Build Status

Overview

YBSlantedCollectionViewLayout is a subclass of UICollectionViewLayout allowing the display of slanted content on UICollectionView.

<img src="https://cloud.githubusercontent.com/assets/2587473/13427516/d9af399e-dfb4-11e5-8109-ae997dc7c340.gif" alt="YBSlantedCollectionViewLayout" title="YBSlantedCollectionViewLayout"> 

Usage

YBSlantedCollectionViewLayout contains six properties to customize the interface.

var slantingDelta: UInt
var reverseSlantingAngle: Bool
var firstCellSlantingEnabled: Bool
var lastCellSlantingEnabled: Bool
var lineSpacing: CGFloat
var scrollDirection: UICollectionViewScrollDirection
var itemSizeOptions: YBSlantedCollectionViewLayoutSizeOptions
  • slantingDelta is the slanting delta. Defaults to 50
  • reverseSlantingAngle allows to reverse the slanting angle if the value is true. By default, this property is set to false
  • firstCellSlantingEnabled allows to enable the slanting for the first cell. By default, this property is set to true
  • lastCellSlantingEnabled allows to enable the slanting for the last cell. By default, this property is set to true
  • lineSpacing is the spacing to use between two items. Defaults to 10.0
  • scrollDirection is the scroll direction. Defaults to UICollectionViewScrollDirectionVertical
  • itemSizeOptions allows to set the item's width/height depending on the scroll direction.

Apply the slanting mask

To apply the slanting mask on the cellView, use the YBSlantedCollectionViewCell or subclass it.

Installation

CocoaPods

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

pod "YBSlantedCollectionViewLayout", '~> 2.1'

Carthage

You can also install it via Carthage. To do so, add the following to your Cartfile:

github 'yacir/YBSlantedCollectionViewLayout'

Roadmap

  • Improve the attribution of the clic
  • Carthage support
  • Tests

Author

Yassir Barchi

Acknowledgement

This framework is inspired by this prototype released by Matt Bridges.

License

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

ybslantedcollectionviewlayout's People

Contributors

yacir avatar

Watchers

 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.