Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fdzsergio/SFFocusViewLayout

UICollectionViewLayout with focused content
https://github.com/fdzsergio/SFFocusViewLayout

carthage cocoapods ios swift uicollectionviewlayout

Last synced: 3 months ago
JSON representation

UICollectionViewLayout with focused content

Awesome Lists containing this project

README

        

# SFFocusViewLayout

[![Travis CI](https://travis-ci.org/fdzsergio/SFFocusViewLayout.svg?branch=master)](https://travis-ci.org/fdzsergio/SFFocusViewLayout)
[![codecov.io](https://codecov.io/github/fdzsergio/SFFocusViewLayout/coverage.svg?branch=master)](https://codecov.io/github/fdzsergio/SFFocusViewLayout?branch=master)
[![Swift Version](https://img.shields.io/badge/Swift-4.2.x-orange.svg)]()
[![Version](https://img.shields.io/cocoapods/v/SFFocusViewLayout.svg?style=flat)](http://cocoapods.org/pods/SFFocusViewLayout)
[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Platform](https://img.shields.io/cocoapods/p/SFFocusViewLayout.svg?style=flat)](http://cocoapods.org/pods/SFFocusViewLayout)
[![License](https://img.shields.io/cocoapods/l/SFFocusViewLayout.svg?style=flat)](http://cocoapods.org/pods/SFFocusViewLayout)

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



## Usage

SFFocusViewLayout contains three properties to customize the interface.

```swift
var standardHeight: CGFloat
var focusedHeight: CGFloat
var dragOffset: CGFloat
```

- _focusedHeight_ is the height cells should be when focused. Defaults to 280
- _standardHeight_ is the height cells should be when collapsed. Defaults to 100
- _dragOffset_ is the amount the user needs to scroll before the featured cell changes. Defaults to 180

## Versions

### Swift
If you want to use a Swift 3 implementation of this framework use a 3.0 or greater version

```ruby
pod 'SFFocusViewLayout', '~> 3.0'
```

### Objective–C
If you want to use a Objective–C implementation of this framework use a 2.0 or greater version

```ruby
pod 'SFFocusViewLayout', '~> 2.0'
```

## Installation

### CocoaPods

SFFocusViewLayout is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'SFFocusViewLayout'
```
### Carthage

You can also install it via [Carthage](https://github.com/Carthage/Carthage). To do so, add the following to your Cartfile:

```terminal
github 'fdzsergio/SFFocusViewLayout'
```

## Roadmap
- [x] Carthage support
- [x] Swift compatible
- [x] Swift version
- [x] Tests
- [x] Upgrade to Swift 3

## Author

Sergio Fernández, [email protected]

## Acknowledgement

This framework is heavily inspired by the Ultravisual example of [Ray Wenderlich](http://www.raywenderlich.com/99087/swift-expanding-cells-ios-collection-views).

## License

SFFocusViewLayout is available under the MIT license. See the [LICENSE](https://raw.githubusercontent.com/fdzsergio/SFFocusViewLayout/master/LICENSE) file for more info.