All Projects → jVirus → Uicollectionview Layouts Kit

jVirus / Uicollectionview Layouts Kit

Licence: mit
📐 A set of custom layouts for UICollectionView with examples [Swift 5.3, iOS 12].

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Uicollectionview Layouts Kit

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 (+912.68%)
Mutual labels:  layout, autolayout, constraints, uicollectionview
Collectionviewpaginglayout
a simple but highly customizable paging layout for UICollectionView.
Stars: ✭ 947 (+130.98%)
Mutual labels:  uikit, layout, uicollectionviewlayout, uicollectionview
Uicollectionviewsplitlayout
UICollectionViewSplitLayout makes collection view more responsive.
Stars: ✭ 226 (-44.88%)
Mutual labels:  uikit, layout, uicollectionview
Squaremosaiclayout
An extandable mosaic UICollectionViewLayout with a focus on extremely flexible customizations 🔶
Stars: ✭ 243 (-40.73%)
Mutual labels:  uikit, uicollectionviewlayout, uicollectionview
Stevia
🍃 Concise Autolayout code
Stars: ✭ 3,182 (+676.1%)
Mutual labels:  layout, autolayout, constraints
Swiftautolayout
Write constraints in a concise, expressive, Swifty way.
Stars: ✭ 83 (-79.76%)
Mutual labels:  uikit, autolayout, constraints
Basecomponents
BaseComponents aims to provide easily reusable and understandable components to increase productivity with UIKit and Foundation APIs
Stars: ✭ 92 (-77.56%)
Mutual labels:  uikit, autolayout, uicollectionview
Driftwood
Driftwood is a DSL to make Auto Layout easy on iOS, tvOS and macOS.
Stars: ✭ 14 (-96.59%)
Mutual labels:  uikit, constraints, autolayout
Core Layout
Flexbox & CSS-style Layout in Swift.
Stars: ✭ 215 (-47.56%)
Mutual labels:  layout, autolayout, constraints
Snapkit
A Swift Autolayout DSL for iOS & OS X
Stars: ✭ 18,091 (+4312.44%)
Mutual labels:  layout, autolayout, constraints
CollectionLayouts
A collection of UICollectionViewLayouts
Stars: ✭ 64 (-84.39%)
Mutual labels:  uicollectionview, safari, uicollectionviewlayout
Easyswiftlayout
Lightweight Swift framework for Apple's Auto-Layout
Stars: ✭ 345 (-15.85%)
Mutual labels:  layout, autolayout, constraints
Pagingkit
PagingKit provides customizable menu UI. It has more flexible layout and design than the other libraries.
Stars: ✭ 1,030 (+151.22%)
Mutual labels:  uikit, uicollectionviewlayout, uicollectionview
Collectionviewslantedlayout
A CollectionView Layout displaying a slanted cells
Stars: ✭ 2,029 (+394.88%)
Mutual labels:  uikit, uicollectionviewlayout, uicollectionview
Alignedcollectionviewflowlayout
A collection view layout that gives you control over the horizontal and vertical alignment of the cells.
Stars: ✭ 751 (+83.17%)
Mutual labels:  uikit, uicollectionviewlayout, uicollectionview
VanillaConstraints
🍦 Simplified and chainable AutoLayout constraints for iOS.
Stars: ✭ 42 (-89.76%)
Mutual labels:  layout, constraints, autolayout
EZAnchor
An easier and faster way to code Autolayout
Stars: ✭ 25 (-93.9%)
Mutual labels:  layout, constraints, autolayout
Blueprints
🌀 Blueprints - A framework that is meant to make your life easier when working with collection view flow layouts.
Stars: ✭ 874 (+113.17%)
Mutual labels:  layout, uicollectionviewlayout, uicollectionview
Kvconstraintkit
An Impressive Auto Layout DSL for iOS, tvOS & OSX. & It is written in pure swift.
Stars: ✭ 91 (-77.8%)
Mutual labels:  layout, autolayout, constraints
ios ui recipe showcase
iOSアプリ開発 - UI実装であると嬉しいレシピブック掲載サンプル
Stars: ✭ 54 (-86.83%)
Mutual labels:  uicollectionview, uikit, autolayout

uicollectionview-layouts-kit Awesome

Platform Language CustomLayouts Last Commit NLOC Contributors Repo Size License

If you like the project, please give it a star ⭐ It will show the creator your appreciation and help others to discover the repo.

✍️ About

📐 A set of custom layouts for UICollectionView with examples. All the layouts support both portrait and landscape UI orientations as well as support for all iOS-related size classes (iPhone & iPad).

⚠️ Warning

The assets used in this project were taken from the Web. Do not use them for commertial purposes and proprietary projects. They are used just for demostration only.

🏗 Setup

In order to add layouts to your project, simply copy-paste corresponding Layout file (each of the targets has folder called Layout that contains all the related sources). There is no point in adding any dependency manager, since each custom UICollectionViewLayout can be more easily added just by dropping the corresponding layout source file into your project.

✈️ Usage

The next step is to either programmatically or via Storyboard/Nib file connect the layout and override the default one.

Programmatic Setup

If you choose programmatic approach, all you need to do is to set the instance of a layout using the following scheme:

...
let verticalSnapCollectionFlowLayout = VerticalSnapCollectionFlowLayout()
// Use custom properties that are available for each layout
verticalSnapCollectionFlowLayout.minLineSpacing = 30
verticalSnapCollectionFlowLayout.spacingMultiplier = 8

collectionView.collectionViewLayout = verticalSnapCollectionFlowLayout

// or 

collectionView.setCollectionViewLayout(verticalSnapCollectionFlowLayout, animated: true)

Storyboard/Nib Setup

Setting up the layouts via Storyboard/Nib is very easy as well. All you need to do is the following:

  1. Find your Collection View in Xcode's visual editor
  2. Select it
  3. Open Attributes Inspector
  4. Find and change UI menu called Layout to Custom
  5. Set the class to the one that you wish to use

In your view controller you need to provide a valid reference to the UIViewController from Storyboard/Nib file where you overriden the default layout class.

For cases when you need to tell your custom layout what class is going to delegate the layout handling, use the following code:

...
if let layout = collectionView?.collectionViewLayout as? PinterestLayout {
    layout.delegate = self
}
...

For cases when you simply need to change properties for custom layouts that were set via visual editor, use the following code:

...
if let layout = collectionView?.collectionViewLayout as? InstagridLayout {
    layout.itemSpacing = 10
    layout.fixedDivisionCount = 4
    layout.scrollDirection = .vertical
}
...

If you use Storyboard/Nib approach, consider creating an IBOutlet to the custom layout and directly set it up, instead of casting layout using the collection view reference:

...
@IBOutlet weak var instagridLayout: InstagridLayout!

override func viewDidLoad() {
    super.viewDidLoad()
    
    // InstagridLyout setup
    instagridLayout.delegate = self
    instagridLayout.itemSpacing = 10
    instagridLayout.fixedDivisionCount = 4
    instagridLayout.scrollDirection = .vertical
}
...

📚 Contents

Please wait while the .gif files are loading (each of them is around 10Mb)

Safari iPhone

It's a custom layout that mimics UICollectionView layout that can be seen on iPhones in portrait orientation. The layout only supports portrait orientation, but can be adjusted for landscape orientation and even for n-column layout, that can be used, for example on wider screens, such as iPads.

  • [x] Perspective transformation that reveal cell's content while scrolling up and down
  • [x] Automatically adjusts contents to fit the current screen
  • [x] Portrait orientation
  • [x] Only for iPhones
  • [x] Adjustable: various properties can be changed
  • [x] Scalable: can be adopted to support iPad and various, sophisticated perspective transformation while scrolling

Stack

Is a custom layout that places the collection view items on top of each other - just as a stack of books on a table, observed from the top-to-bottom perspective.

  • [x] Snapping behavior when swiping between items
  • [x] Automatically adjusts the cell sizes
  • [x] Portrait & landscape orientations
  • [x] Customizable

Snap

Is a custom flow layout that adds snapping behavior to single column collection view. Landscape layout changes the number of columns to two - in order to more ergonomically fill in the horizontal space.

  • [x] Snapping behavior when scrolling
  • [x] Automatically adjusts the cell sizes
  • [x] Supports both scrolling directions e.g. .vertical and .horizontal
  • [x] Portrait & landscape orientations, with customizable horizontalOrientationDevider property, which adds an additional row of in the collection view layout
  • [x] Has customazable properties

Vertical Scrolling

Horizontal Scrolling

Pinterest

Is a custom layout that mimics Pinterest layout. Can be customized with a variable number of rows and custom cells.

  • [x] Automatically adjusts the cell sizes
  • [x] Supports both scrolling directions e.g. .vertical and .horizontal
  • [x] Portrait & landscape orientations
  • [x] Has customazable properties

Spinner

Is a custom layout that places collection view cells in a circular fashion with a snapping behavior. The spinning circle radius, cell size and cell decoration view can be customized. Supports both landscape and portrait layouts.

  • [x] Snapping behavior
  • [x] Automatically adjusts the cell sizes
  • [x] Supports both scrolling directions e.g. .vertical and .horizontal
  • [x] Portrait & landscape orientations
  • [x] Has customazable properties

Instagrid

Is a custom layout similar to Instagram's feed layout. Has several customization points and a delegate protocol for cell size runtime customization.

  • [x] Snapping behavior
  • [x] Automatically adjusts the cell sizes
  • [x] Supports both scrolling directions e.g. .vertical and .horizontal
  • [x] Portrait & landscape orientations
  • [x] Has customazable properties

Horizontal

Drawing

Vertical

👨‍💻 Author

Astemir Eleev

🔖 Licence

The project is available under MIT Licence

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