UICollectionViewLayout with focused content

Overview

SFFocusViewLayout

Travis CI codecov.io Swift Version Version Swift Package Manager compatible Carthage compatible Platform License

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.

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

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

pod 'SFFocusViewLayout', '~> 2.0'

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'

Roadmap

  • Carthage support
  • Swift compatible
  • Swift version
  • Tests
  • Upgrade to Swift 3

Author

Sergio Fernández, [email protected]

Acknowledgement

This framework 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.

Comments
  • dyld`dyld_fatal_error

    dyld`dyld_fatal_error

    Hi ,

    When we want to run sample application with XCode 7.2 then we're facing this error.It works charm on simulator but we couldn't find a way to run same code on a real device. ( IPhone 6 , IOS 9.x )

    You can see the error through this link : http://snag.gy/XLjch.jpg

    Do you have an idea ?

    Thanks

    opened by pqant 7
  • strange behavior when embedded in navigation-controller

    strange behavior when embedded in navigation-controller

    Hey,

    i am using a ViewController, which is embedded in a NavigationController. Inside of that ViewController, i have a CollectionView that uses the SFFocusViewLayout. When i scroll down at a offset of approximately -64 and release my finger, it stops for a short duration and then snaps back to 0 offset. Using a ViewController without a NavigationController solves the issue. I guess calculation goes wrong at some point, when the CollectionView is not at yPosition 0 within the ViewController?

    opened by AnotherCoolDude 1
  • Background color and behavior

    Background color and behavior

    How do I change the background color of the layout? Change on collectionView.backgroundColor has no effect.

    screen shot 2017-04-18 at 8 23 35 pm

    And is it possible to have the layout end at the bottom of the collectionView? Thanks for the assistance.

    opened by davidseek 0
  • Specify Swift version without patch (fix #16)

    Specify Swift version without patch (fix #16)

    This fixes #16. Basically it is a workaround for a weird Xcode 8.2 behavior which might not get fixed but instead defined as the new expected behavior, so we should update the framework.

    opened by Jeehut 2
  • Xcode 8.2 build issue

    Xcode 8.2 build issue

    I have just tried to install version 3.1.0 via Carthage but it failed. It looks to me as if this is a similar issue to https://github.com/ninjaprox/NVActivityIndicatorView/pull/102 which is basically a strange Xcode 8.2 behavior. I think specifying only Swift 3.0 instead of 3.0.1 will fix this.

    opened by Jeehut 0
  • Change Background

    Change Background

    Is there by any chance a possibility to change the background of the collectionView? In color or Image? Once the user has scrolled through the content, there is a grey space of half the screen. Doesn't look too good. Any idea?

    opened by davidseek 0
Owner
Sergio Fernández
Technicolor.
Sergio Fernández
A UICollectionViewLayout subclass displays its items as rows of items similar to the App Store Feature tab without a nested UITableView/UICollectionView hack.

CollectionViewShelfLayout A UICollectionViewLayout subclass displays its items as rows of items similar to the App Store Feature tab without a nested

Pitiphong Phongpattranont 374 Oct 22, 2022
A UICollectionViewLayout subclass that adds custom transitions/animations to the UICollectionView without effecting your existing code.

AnimatedCollectionViewLayout Normally a UICollectionView has no transition effects when you scroll from one item to another. There are lots of ways to

Jin Wang 4.5k Jan 1, 2023
sample project for `UICollectionViewLayout` implementation

collection-view-layout-pattern-sample UICollectionViewLayout implementation pattern. About This project is introduced in iOSDC Japan 2021. sample code

Toshiki Takezawa 13 Nov 3, 2021
A lightweight UICollectionViewLayout that 'pages' and centers its cells 🎡 written in Swift

CenteredCollectionView CenteredCollectionView is a lightweight drop in place UICollectionViewFlowLayout that pages and keeps its cells centered, resul

Ben Emdon 1.2k Dec 6, 2022
An extandable mosaic UICollectionViewLayout with a focus on extremely flexible customizations :large_orange_diamond:

SquareMosaicLayout An extandable mosaic UICollectionViewLayout with a focus on extremely flexible customizations. Note This layout is not of waterfall

Mikhail Vasilev 254 Dec 6, 2022
Crossroad is an URL router focused on handling Custom URL Scheme

Crossroad is an URL router focused on handling Custom URL Scheme. Using this, you can route multiple URL schemes and fetch arguments and parameters easily.

Kohki Miki 331 May 23, 2021
An app focused on show in a visual way how sorting algorithms actually works.

Sorting Algorithms App An open source app focused on show in a visual way how sorting algorithms actually works. Available on the app store Do you wan

Victor Panitz Magalhães 45 Nov 25, 2022
MyWeight is a body mass tracker focused on make easy to input new data and check your weight history

MyWeight MyWeight is a body mass tracker focused on make easy to input new data and check your weight history. Getting Started Environment prerequisit

Diogo Tridapalli 71 Nov 2, 2022
Animated UITextField enhance UX for the user by giving clarity that they are focused

JDCircularProgress JDTextField is animateable UITextField that can significantly enhance your user's experiences and set your app apart from the rest

Jawad Ali 22 Nov 17, 2022
Impervious is a privacy and security-focused browser with native DANE support and a decentralized p2p light client.

Impervious iOS The first browser with support for native DNS-Based Authentication of Named Entities (DANE) with true downgrade protection, and the fir

Impervious Inc 25 Jun 15, 2022
Beacon is a privacy and security-focused browser with native DANE support and a decentralized p2p light client.

Beacon iOS The first browser with support for native DNS-Based Authentication of Named Entities (DANE) with true downgrade protection, and the first b

Impervious Inc 25 Jun 15, 2022
Financial Education app focused on young people

Fin4teen Aplicativo de Educação Financeira com foco em jovens. Tópicos Descrição

null 2 Nov 25, 2022
A developer-focused Meetup clone built with React Native

Assemblies Where Developers Connect Assemblies is an open-source mobile app built with React Native which developers can use to connect through 'assem

Build React Native 360 Dec 7, 2022
SwiftXLSX - A library focused creating Excel spreadsheet (XLSX) files directly on mobile devices

SwiftXLSX Excel spreadsheet (XLSX) format writer on pure SWIFT. SwiftXLSX is a l

null 19 Dec 13, 2022
RaceRunner is a run-tracking app focused on racing.

RaceRunner RaceRunner is a run-tracking iPhone app focused on racing. Spectators can track the progress of runners during races. Spectators can start

Josh Adams 75 Dec 7, 2022
A privacy-focused app using Apple's soon-to-be-released contact tracing framework.

A privacy-focused app using Apple's soon-to-be-released contact tracing framework.

Crunchy Bagel Pty Ltd 350 Oct 16, 2022
Open source, non-custodial Terra Wallet focused on privacy iOS App

iOS Open source non-custodial Terra Wallet. We send your finance from the Earth to the Moon Running the project To run this project update / fetch the

Terra Planet 7 May 22, 2022
An application focused on managing men's haircuts. It has never been so easy to keep the cut on time

An application focused on managing men's haircuts. It has never been so easy to keep the cut on time

Yago Marques 2 Oct 13, 2022
A custom stretchable header view for UIScrollView or any its subclasses with UIActivityIndicatorView and iPhone X safe area support for content reloading. Built for iOS 10 and later.

Arale A custom stretchable header view for UIScrollView or any its subclasses with UIActivityIndicatorView support for reloading your content. Built f

Putra Z. 43 Feb 4, 2022
A SwiftUI Library for creating resizable partitions for View Content.

Partition Kit Recently Featured In Top 10 Trending Android and iOS Libraries in October and in 5 iOS libraries to enhance your app! What is PartitionK

Kieran Brown 230 Oct 27, 2022