Skip to content

cztatsumi-keisuke/SFFocusViewLayout

 
 

Repository files navigation

SFFocusViewLayout

CI Status Version codecov.io License Carthage compatible Platform

Overview

SFFocusViewLayout is a UICollectionViewLayout subclass for displaying focused content on UICollectionView which is the largest cell of all.

<img src="./Screenshots/SFFocusViewLayout.gif" alt="SFFocusViewLayout" title="SFFocusViewLayout">

Usage

SFFocusViewLayout contains three properties to customize the interface.

@property (nonatomic) CGFloat standardHeight;
@property (nonatomic) CGFloat focusedHeight;
@property (nonatomic) CGFloat dragOffset;
  • focusedHeight is the height cells should be when focused. Defaults to kSFFocusViewLayoutFocusedHeight
  • standardHeight is the height cells should be when collapsed. Defaults to kSFFocusViewLayoutStandardHeight
  • dragOffset is the amount the user needs to scroll before the featured cell changes

Installation

CocoaPods

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

pod "SFFocusViewLayout"

Carthage

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

github "fdzsergio/SFFocusViewLayout"

Upcoming

  • Carthage support
  • Swift compatible

Author

Sergio Fernández, fdz.sergio@gmail.com

Acknowledgement

This CocoaPod is heavily inspired by the Ultravisual example of Ray Wenderlich.

License

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

About

UICollectionViewLayout with focused content

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 96.2%
  • Ruby 3.8%