Skip to content

ximhear/LoopedContentsView

 
 

Repository files navigation

LoopedContentsView

Swift Swift Swift Platform License

환경

xcode8, xcode9 beta2에서 정상적으로 동작.

Swift 4

Swift 4에서 사용하려면 swift4 branch를 이용하세요.

Overview

LoopedContentsView display and handle infinite looped contents. LoopedContentsView can bear very fast scroll!

Usage

Delegate / DataSource

LoopedContentsView needs delegate and datasource like UITableView/UICollectionView.

Delegate

Required

func loopedContentsView(loopedContentsView: LoopedContentsView, lengthOfContentAtIndex index: Int) -> CGFloat

Optional

func loopedContentsView(loopedContentsView: LoopedContentsView, willSelectContentAtIndex index: Int)
func loopedContentsView(loopedContentsView: LoopedContentsView, didSelectContentAtIndex index: Int)
func loopedContentsView(loopedContentsView: LoopedContentsView, willDeselectContentAtIndex index: Int)
func loopedContentsView(loopedContentsView: LoopedContentsView, didDeselectContentAtIndex index: Int)
func loopedContentsView(loopedContentsView: LoopedContentsView, willDisplayCell cell: LoopedContentsViewCell, forItemAtIndex index: Int)
func loopedContentsView(loopedContentsView: LoopedContentsView, didEndDisplaying cell: LoopedContentsViewCell, forItemAtIndex index: Int)
func loopedContentsView(loopedContentsView: LoopedContentsView, didFocusCell cell: LoopedContentsViewCell, forItemAtIndex index: Int)

DataSource

Required

func loopedContentsViewNumberOfContents(loopedContentsView: LoopedContentsView) -> Int
func loopedContentsView(loopedContentsView: LoopedContentsView, cellAtIndex index: Int) -> LoopedContentsViewCell

Register Cell Class

You can register cell class.

loopedContentsView.registerClass(class: {Name of Cell Class}.self, forCellReuseIdentifier: "{Identifier}")

Example

LoopedContentsViewExample

License

LoopedContentsView is released under the MIT license. See LICENSE for details.

About

View to display looped contents.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Swift 98.5%
  • Objective-C 1.5%