:octocat: Gliding Collection is a smooth, flowing, customizable decision for a UICollectionView Swift Controller. iOS library made by @Ramotion

Overview

GLIDING COLLECTION

A smooth, flowing, customizable decision for a UICollectionView Swift Controller


We specialize in the designing and coding of custom UI for Mobile Apps and Websites.

Stay tuned for the latest updates:


Twitter PodPlatform PodVersion Documentation Carthage Codebeat Swift Donate

Requirements

  • iOS 8.0+
  • Xcode 8
  • Swift 3 (<= 1.0.3)
  • Swift 4 (>= 1.1.0)
  • Swift 4.2 (~> 2.0)

Installation

You can install GlidingCollection in several ways:

  • Add source files to your project.

pod 'GlidingCollection'

github "Ramotion/gliding-collection"

How to use

• Create a view controller class:

import GlidingCollection

class ViewController: UIViewController {
  let items = ["gloves", "boots", "bindings", "hoodie"]
}

• Drag a UIView onto the canvas. Change it's class to GlidingCollection and use autolayout constraints.

step-2

• Connect this view to your view controller class as an @IBOutlet.

@IBOutlet var glidingCollection: GlidingCollection!

• Make your view controller conform to GlidingCollectionDatasource. It's very similar to the UITableView or UICollectionView datasource protocols that you know:

extension ViewController: GlidingCollectionDatasource {

  func numberOfItems(in collection: GlidingCollection) -> Int {
    return items.count
  }

  func glidingCollection(_ collection: GlidingCollection, itemAtIndex index: Int) -> String {
    return "" + items[index]
  }

}

• Make your view controller conform to UICollectionViewDatasource:

extension ViewController: UICollectionViewDatasource {
  
  func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
    let section = glidingView.expandedItemIndex // Value of expanded section.
    return images[section].count
  }
  
  func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
    guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath) as? CollectionCell else { return UICollectionViewCell() }
    // Configure and return your cell.
    return cell
  }
  
}

Customize

You can customize the appearance of GlidingCollection by overriding GlidingConfig's shared instance with your own.

var config = GlidingConfig.shared
config.buttonsFont = UIFont.boldSystemFont(ofSize: 22)
config.activeButtonColor = .black
config.inactiveButtonsColor = .lightGray
GlidingConfig.shared = config

🗒 All parameters with their descriptions are listed in GlidingConfig.


Notes

There is a GlidingCollectionDelegate protocol which can notify you when item in GlidingCollection didSelect, willExpand and didExpand.

If you want to achieve a parallax effect on a horizontal cards stack, you need to place your parallax view in a cell's contentView and set its tag to 99.

parallax-view

There is a kGlidingCollectionParallaxViewTag constant if you want to layout a cell in code.

imageView.tag = kGlidingCollectionParallaxViewTag

📄 License

Gliding Collection is released under the MIT license. See LICENSE for details.

This library is a part of a selection of our best UI open-source projects.

If you use the open-source library in your project, please make sure to credit and backlink to https://www.ramotion.com/

📱 Get the Showroom App for iOS to give it a try

Try this UI component and more like this in our iOS app. Contact us if interested.



Issues
  • Cell becomes untouchable after animation in case if there is no more cell in a section

    Cell becomes untouchable after animation in case if there is no more cell in a section

    I'm noticing that when a row only contains one cell, didSelectItemAt is not firing when tapped. As long as more than one item is present everything works fine (including tapping the first cell).

    Expected Behavior Even if a cell is the only cell in a particular row it should still call didSelectItemAt when tapped

    Actual Behavior When a cell is the only cell in a row didSelectItemAt does not trigger after the only cell is tapped.

    bug 
    opened by phalladar 8
  • network data

    network data

    Whether it supports network data loading?

    opened by wxlpp 3
  • Broken Horizontal Sliding When Card Size Change

    Broken Horizontal Sliding When Card Size Change

    If you change the card size to a smaller width, then when you scroll horizontally, it is not snapping to each cell like it normally does. It is like the snapping is still calculated upon the default height. I set my card size to: CGSize(width: 200, height: 280)

    opened by danielchangsoojones 1
  • Custom Category Header Views

    Custom Category Header Views

    Would it be possible to create custom category heard views? For example, I want to be able to have the "-Boots" label on the left side, and I would like to have an "more>" label on the right side. It could be done in a similar fashion as how UICollection's delegate allows you to return a view for a section header.

    opened by danielchangsoojones 1
  • Custom Cell Size Based On expandedItemIndex

    Custom Cell Size Based On expandedItemIndex

    Is it possible to change the cardSize based on the expandedItemIndex? I tried doing this by setting the cell frame based on the expandedItemIndex, but it distorts the collection cell view.

    opened by YouKnowOJ 1
  • Gliding-collection for android

    Gliding-collection for android

    Hi thanks from your stylish and powerful libraries . Is it possible to make a library like this for android ? are you developing it right now ?

    opened by shobayr 1
  • Collectio view

    Collectio view

    opened by AliMahmood99 1
  • Update README.md

    Update README.md

    Fix some naming typos in README

    opened by Aymenworks 0
  • fix Carthage

    fix Carthage

    opened by Shishani58 0
  • Update README.md

    Update README.md

    Update Swift compatibility badges

    opened by Jauzee 0
  • can not click the first item if some array does not have image on version 1.1.0

    can not click the first item if some array does not have image on version 1.1.0

    Attaching the modification demo project: With the lastest version 1.10, use the Demo project, add one line at the end of func loadImages() to remove images for first item:

    private func loadImages() { for item in items { let imageURLs = FileManager.default.fileUrls(for: "jpeg", fileName: item) var images: [UIImage?] = [] for url in imageURLs { guard let data = try? Data(contentsOf: url) else { continue } let image = UIImage(data: data) images.append(image) } self.images.append(images) }

    self.images[0].removeAll()
    

    } gliding-collection-master 2.zip

    opened by stoneyanjun 2
Releases(1.0.3)
Owner
Ramotion
UI Engineering, UI/UX Design and Front-End Development Agency
Ramotion
An iOS drop-in UITableView, UICollectionView and UIScrollView superclass category for showing a customizable floating button on top of it.

MEVFloatingButton An iOS drop-in UITableView, UICollectionView, UIScrollView superclass category for showing a customizable floating button on top of

Manuel Escrig 301 Oct 21, 2021
🚴 A declarative library for building component-based user interfaces in UITableView and UICollectionView.

A declarative library for building component-based user interfaces in UITableView and UICollectionView. Declarative Component-Based Non-Destructive Pr

Ryo Aoyama 1.1k Jan 9, 2022
↕️ VegaScroll is a lightweight animation flowlayout for UICollectionView completely written in Swift 4, compatible with iOS 11 and Xcode 9.

Made by Applikey Solutions Find this project on Dribbble Also check another flowlayout for UICollectionView: https://github.com/ApplikeySolutions/Grav

Applikey Solutions 2.6k Jan 5, 2022
Netflix and App Store like UITableView with UICollectionView, written in pure Swift 4.2

GLTableCollectionView Branch Status master develop What it is GLTableCollectionView is a ready to use UITableViewController with a UICollectionView fo

Giulio 713 Dec 29, 2021
A generic small reusable components for data source implementation for UITableView/UICollectionView in Swift.

GenericDataSource A generic small reusable components for data source implementation for UITableView/UICollectionView written in Swift. Features Basic

null 132 Sep 8, 2021
Automates prefetching of content in UITableView and UICollectionView

Automates preheating (prefetching) of content in UITableView and UICollectionView. Deprecated on iOS 10. This library is similar to UITableViewDataSou

Alexander Grebenyuk 632 Dec 27, 2021
UICollectionView layout for presenting of the overlapping cells.

StickyCollectionView UICollectionView layout for presenting of the overlapping cells. Objective-C version here Checkout demo Overview Installation Man

Bogdan Matveev 324 Nov 26, 2021
A data-driven UICollectionView framework for building fast and flexible lists.

A data-driven UICollectionView framework for building fast and flexible lists. Main Features ?? Never call performBatchUpdates(_:, completion:) or rel

Instagram 12.2k Jan 5, 2022
Incremental update tool to UITableView and UICollectionView

EditDistance is one of the incremental update tool for UITableView and UICollectionView. The followings show how this library update UI. They generate

Kazuhiro Hayashi 92 Oct 28, 2021
Reimagining UICollectionView

CollectionKit Reimagining UICollectionView A modern Swift framework for building composable data-driven collection view. Migration Guide v2.0 Features

SoySauceLab 4.2k Dec 31, 2021
Collapse and expand UICollectionView sections with one method call.

This library provides a custom UICollectionView that allows to expand and collapse sections. Provides a simple API to manage collection view appearanc

Touchlane 167 Dec 7, 2021
Conv smart represent UICollectionView data structure more than UIKit.

Conv Conv smart represent UICollectionView data structure more than UIKit. Easy definition for UICollectionView DataSource and Delegate methods. And C

bannzai 152 Dec 15, 2021
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 Dec 29, 2021
🔄 GravitySlider is a beautiful alternative to the standard UICollectionView flow layout.

GravitySliderFlowLayout Made by Applikey Solutions Find this project on Dribbble Table of Contents Purpose Supported OS & SDK Versions Installation Us

Applikey Solutions 864 Jan 12, 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 93 Nov 6, 2021
Custom transition between two collection view layouts

Display Switcher This component implements custom transition between two collection view layouts with custom animation duration. Check this project on

Yalantis 2.3k Jan 12, 2022
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 346 Dec 30, 2021
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 324 Dec 24, 2021
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 486 Dec 16, 2021