All Projects → ahmedAlmasri → SNCollectionViewLayout

ahmedAlmasri / SNCollectionViewLayout

Licence: MIT license
Collection View Layouts is a set of custom flow layouts for iOS which imitate general data grid approaches for mobile apps.

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to SNCollectionViewLayout

Collectionviewslantedlayout
A CollectionView Layout displaying a slanted cells
Stars: ✭ 2,029 (+1929%)
Mutual labels:  uicollectionview, collectionview, collectionviewlayout
Tysnapshotscroll
一句代码保存截图,将 UIScrollView UITableView UICollectionView UIWebView WKWebView 网页 保存 为 长图 查看。Save the scroll view page as an image,support UIScrollView,UITableView,UICollectionView,UIWebView,WKWebView.(Support iOS13)
Stars: ✭ 709 (+609%)
Mutual labels:  uicollectionview, collectionview
CSStickyFlowLayoutHeaders
UICollectionView replacement for your amazing headers
Stars: ✭ 16 (-84%)
Mutual labels:  uicollectionview, uicollectionviewflowlayout
Flowlayout
UICollectionView WaterFlowLayout. 瀑布流.
Stars: ✭ 94 (-6%)
Mutual labels:  uicollectionview, collectionview
Kddraganddropcollectionview
This component allows for the transfer of data items between collection views through drag and drop
Stars: ✭ 476 (+376%)
Mutual labels:  uicollectionview, collectionview
Carlenscollectionviewlayout
An easy-to-use Collection View Layout for card-like animation.
Stars: ✭ 478 (+378%)
Mutual labels:  uicollectionview, collectionview
Ascollectionview
A SwiftUI collection view with support for custom layouts, preloading, and more.
Stars: ✭ 878 (+778%)
Mutual labels:  uicollectionview, collectionview
DXScaleFlowLayout
Custom collectionView layout that display scaled up/down cells
Stars: ✭ 32 (-68%)
Mutual labels:  uicollectionview, uicollectionviewflowlayout
Rdhcollectionviewgridlayout
Grid layout for UICollectionView
Stars: ✭ 159 (+59%)
Mutual labels:  uicollectionview, grid-layout
Vbpiledview
Simple and beautiful stacked UIView to use as a replacement for an UITableView, UIImageView or as a menu
Stars: ✭ 164 (+64%)
Mutual labels:  uicollectionview, collectionview
Mylinearlayout
MyLayout is a powerful iOS UI framework implemented by Objective-C. It integrates the functions with Android Layout,iOS AutoLayout,SizeClass, HTML CSS float and flexbox and bootstrap. So you can use LinearLayout,RelativeLayout,FrameLayout,TableLayout,FlowLayout,FloatLayout,PathLayout,GridLayout,LayoutSizeClass to build your App 自动布局 UIView UITab…
Stars: ✭ 4,152 (+4052%)
Mutual labels:  uicollectionview, grid-layout
SwiftWaterfallFlow
swift写的瀑布流布局
Stars: ✭ 37 (-63%)
Mutual labels:  collectionview, uicollectionviewflowlayout
Bouncylayout
Make. It. Bounce.
Stars: ✭ 4,035 (+3935%)
Mutual labels:  uicollectionview, collectionview
Datasources
💾 🔜📱 Type-safe data-driven CollectionView, TableView Framework. (We can also use ASCollectionNode)
Stars: ✭ 553 (+453%)
Mutual labels:  uicollectionview, collectionview
Ehhorizontalselectionview
Horizontal table view style controller
Stars: ✭ 346 (+246%)
Mutual labels:  uicollectionview, collectionview
Verticalcardswiper
A marriage between the Shazam Discover UI and Tinder, built with UICollectionView in Swift.
Stars: ✭ 830 (+730%)
Mutual labels:  uicollectionview, collectionview
JHCollectionViewFlowLayout
CollectionView horizontal layout,横向排版
Stars: ✭ 30 (-70%)
Mutual labels:  collectionview, collectionviewlayout
ACBRadialCollectionView
An extension on UICollectionView which automatically transforms collection view cells to a radial path
Stars: ✭ 31 (-69%)
Mutual labels:  collectionview, collectionviewlayout
Squareflowlayout
🌄 UICollectionViewLayout subclass inspired by Instagram Discover page style layout.
Stars: ✭ 142 (+42%)
Mutual labels:  uicollectionview, collectionview
Chatlayout
ChatLayout is an alternative solution to MessageKit. It uses custom UICollectionViewLayout to provide you full control over the presentation as well as all the tools available in UICollectionView. It supports dynamic cells and supplementary view sizes.
Stars: ✭ 184 (+84%)
Mutual labels:  uicollectionview, collectionview

SNCollectionViewLayout

CI Status Version License Platform

ScreenShots

Example

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

Using

1- Create instance

  let snCollectionViewLayout = SNCollectionViewLayout()
       snCollectionViewLayout.fixedDivisionCount = 4 // Columns for .vertical, rows for .horizontal
       snCollectionViewLayout.delegate = self
       myCollectionView.collectionViewLayout = snCollectionViewLayout

2- Delegate

  // scale for items based number of columns
  func scaleForItem(inCollectionView collectionView: UICollectionView, withLayout layout: UICollectionViewLayout, atIndexPath indexPath: IndexPath) -> UInt {
        if indexPath.row == 0 || indexPath.row == 3 || indexPath.row == 10 || indexPath.row == 70 {
            
            return 2 
        }
        return 1
    }
    // height for item if set fixedDimension  height equal width
    func itemFlexibleDimension(inCollectionView collectionView: UICollectionView, withLayout layout: UICollectionViewLayout, fixedDimension: CGFloat) -> CGFloat {
        return fixedDimension
    }
    
    // header height
    func headerFlexibleDimension(inCollectionView collectionView: UICollectionView, withLayout layout: UICollectionViewLayout, fixedDimension: CGFloat) -> CGFloat {
        return 0
    }

Requirements

  • Swift 4.2+
  • Xcode 10.0+
  • iOS 11.0+

Installation

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

pod 'SNCollectionViewLayout'

Author

ahmedAlmasri, [email protected]

License

SNCollectionViewLayout 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].