• Stars
    star
    662
  • Rank 65,468 (Top 2 %)
  • Language
    Swift
  • License
    Apache License 2.0
  • Created about 6 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A library that implements custom flow layouts for iOS apps

Build Status codecov

About

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

Layout types

Tags Pinterest 500px Instagram
Flipboard Facebook Flickr

Overview

  • 7 popular layouts for iOS collection view
  • Tags and Flipboard layouts support left and right content align
  • 500px has custom cells layout configuration
  • Three modes for Instagram layout (default grid mode, one preview cell, regular preview cell)
  • Each layout can be configured with content and cells paddings separately
  • Tests coverage more than 90%

Installation

CocoaPods

Collection View Layouts is available through CocoaPods. To install it, simply add the following lines (depends on your needs) to your Podfile:

pod 'collection-view-layouts/Core'
pod 'collection-view-layouts/TagsLayout'
pod 'collection-view-layouts/PinterestLayout'
pod 'collection-view-layouts/Px500Layout'
pod 'collection-view-layouts/InstagramLayout'
pod 'collection-view-layouts/FlipboardLayout'
pod 'collection-view-layouts/FacebookLayout'
pod 'collection-view-layouts/FlickrLayout'

Requirements

iOS: 11.0+
Swift: 5.0
CocoaPods: for iOS

Example

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

Usage

Configuration of custom layouts is pretty easy:

var layout: BaseLayout = TagsLayout()

layout.delegate = self
layout.delegate = ItemsPadding(horizontal: 10, vertical: 10)
layout.cellsPadding = ItemsPadding(horizontal: 8, vertical: 8)

collectionView.collectionViewLayout = layout
collectionView.reloadData()

Also, you have to implement LayoutDelegate protocol:

public protocol LayoutDelegate: class {
    func cellSize(indexPath: IndexPath) -> CGSize
}

func cellSize(indexPath: IndexPath) -> CGSize {
    return cellsSizes[indexPath.row]
}

Author

Sergey Afanasiev

Getting Help

[email protected]

License

Collection View Layouts is licensed under the Apache 2.0 license


RubyGarage Logo

RubyGarage is a leading software development and consulting company in Eastern Europe. Our main expertise includes Ruby and Ruby on Rails, but we successfuly employ other technologies to deliver the best results to our clients. Check out our portoflio for even more exciting works!

More Repositories

1

emotion-rating-view

A library for animated rating view in Android apps.
Kotlin
302
star
2

media-watermark

GPU/CPU-based iOS Watermark Library for Image and Video Overlay
Swift
203
star
3

shopapp-android

ShopApp is an application that transfers an online store into a mobile app
Kotlin
148
star
4

react-native-firebase-chat

This repository contains the source code for a simple chat application built with React Native (frontend) and Firebase (backend).
JavaScript
148
star
5

shopapp-ios

ShopApp is an application that transfers an online store into a mobile app
Swift
114
star
6

detectify

Detectify is a gem for multi-tenant Rack apps, to help you retrieve domain and subdomain-related data from a database.
Ruby
79
star
7

boilerplate

This repo will help you to build quickly your Rails API with Trailblazer and friends.
Ruby
57
star
8

Design-Patterns-in-Swift

This is a repository for our article about design patterns in the Swift programming language https://rubygarage.org/blog/swift-design-patterns
Swift
53
star
9

shopapp-shopify-ios

A Shopify provider for a ShopApp for iOS application
Swift
52
star
10

shopapp-shopify-android

A Shopify provider for a ShopApp for Android application
Kotlin
51
star
11

authorize-me

Authorization with social networks
Swift
44
star
12

rubygarage.github.com

This repository contains slides for Ruby/Ruby on Rails courses from RubyGarage
CSS
44
star
13

nextjs6-graphql-client-tutorial

Demo app
JavaScript
43
star
14

mvc-components-refactoring-in-rails

Code examples of MVC components refactoring in Rails from RubyGarage to SitePoint
Ruby
16
star
15

arkit-example

This repository is created for the article https://rubygarage.org/blog/create-augmented-reality-app-for-ios-11
Swift
12
star
16

shareconomy

Ruby
7
star
17

holtwinters

JavaScript
4
star
18

graphql_meetup

Ruby
4
star
19

graphql-tutorial

Ruby
3
star
20

monitorbit

Ruby
2
star
21

aws-practice

2
star
22

odbcimporter

Go
1
star
23

rubyhub

Ruby implementation for hub soft
Ruby
1
star
24

vertigo-rtm-outdated

Ruby
1
star
25

frontend-internship-template

JavaScript
1
star
26

bootstrap-store-theme

HTML
1
star
27

interview-rails

Ruby
1
star
28

action_controller_audit_trail

Action Controller Audit Trail gem
Ruby
1
star
29

trailblazer-courses

Ruby
1
star
30

ios-application-testing

This repository demonstrates how to set up your iOS project for automated testing. We created this repo as a demo project for the article https://rubygarage.org/blog/testing-ios-app .
Swift
1
star
31

interview-vuejs

Vue
1
star
32

sentryimporter

Go
1
star
33

terraform-boilerplate

HCL
1
star
34

interview-react-and-scss

JavaScript
1
star