• Stars
    star
    357
  • Rank 119,149 (Top 3 %)
  • Language
    Swift
  • License
    MIT License
  • Created about 9 years ago
  • Updated over 1 year ago

Reviews

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

Repository Details

Made in Swift - Tag layout for UICollectionView supporting 3 types of alignments - Left || Centre || Right

TagCellLayout

Build Status Badge w/ Version Badge w/ Platform License MIT

About

Its an ui-collection-view LAYOUT class that takes care of all the logic behind making tags like layout using UICollectionView. It also allows you to adjust the alignment of your layout i.e Left || Centre || Right. Now you just have to take care of your tag view and nothing else. Aaaand it also supports multi-line tags πŸš€

Screenshots

Center Alignment Left Alignment Right Alignment

Usage

  • Init Method:
import TagCellLayout

let tagCellLayout = TagCellLayout(alignment: .center, delegate: self)
collectionView.collectionViewLayout = tagCellLayout
  • Tag Alignment:

alignment can be Left or Center or Right. If its nil then by default Left alignment will be applied.

Delegate Methods

  • Protocol to conform - TagCellLayoutDelegate

  • Methods

- 	func tagCellLayoutTagSize(layout: TagCellLayout, atIndex index:Int) -> CGSize

Architecture

  • func tagCellLayoutTagSize(layout: TagCellLayout, atIndex index:Int) -> CGSize

is called for every tag where you will calculate their size and pass it on to TagCellLayout class for further calculations.

  • collectionView.numberOfItemsInSection(0)

internally the number of tags is calculated by the above method.

Installation

To integrate TagCellLayout into your Xcode project using CocoaPods, specify it in your Podfile:

Swift-4.0

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'TagCellLayout', :git => 'https://github.com/riteshhgupta/TagCellLayout.git'

Swift-3.2

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'TagCellLayout', :git => 'https://github.com/riteshhgupta/TagCellLayout.git', :branch => 'swift3.2'

Swift-3.0

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'TagCellLayout', :git => 'https://github.com/riteshhgupta/TagCellLayout.git', :branch => 'swift3.0'

Swift-2.3

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'TagCellLayout', :git => 'https://github.com/riteshhgupta/TagCellLayout.git', :branch => 'swift2.3'

Swift-2.2

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'TagCellLayout', '~> 0.3'

Contributing

Open an issue or send pull request here.

Licence

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

More Repositories

1

RGListKit

RGListKit is a Protocol & MVVM based framework to easily populate a UITableView or UICollectionView via single api.
Swift
178
star
2

awesome-combine

A collaborative list of awesome Combine resources and libraries. Feel free to contribute!
62
star
3

PullToRefreshPaginationManager

Made in Swift - PullToRefreshPaginationManager allows you to have Refresh (pull-to-refresh) & Pagination (load-more) functionality with just few lines of code.
Swift
11
star
4

swift-delhi

Swift-Delhi is swift meetup group in delhi for developers who are working or willing to learn Swift - a programming language by Apple to primarily make applications for Apple ecosystem.
Swift
8
star
5

RGBottomSheet

RGBottomSheet is an iOS UI component which presents a dismissible view from the bottom of the screen!
Swift
6
star
6

combine-demo-swiftindia

It's a demo project explaining `Combine` with couple of examples.
Swift
4
star
7

SwiftAnytime

SwiftAnytime
Swift
3
star
8

RGDependencyInjector

RGDependencyInjector is a protocol oriented dependency injection Β΅-framework for iOS.
Swift
3
star
9

jarvis

Shell
2
star
10

mvi-ios

Swift
2
star
11

reklaim

Kotlin
2
star
12

try-swift-beginner-workshop

Swift Beginner Workshop Content –– try!Swift Bangalore 2017
Swift
2
star
13

RGStoreKit

*RGStoreKit* is a protocol oriented persistence framework for iOS apps.
Swift
2
star
14

swift-snippets

1
star
15

ProtoKit

ProtoKit is a protocol oriented UIKit!
Swift
1
star
16

kotlin-resources

A list of helpful resources related to Kotlin!
1
star
17

RGRoutable

RGRoutable is a protocol oriented library to handle screen navigation/routing in iOS.
Swift
1
star
18

RGMapper

Its safely maps `Any` (could be api response) into custom types.
Swift
1
star
19

RGToolKit

Its a collection of some awesome swifty functions, extensions, properties which could speed up your Swift development!!!
Swift
1
star