Custom transition between two collection view layouts

Overview

Display Switcher

CocoaPods Compatible Platform License Yalantis

We designed a UI that allows users to switch between list and grid views on the fly and choose the most convenient display type. List view usually provides more details about each user or contact. Grid view allows more users or contacts to appear on the screen at the same time.

We created design mockups for both list and grid views using Sketch. As soon as the mockups were ready, we used Principle to create a smooth transition between the two display types. Note that the hamburger menu changes its appearance depending on which view is activated:

Preview

Requirements

  • iOS 10.0+
  • Xcode 11
  • Swift 5

Installing

CocoaPods

use_frameworks!
pod ‘DisplaySwitcher’, '~> 2.0

Carthage

github "Yalantis/DisplaySwitcher" "master"

Use Cases

You can use our Contact Display Switch for:

  • Social networking apps
  • Dating apps
  • Email clients
  • Any other app that features list of friends or contacts

Our DisplaySwitcher component isn't limited to friends and contacts lists. It can work with any other content too.

Usage

At first, import DisplaySwitcher:

import DisplaySwitcher

Then create two layouts (list mode and grid mode):

private lazy var listLayout = DisplaySwitchLayout(staticCellHeight: listLayoutStaticCellHeight, nextLayoutStaticCellHeight: gridLayoutStaticCellHeight, layoutState: .list)

private lazy var gridLayout = DisplaySwitchLayout(staticCellHeight: gridLayoutStaticCellHeight, nextLayoutStaticCellHeight: listLayoutStaticCellHeight, layoutState: .grid)

Set current layout:

private var layoutState: LayoutState = .list
collectionView.collectionViewLayout = listLayout

Then override two UICollectionViewDataSource methods:

func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
    // count of items
}

func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
    // configure your custom cell
}

Also override one UICollectionViewDelegate method (for custom layout transition):

func collectionView(collectionView: UICollectionView, transitionLayoutForOldLayout fromLayout: UICollectionViewLayout, newLayout toLayout: UICollectionViewLayout) -> UICollectionViewTransitionLayout {
    let customTransitionLayout = TransitionLayout(currentLayout: fromLayout, nextLayout: toLayout)
    return customTransitionLayout
}

And in the end necessary create transition and start it (you can simply change animation duration for transition layout and for rotation button):

let transitionManager: TransitionManager
if layoutState == .list {
    layoutState = .grid
    transitionManager = TransitionManager(duration: animationDuration, collectionView: collectionView!, destinationLayout: gridLayout, layoutState: layoutState)
} else {
    layoutState = .list
    transitionManager = TransitionManager(duration: animationDuration, collectionView: collectionView!, destinationLayout: listLayout, layoutState: layoutState)
}
transitionManager.startInteractiveTransition()
rotationButton.selected = layoutState == .list
rotationButton.animationDuration = animationDuration

Under the hood

We use five classes to implement our DisplaySwitcher:

BaseLayout

In the BaseLayout class, we use methods for building list and grid layouts. But what’s most interesting here is the сontentOffset calculation that should be defined after the transition to a new layout.

First, save the сontentOffset of the layout you are switching from:

 override func prepareForTransitionFromLayout(oldLayout: UICollectionViewLayout) {
       previousContentOffset = NSValue(CGPoint:collectionView!.contentOffset)  
       return super.prepareForTransitionFromLayout(oldLayout)

   }

Then, calculate the сontentOffset for the new layout in the targetContentOffsetForProposedContentOffset method:

override func targetContentOffsetForProposedContentOffset(proposedContentOffset: CGPoint) -> CGPoint {
       let previousContentOffsetPoint = previousContentOffset?.CGPointValue()
       let superContentOffset = super.targetContentOffsetForProposedContentOffset(proposedContentOffset)
       if let previousContentOffsetPoint = previousContentOffsetPoint {
           if previousContentOffsetPoint.y == 0 {
               return previousContentOffsetPoint
           }
           if layoutState == CollectionViewLayoutState.ListLayoutState {
               let offsetY = ceil(previousContentOffsetPoint.y + (staticCellHeight * previousContentOffsetPoint.y / nextLayoutStaticCellHeight) + cellPadding)
               return CGPoint(x: superContentOffset.x, y: offsetY)
           } else {
               let realOffsetY = ceil((previousContentOffsetPoint.y / nextLayoutStaticCellHeight * staticCellHeight / CGFloat(numberOfColumns)) - cellPadding)
               let offsetY = floor(realOffsetY / staticCellHeight) * staticCellHeight + cellPadding
return CGPoint(x: superContentOffset.x, y: offsetY)
           }
       }
       return superContentOffset
   }

And then clear value of variable in method finalizeLayoutTransition:

override func finalizeLayoutTransition() {
       previousContentOffset = nil
       super.finalizeLayoutTransition()
   }

BaseLayoutAttributes

In the BaseLayoutAttributes class, a few custom attributes are added:

var transitionProgress: CGFloat = 0.0
   var nextLayoutCellFrame = CGRectZero
   var layoutState: CollectionViewLayoutState = .ListLayoutState

transitionProgress is the current value of the animation transition that varies between 0 and 1. It’s needed for calculating constraints in the cell.

nextLayoutCellFrame is a property that returns the frame of the layout you switch to. It’s also used for the cell layout configuration during the process of transition.

layoutState is the current state of the layout.

TransitionLayout

The TransitionLayout class overrides two UICollectionViewLayout methods:

layoutAttributesForElementsInRect and
layoutAttributesForItemAtIndexPath, where we set properties values for the class BaseLayoutAttributes.

TransitionManager

The TransitionManager class uses the UICollectionView’sstartInteractiveTransitionToCollectionViewLayout method, where you point the layout it must switch to:

func startInteractiveTransition() {
       UIApplication.sharedApplication().beginIgnoringInteractionEvents()
       transitionLayout = collectionView.startInteractiveTransitionToCollectionViewLayout(destinationLayout, completion: { success, finish in
           if success && finish {
               self.collectionView.reloadData()
               UIApplication.sharedApplication().endIgnoringInteractionEvents()
           }
       }) as! TransitionLayout
       transitionLayout.layoutState = layoutState
       createUpdaterAndStart()
   }

CADisplayLink class

This class is used to control animation duration. This class helps calculate the animation progress depending on the animation duration preset:

private func createUpdaterAndStart() {
       start = CACurrentMediaTime()
       updater = CADisplayLink(target: self, selector: Selector("updateTransitionProgress"))
       updater.frameInterval = 1
       updater.addToRunLoop(NSRunLoop.currentRunLoop(), forMode: NSRunLoopCommonModes)
   }

dynamic func updateTransitionProgress() {
       var progress = (updater.timestamp - start) / duration
       progress = min(1, progress)
       progress = max(0, progress)
       transitionLayout.transitionProgress = CGFloat(progress)

       transitionLayout.invalidateLayout()
       if progress == finishTransitionValue {
           collectionView.finishInteractiveTransition()
           updater.invalidate()
       }
   }

That’s it! Use our DisplaySwitcher in any way you like! Check it out on Dribbble.

Let us know!

We’d be really happy if you sent us links to your projects where you use our component. Just send an email to [email protected] And do let us know if you have any questions or suggestion regarding the animation.

P.S. We’re going to publish more awesomeness wrapped in code and a tutorial on how to make UI for iOS (Android) better than better. Stay tuned!

License

The MIT License (MIT)

Copyright © 2017 Yalantis

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • Solved didSelectItemAtIndexPath issue #7

    Solved didSelectItemAtIndexPath issue #7

    Hi,

    I opened didSelectItemAtIndexPath issue #7 then I solved it in this PR.

    No need for gesture recognizer as it disable the cell tap. So I just added gesture recognizer when searchBarTextDidBeginEditing so that the keyboard will disappear when the user tap. Then I removed gesture recognizer when searchBarTextDidEndEditing.

    Note that I added:

    func collectionView(collectionView: UICollectionView,
                            didSelectItemAtIndexPath indexPath: NSIndexPath) {
            print("Hi \(indexPath.row)")
        }
    

    Just to check the functionality so maybe it better to move to new view or any suggestions?

    Thanks.

    opened by Maryom 8
  • `pod install` on the example project doesn't work

    `pod install` on the example project doesn't work

    $ pod --version
    1.1.0.beta.1
    
    $ pod install
    
    [!] Invalid `Podfile` file: [!] Unsupported options `{:exclusive=>true}` for target `DisplaySwitcher_Example`..
    
     #  from /Users/aaron/Downloads/DisplaySwitcher-master/Example/Podfile:4
     #  -------------------------------------------
     #  
     >  target 'DisplaySwitcher_Example', :exclusive => true do
     #    pod 'DisplaySwitcher', :path => '../'
     #  -------------------------------------------
    
    opened by aaronbrethorst 7
  • Add possibility to customise collection view

    Add possibility to customise collection view

    Currently there is no possibility to customise collection view: set different cell paddings and specify number of grid columns. Also because of layout state property is private there is no possibility to configure cell before transition in willTransition depending on the current layout state.

    Commit summary:

    • I extended init with 3 new property: cellHeightPadding, cellWidthPadding and gridLayoutCountOfColumns. All this properties have default values as before for backwards compatibility.

    • Now DisplaySwitchLayout has layoutState read-only property for configure cell before transition.

    Now there is possibility to make own design of collection view.

    opened by SRozhina 5
  • an error happened while carthage update

    an error happened while carthage update

    please help me

    while i carthage update , an error happened as below

    Dependency "DisplaySwitcher" has no shared framework schemes

    while i pod install, another error happened

    [!] Unable to find a specification for DisplaySwitcher (~> 1.0)

    opened by hunter123321000 4
  • constraint errors when changing layout

    constraint errors when changing layout

    report a bug

    When testing the demo I sometimes get a contraint error when changing layout:

    
    2017-01-23 02:15:58.926309 DisplaySwitcher_Example[8893:1432862] [LayoutConstraints] Unable to simultaneously satisfy constraints.
    	Probably at least one of the constraints in the following list is one you don't want. 
    	Try this: 
    		(1) look at each constraint and try to figure out which you don't expect; 
    		(2) find the code that added the unwanted constraint or constraints and fix it. 
    (
        "<NSLayoutConstraint:0x61800008c170 H:|-(10)-[UILabel:0x7fe945b1ded0'Marry Kennedy']   (active, names: '|':UIView:0x7fe945b1dd30 )>",
        "<NSLayoutConstraint:0x61800008b270 H:[UILabel:0x7fe945b1ded0'Marry Kennedy']-(11)-|   (active, names: '|':UIView:0x7fe945b1dd30 )>",
        "<NSLayoutConstraint:0x61800008b6d0 UIImageView:0x7fe945b1e160.width == 1   (active)>",
        "<NSLayoutConstraint:0x61800008c3f0 UIImageView:0x7fe945b1e160.width == UIView:0x7fe945b1dd30.width   (active)>"
    )
    
    Will attempt to recover by breaking constraint 
    <NSLayoutConstraint:0x61800008b270 H:[UILabel:0x7fe945b1ded0'Marry Kennedy']-(11)-|   (active, names: '|':UIView:0x7fe945b1dd30 )>
    
    Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
    The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
    Hi 0
    Hi 0
    Hi 0
    Hi 0
    Hi 0
    2017-01-23 02:16:17.912348 DisplaySwitcher_Example[8893:1432862] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/Kevin/Library/Developer/CoreSimulator/Devices/28151775-0F99-4CC1-9CF3-3060CC67F995/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
    2017-01-23 02:16:17.912974 DisplaySwitcher_Example[8893:1432862] [MC] Reading from private effective user settings.
    2017-01-23 02:16:31.670696 DisplaySwitcher_Example[8893:1432862] [LayoutConstraints] Unable to simultaneously satisfy constraints.
    	Probably at least one of the constraints in the following list is one you don't want. 
    	Try this: 
    		(1) look at each constraint and try to figure out which you don't expect; 
    		(2) find the code that added the unwanted constraint or constraints and fix it. 
    (
        "<NSLayoutConstraint:0x608000084e70 H:|-(10)-[UILabel:0x7fe942437b70'Leo Nicholson']   (active, names: '|':UIView:0x7fe9424379d0 )>",
        "<NSLayoutConstraint:0x60800008acd0 H:[UILabel:0x7fe942437b70'Leo Nicholson']-(11)-|   (active, names: '|':UIView:0x7fe9424379d0 )>",
        "<NSLayoutConstraint:0x608000094730 UIImageView:0x7fe942437e00.width == 3   (active)>",
        "<NSLayoutConstraint:0x608000092a20 UIImageView:0x7fe942437e00.width == UIView:0x7fe9424379d0.width   (active)>"
    )
    
    Will attempt to recover by breaking constraint 
    <NSLayoutConstraint:0x60800008acd0 H:[UILabel:0x7fe942437b70'Leo Nicholson']-(11)-|   (active, names: '|':UIView:0x7fe9424379d0 )>
    
    Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
    The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
    2017-01-23 02:16:38.154543 DisplaySwitcher_Example[8893:1432862] [LayoutConstraints] Unable to simultaneously satisfy constraints.
    	Probably at least one of the constraints in the following list is one you don't want. 
    	Try this: 
    		(1) look at each constraint and try to figure out which you don't expect; 
    		(2) find the code that added the unwanted constraint or constraints and fix it. 
    (
        "<NSLayoutConstraint:0x61800008ff50 H:|-(10)-[UILabel:0x7fe942700440'Monica Lamberts']   (active, names: '|':UIView:0x7fe942702c80 )>",
        "<NSLayoutConstraint:0x618000088390 H:[UILabel:0x7fe942700440'Monica Lamberts']-(11)-|   (active, names: '|':UIView:0x7fe942702c80 )>",
        "<NSLayoutConstraint:0x618000082710 UIImageView:0x7fe9427013f0.width == 3   (active)>",
        "<NSLayoutConstraint:0x618000084060 UIImageView:0x7fe9427013f0.width == UIView:0x7fe942702c80.width   (active)>"
    )
    
    Will attempt to recover by breaking constraint 
    <NSLayoutConstraint:0x618000088390 H:[UILabel:0x7fe942700440'Monica Lamberts']-(11)-|   (active, names: '|':UIView:0x7fe942702c80 )>
    
    Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
    The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
    

    I am running Xcode 8.2.1 Simulator: Iphone 5s ios 10.2

    type: bug status: queued 
    opened by kiwo12345 3
  • Invalid parameter not satisfying: (name != nil) && ([name length] > 0)

    Invalid parameter not satisfying: (name != nil) && ([name length] > 0)

    Keep getting the error Invalid parameter not satisfying: (name != nil) && ([name length] > 0) while loading the view, app works, everything works, just loading the view crashes the app.

    opened by mogsten 3
  • Swift 3 ready?

    Swift 3 ready?

    It seems there is a problem with this lib and swift 3 perhaps?...

    *** Building scheme "DisplaySwitcher" in DisplaySwitcher.xcworkspace
    /usr/bin/xcrun xcodebuild -workspace /Users/Shared/xna/frontend/apps/ios/xxxx/Carthage/Checkouts/DisplaySwitcher/Example/DisplaySwitcher.xcworkspace -scheme DisplaySwitcher -configuration DEBUG -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build2016-09-23 17:29:39.238 xcodebuild[30695:20532020] [MT] PluginLoading: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs
    Build settings from command line:
        BITCODE_GENERATION_MODE = bitcode
        CARTHAGE = YES
        CODE_SIGN_IDENTITY =
        CODE_SIGNING_REQUIRED = NO
        ONLY_ACTIVE_ARCH = NO
        SDKROOT = iphoneos10.0
    
    === CLEAN TARGET DisplaySwitcher OF PROJECT Pods WITH THE DEFAULT CONFIGURATION (Release) ===
    
    Check dependencies
    “Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
    “Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
    
    ** CLEAN FAILED **
    
    
    The following build commands failed:
        Check dependencies
    (1 failure)
    === BUILD TARGET DisplaySwitcher OF PROJECT Pods WITH THE DEFAULT CONFIGURATION (Release) ===
    
    Check dependencies
    “Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
    “Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
    
    ** BUILD FAILED **
    
    
    The following build commands failed:
        Check dependencies
    (1 failure)
    A shell task (/usr/bin/xcrun xcodebuild -workspace /Users/Shared/xna/frontend/apps/ios/xxCarthage/Checkouts/DisplaySwitcher/Example/DisplaySwitcher.xcworkspace -scheme DisplaySwitcher -configuration DEBUG -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build) failed with exit code 65:
    2016-09-23 17:29:39.238 xcodebuild[30695:20532020] [MT] PluginLoading: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs
    
    
    ** CLEAN FAILED **
    
    opened by sirvon 2
  • customize cellPadding

    customize cellPadding

    Hi,

    Sorry for posting here, this is not really an issue.

    I'd like to know if it's possible to set my own cell padding in the object BaseLayout. I want a very thin space between cells in grid mode.

    Kind regards,

    opened by leobouilloux 2
  • I'm getting some errors. Is it possible you make a video tutorial?

    I'm getting some errors. Is it possible you make a video tutorial?

    Report

    The more information you provide, the faster we can help you.

    ⚠️ Select what you want - a feature request or report a bug. Please remove the section you aren't interested in.

    A feature request

    What do you want to add?

    Please describe what you want to add to the component.

    How should it look like?

    Please add images.

    Report a bug

    What did you do?

    Please replace this with what you did.

    What did you expect to happen?

    Please replace this with what you expected to happen.

    What happened instead?

    Please replace this with what happened instead.

    Your Environment

    • Version of the component: insert here
    • Swift version: insert here
    • iOS version: insert here
    • Device: insert here
    • Xcode version: insert here
    • If you use Cocoapods: run pod env | pbcopy and insert here
    • If you use Carthage: run carthage version | pbcopy and insert here

    Project that demonstrates the bug

    Please add a link to a project we can download that reproduces the bug.

    type: enhancement priority: low status: need feedback 
    opened by borut888 1
  • Question about adding container view in bar button item

    Question about adding container view in bar button item

    Hi. Could you please help me. I saw that in your example project there is a container view inside bar button. I tried to do the same in my project using storyboard, but couldn't. Now I just copied it from your example project and set up. How could you add container view with buttons inside bar button?

    opened by SRozhina 1
  • transition content offset issues

    transition content offset issues

    report a bug

    when i set GridLayoutCountOfColumns = 2,the transition content offset is not correct untitled

    I am running Xcode 9.1 Simulator: Iphone X ios 11.1

    type: bug priority: medium status: work in progress 
    opened by moliya 1
  • Stretchy Header

    Stretchy Header

    I used stretchy Header FlowLayout after import DisplaySwitcher my Header doesn't seem anymore?

    import UIKit

    class STCollectionViewFlowLayout: UICollectionViewFlowLayout {

    override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool {
        return true
    }
    
    override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
        
        let layoutAttributes = super.layoutAttributesForElements(in: rect)       
        
        layoutAttributes?.forEach({ (attributes) in
            if attributes.representedElementKind == UICollectionView.elementKindSectionHeader {
                guard let collectionView = collectionView else {
                    return
                }
    
                let contentOffsetY = collectionView.contentOffset.y
                
                if contentOffsetY > 0 {
                    return
                }
                let width = collectionView.frame.width
                let height: CGFloat = attributes.frame.height - contentOffsetY
                attributes.frame = CGRect(x: 0, y: contentOffsetY, width: width, height: height)
    
            }
        })
        return layoutAttributes
    }
    

    }

    priority: low 
    opened by Murodillo 0
  • how to customize it to switch betweem list amd card view mood

    how to customize it to switch betweem list amd card view mood

    Report

    The more information you provide, the faster we can help you.

    ⚠️ Select what you want - a feature request or report a bug. Please remove the section you aren't interested in.

    A feature request

    What do you want to add?

    i want to switch between list and card view mood not grid

    How should it look like?

    like this https://dribbble.com/shots/4839248-Card-View-Mode

    Your Environment

    • Version of the component: insert here
    • Swift version: swift 4.1
    priority: low 
    opened by Ranaios 0
Releases(1.1)
Owner
Yalantis
Knowledge is power and the way to get power is by sharing knowledge. We are open source because this is a smart way to live, work and play.
Yalantis
Dwifft is a small Swift library that tells you what the "diff" is between two collections

Dwifft! In 10 seconds Dwifft is a small Swift library that tells you what the "diff" is between two collections, namely, the series of "edit operation

Jack Flintermann 1.8k Dec 12, 2022
A component to quickly scroll between collection view sections

SectionScrubber The scrubber will move along when scrolling the UICollectionView it has been added to. When you pan the scrubber you 'scrub' over the

Elvis 190 Aug 17, 2022
This component allows for the transfer of data items between collection views through drag and drop

Drag and Drop Collection Views Written for Swift 4.0, it is an implementation of Dragging and Dropping data across multiple UICollectionViews. Try it

Michael Michailidis 508 Dec 19, 2022
Lightweight custom collection view inspired by Airbnb.

ASCollectionView Lightweight custom collection view inspired by Airbnb. Screenshots Requirements ASCollectionView Version Minimum iOS Target Swift Ver

Abdullah Selek 364 Nov 24, 2022
A custom paging behavior that peeks the previous and next items in a collection view

MSPeekCollectionViewDelegateImplementation Version 3.0.0 is here! ?? The peeking logic is now done using a custom UICollectionViewLayout which makes i

Maher Santina 353 Dec 16, 2022
Generic collection view controller with external data processing

FlexibleCollectionViewController Swift library of generic collection view controller with external data processing of functionality, like determine ce

Dmytro Pylypenko 3 Jul 16, 2018
TLIndexPathTools is a small set of classes that can greatly simplify your table and collection views.

TLIndexPathTools TLIndexPathTools is a small set of classes that can greatly simplify your table and collection views. Here are some of the awesome th

SwiftKick Mobile 347 Sep 21, 2022
Easy and type-safe iOS table and collection views in Swift.

Quick Start TL;DR? SimpleSource is a library that lets you populate and update table views and collection views with ease. It gives you fully typed cl

Squarespace 96 Dec 26, 2022
Modern Collection Views

The goal is to showcase different compositional layouts and how to achieve them. Feel free to use any code you can find and if you have interesting layout idea - open PR!

Filip Němeček 536 Dec 28, 2022
A Swift mixin for reusing views easily and in a type-safe way (UITableViewCells, UICollectionViewCells, custom UIViews, ViewControllers, Storyboards…)

Reusable A Swift mixin to use UITableViewCells, UICollectionViewCells and UIViewControllers in a type-safe way, without the need to manipulate their S

Olivier Halligon 2.9k Jan 3, 2023
Custom CollectionViewLayout class for CollectionView paging mode to work properly

PagingCollectionViewLayout About How to use About ⚠️ Custom class, which is inherited from UICollectionViewFlowLayout, developed for properly work Col

Vladislav 2 Jan 17, 2022
Custom-Transition - A repo about custom transition between two view controllers

Custom-Transition in SWIFT This is a repo about custom transition between two vi

Prakash Chandra Awal 0 Jan 6, 2022
Blueprints is a collection of flow layouts that is meant to make your life easier when working with collection view flow layouts.

Blueprints is a collection of flow layouts that is meant to make your life easier when working with collection view flow layouts. It comes

Christoffer Winterkvist 982 Dec 7, 2022
ChainPageCollectionView A custom View with two level chained collection views and fancy transition animation

ChainPageCollectionView A custom View with two level chained collection views and fancy transition animation. Demo Requirements iOS 9.0+ Xcode 8 Insta

Yansong Li 775 Dec 7, 2022
Cool wave like transition between two or more UICollectionView

CKWaveCollectionViewTransition This is a cool custom transition between two or more UICollectionViewControllers with wave-like cell animation. Could b

Cezary Kopacz 1.9k Oct 4, 2022
Create a smooth transition between any two SwiftUI Views

GZMatchedTransformEffect Create a smooth transition between any two SwiftUI Views. It is very similar to the built-in .matchedGeometryEffect() modifie

Gong Zhang 10 Nov 26, 2022
A SwiftUI collection view with support for custom layouts, preloading, and more.

ASCollectionView A SwiftUI implementation of UICollectionView & UITableView. Here's some of its useful features: supports preloading and onAppear/onDi

Apptek Studios 1.3k Dec 24, 2022
Blueprints - A framework that is meant to make your life easier when working with collection view flow layouts.

Description Blueprints is a collection of flow layouts that is meant to make your life easier when working with collection view flow layouts. It comes

Christoffer Winterkvist 982 Dec 7, 2022
A bunch of layouts providing light and seamless experiences in your Collection View

Swinflate Description Swinflate aims to encorporate a set of collection view layouts which provide a better and even more fluid experience in collecti

Vlad Iacob 224 Dec 19, 2022
SPLarkController - Custom transition between controllers. Settings controller for your iOS app.

SPLarkController About Transition between controllers to top. You can change animatable height after presentation controller. For presentation and dis

Ivan Vorobei 965 Dec 17, 2022