All Projects → mwaqasbhati → Wbcollectionviewlayout

mwaqasbhati / Wbcollectionviewlayout

Licence: mit
Library used to provide different type of custom Layouts within 30 second of time

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Wbcollectionviewlayout

Collection View Layouts
A library that implements custom flow layouts for iOS apps
Stars: ✭ 491 (+367.62%)
Mutual labels:  collectionview
Verticalcardswiper
A marriage between the Shazam Discover UI and Tinder, built with UICollectionView in Swift.
Stars: ✭ 830 (+690.48%)
Mutual labels:  collectionview
Paging Collection View Layout
custom collection view layout that allows you to page by cell, not screen
Stars: ✭ 65 (-38.1%)
Mutual labels:  collectionview
Datasources
💾 🔜📱 Type-safe data-driven CollectionView, TableView Framework. (We can also use ASCollectionNode)
Stars: ✭ 553 (+426.67%)
Mutual labels:  collectionview
Tysnapshotscroll
一句代码保存截图,将 UIScrollView UITableView UICollectionView UIWebView WKWebView 网页 保存 为 长图 查看。Save the scroll view page as an image,support UIScrollView,UITableView,UICollectionView,UIWebView,WKWebView.(Support iOS13)
Stars: ✭ 709 (+575.24%)
Mutual labels:  collectionview
Ascollectionview
A SwiftUI collection view with support for custom layouts, preloading, and more.
Stars: ✭ 878 (+736.19%)
Mutual labels:  collectionview
Kddraganddropcollectionview
This component allows for the transfer of data items between collection views through drag and drop
Stars: ✭ 476 (+353.33%)
Mutual labels:  collectionview
Collectionnode
a collectionView made for Sprite Kit
Stars: ✭ 96 (-8.57%)
Mutual labels:  collectionview
Chainpagecollectionview
A custom View with fancy collectionView animation
Stars: ✭ 760 (+623.81%)
Mutual labels:  collectionview
Rxiglistkit
RxSwift wrapper for IGListKit
Stars: ✭ 44 (-58.1%)
Mutual labels:  collectionview
Jxcategoryview
A powerful and easy to use category view (segmentedcontrol, segmentview, pagingview, pagerview, pagecontrol) (腾讯新闻、今日头条、QQ音乐、网易云音乐、京东、爱奇艺、腾讯视频、淘宝、天猫、简书、微博等所有主流APP分类切换滚动视图)
Stars: ✭ 5,561 (+5196.19%)
Mutual labels:  collectionview
Cardslayout
⭐️ Custom card-designed CollectionView layout
Stars: ✭ 686 (+553.33%)
Mutual labels:  collectionview
Swipeselectingcollectionview
A collection view subclass that enables swipe to select multiple cells just like in Photos app.
Stars: ✭ 34 (-67.62%)
Mutual labels:  collectionview
Koloda
KolodaView is a class designed to simplify the implementation of Tinder like cards on iOS.
Stars: ✭ 4,998 (+4660%)
Mutual labels:  collectionview
Jotify
Sticky notes reimagined - written in Swift
Stars: ✭ 79 (-24.76%)
Mutual labels:  collectionview
Carlenscollectionviewlayout
An easy-to-use Collection View Layout for card-like animation.
Stars: ✭ 478 (+355.24%)
Mutual labels:  collectionview
Modelassistant
Elegant library to manage the interactions between view and model in Swift
Stars: ✭ 26 (-75.24%)
Mutual labels:  collectionview
Cardsstack
An awesome set of cards at your disposal ✌️ ⚡️
Stars: ✭ 97 (-7.62%)
Mutual labels:  collectionview
Flowlayout
UICollectionView WaterFlowLayout. 瀑布流.
Stars: ✭ 94 (-10.48%)
Mutual labels:  collectionview
Collectionview
SwiftUI implementation of a collection view, similar to UICollectionView with UICollectionViewFlowLayout.
Stars: ✭ 37 (-64.76%)
Mutual labels:  collectionview

WBCollectionViewLayout

It provides 4 different type of Custom layout for CollectionView.

Two Cell Layout Three Cell Left Layout Three Cell Right Layout Mix Layout
Demo Demo Demo Demo
Demo Demo Demo Demo

Contents

Requirements

  • iOS 9.0+
  • Swift 4.0

Installation

Manually

Download the Code and Copy the layout file -> WBCollectionViewLayout.swift into your project. That's it.

CocoaPods

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

pod 'WBCollectionViewLayout', :git => 'https://github.com/mwaqasbhati/WBCollectionViewLayout.git'

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Usage

  • Just Create a WBGridViewLayout object and Confirm to it's Delegate
let mlayout = WBGridViewLayout()
mlayout.delegate = self
collectionView.setCollectionViewLayout(layout, animated: true)

Note: Delegates methods are optional and in default case Mixture layout will be drawn but if you want more customization then you need to implement it's delegates

Two Cell Layout

func colectionView(_ collectionView: UICollectionView, numberOfItemsInRow row: Int) -> CellLayout {
   return .Two
}

Three Cell Left Layout

func colectionView(_ collectionView: UICollectionView, numberOfItemsInRow row: Int) -> CellLayout {
   return .ThreeLeft
}

Three Cell Right Layout

func colectionView(_ collectionView: UICollectionView, numberOfItemsInRow row: Int) -> CellLayout {
   return .ThreeRight
}

Mixutre Cell Layout

This Layout is the default one and you don't have to implement numberOfItemsInRow delegate.

Custom Cell Layout

  • If you want more customization in drawing the layout then you can optionally implement it's delegate methods given below which provides numberOfItemsInRow for each Row and size of each Row.
func colectionView(_ collectionView: UICollectionView, numberOfItemsInRow row: Int) -> CellLayout
func colectionView(_ collectionView: UICollectionView, sizeOfItemInRow row: Int) -> CGSize?

Tips

When you load data from service

In case you load data asynchronously please follow next steps:

when data is loaded invalidate layout as well as reload data on collection view.

collectionView.collectionViewLayout.invalidateLayout()
collectionView.reloadData()

Author

mwaqasbhati, [email protected]

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].