Code Monkey home page Code Monkey logo

scaledvisiblecellscollectionview's Introduction

ScaledVisibleCellsCollectionView

CI Status Version License Platform

ScaledVisibleCellsCollectionView is check visible cells position. And setting cell's scale and alpha.

Demo

Horizontal ( center / right / left )

Gif Gif Gif

Vertical ( center / top / bottom )

Gif Gif Gif

Usage

Cocoapods

To run the example project, clone the repo, and run pod install from the Example directory first. Add the following to your Podfile:

  • swift
pod "ScaledVisibleCellsCollectionView"
use_frameworks!
  • swift2.0
pod 'ScaledVisibleCellsCollectionView', :git => "https://github.com/ikemai/ScaledVisibleCellsCollectionView.git", :branch => "swift-2.0"
use_frameworks!

Note: the use_frameworks! is required for pods made in Swift.

Example

  • Set propertis
let collectionView = ScaledVisibleCellsCollectionView(frame: view.bounds)
collectionView.setScaledDesginParam(scaledPattern: .VerticalCenter, maxScale: 1.2, minScale: 0.5, maxAlpha: 1.0, minAlpha: 0.5)
view.addSubview(collectionView)
  • Set scale
func scrollViewDidScroll(scrollView: UIScrollView) {
collectionView.scaledVisibleCells()
}

Variable

  • Set Scroll direction & position is the most large cell
private var scaledPattern: SC_ScaledPattern = .VerticalCenter
public enum SC_ScaledPattern {
case HorizontalCenter
case HorizontalLeft
case HorizontalRight
case VerticalCenter
case VerticalBottom
case VerticalTop
}
  • Set Scale
private var maxScale: CGFloat = 1.0
private var minScale: CGFloat = 0.5
  • Set Alpha
private var maxAlpha: CGFloat = 1.0
private var minAlpha: CGFloat = 0.5

Function

  • Set property ( * Please always set )
func setScaledDesginParam(scaledPattern pattern: SC_ScaledPattern, maxScale: CGFloat, minScale: CGFloat, maxAlpha: CGFloat, minAlpha: CGFloat)
  • Set scale for visible cells ( * Please call at any time )
func scaledVisibleCells()

Author

ikemai

License

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

scaledvisiblecellscollectionview's People

Contributors

ikemaica avatar

Watchers

Carabineiro 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.