All Projects → efekanegeli → EEStackLayout

efekanegeli / EEStackLayout

Licence: MIT license
A structured vertical/horizontal stack layout

Programming Languages

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

Projects that are alternatives of or similar to EEStackLayout

tags
HTML tags in Go
Stars: ✭ 50 (+4.17%)
Mutual labels:  tags
StackFlowView
Enforce stack behaviour for custom UI flow.
Stars: ✭ 35 (-27.08%)
Mutual labels:  stack
Algorithm-Data-Structures-Python
Various useful data structures in Python
Stars: ✭ 34 (-29.17%)
Mutual labels:  stack
phppimaco
Biblioteca para geração de Etiquetas PIMACO
Stars: ✭ 61 (+27.08%)
Mutual labels:  tags
odin
High level 2d game engine written in Haskell.
Stars: ✭ 28 (-41.67%)
Mutual labels:  stack
qaz
qaz—A CLI tool for Templating & Managing stacks in AWS Cloudformation
Stars: ✭ 89 (+85.42%)
Mutual labels:  stack
svg-tag-mode
A minor mode for Emacs that replace keywords with nice SVG labels
Stars: ✭ 314 (+554.17%)
Mutual labels:  tags
rips-old
Rust IP Stack - A userspace IP stack written in Rust (Work in progress)
Stars: ✭ 32 (-33.33%)
Mutual labels:  stack
Competitive Coding
Contains Solution for all type of Problems of Competitive Programming. Updates Frequently as any problem is solved.
Stars: ✭ 16 (-66.67%)
Mutual labels:  stack
Fortress-of-Solitude
This Library has resources to solve common data structure algorithm problems like a Doubly linked list, Generic trees, Queue, Stack, and other algorithms. Each lib has an option to carry your custom data in elements. Custom data in detail, other fantastic resources.
Stars: ✭ 53 (+10.42%)
Mutual labels:  stack
stack
🥭 nxpm-stack lets you generate a complete and opinionated full-stack application in a Nx Workspace, ready to extend and deploy!
Stars: ✭ 98 (+104.17%)
Mutual labels:  stack
SwiftTTPageController
最常见的标签控制器,仿今日头条首页、网易新闻首页 ,实现多个ViewController列表切换(更新适配Swift5)
Stars: ✭ 26 (-45.83%)
Mutual labels:  tags
f-flat node
F♭ (pronounced F-flat) is a toy language.
Stars: ✭ 22 (-54.17%)
Mutual labels:  stack
react-native-element-textinput
A react-native TextInput, TagsInput and AutoComplete component easy to customize for both iOS and Android.
Stars: ✭ 28 (-41.67%)
Mutual labels:  tags
Data-Structures
Algorithmic Problems Solutions -- hash table code featured in geeksforgeeks
Stars: ✭ 44 (-8.33%)
Mutual labels:  stack
adversaria
Typeclass interfaces to access user-defined Scala annotations
Stars: ✭ 22 (-54.17%)
Mutual labels:  tags
arraydeque
A circular buffer with fixed capacity (Rust).
Stars: ✭ 82 (+70.83%)
Mutual labels:  stack
hatrack
Fast, multi-reader, multi-writer, lockless data structures for parallel programming
Stars: ✭ 55 (+14.58%)
Mutual labels:  stack
audio-tag-analyzer
Extracts metadata music metadata found in audio files
Stars: ✭ 18 (-62.5%)
Mutual labels:  tags
github-tags
给Github项目添加标签的Chrome插件,支持按标签搜索,支持数据云同步
Stars: ✭ 34 (-29.17%)
Mutual labels:  tags

EEStackLayout

A vertical stackview which takes subviews with different widths and adds them to it's rows with paddings, spacings etc.

Twitter: @efekanegeli CocoaPods

Screenshot

Installation

Cocoapods

pod 'EEStackLayout', '~> 0.1'
pod install

Swift Package Manager

.package(url: "https://github.com/efekanegeli/EEStackLayout.git", from: "0.1.11")

Manual

1. Download .zip file
2. Just drag and drop EEStackLayout.swift to your project

Example Usage

// Subviews that will be added to stack layout
var viewArray = [UIView]()

// Choose the orientation of EEStackLayout -> vertical / horizontal [Just for demo purposes, change it if you want to see how horizontal EEStackLayout works]
let targetOrientationOfStackLayout = NSLayoutConstraint.Axis.vertical

let stackLayout: EEStackLayout

if targetOrientationOfStackLayout == .vertical {
    // Vertical EEStackLayout

    // Views with same height for the vertical layout
    for _ in 1...25 {
        let view1 = UIView(frame: CGRect(x: 0, y: 0, width: 20, height: 42))
        view1.backgroundColor = .green
        let view2 = UIView(frame: CGRect(x: 0, y: 0, width: 30, height: 42))
        view2.backgroundColor = .blue
        let view3 = UIView(frame: CGRect(x: 0, y: 0, width: 40, height: 42))
        view3.backgroundColor = .yellow
        let view4 = UIView(frame: CGRect(x: 0, y: 0, width: 50, height: 42))
        view4.backgroundColor = .black
        viewArray.append(view1)
        viewArray.append(view2)
        viewArray.append(view3)
        viewArray.append(view4)
    }

    // Vertical EEStackLayout setup
    stackLayout = EEStackLayout(frame: CGRect(x: 0, y: 50, width: 300, height: 0),
                                rowHeight: 20,
                                minimumInteritemSpacing: 15,
                                minimumItemSpacing: 10,
                                insets: UIEdgeInsets(top: 15, left: 15, bottom: 15, right: 15),
                                subviews: viewArray)

} else {
    // Horizontal EEStackLayout

    // Views with same width for the horizontal layout
    for _ in 1...25 {
        let view1 = UIView(frame: CGRect(x: 0, y: 0, width: 30, height: 15))
        view1.backgroundColor = .green
        let view2 = UIView(frame: CGRect(x: 0, y: 0, width: 30, height: 25))
        view2.backgroundColor = .blue
        let view3 = UIView(frame: CGRect(x: 0, y: 0, width: 30, height: 35))
        view3.backgroundColor = .yellow
        let view4 = UIView(frame: CGRect(x: 0, y: 0, width: 30, height: 45))
        view4.backgroundColor = .black
        viewArray.append(view1)
        viewArray.append(view2)
        viewArray.append(view3)
        viewArray.append(view4)
    }

    // Horizontal EEStackLayout setup
    stackLayout = EEStackLayout(frame: CGRect(x: 0, y: 50, width: 0, height: 400),
                                columnWidth: 20,
                                minimumInteritemSpacing: 15,
                                minimumItemSpacing: 10,
                                insets: UIEdgeInsets(top: 15, left: 15, bottom: 15, right: 15),
                                subviews: viewArray)
}

self.view.addSubview(stackLayout)

Init Properties

minimumItemSpacing -> Spacing between rows(vertical layout) or colums(horizontal layout)
rowHeight -> Row height of the main vertical stack view
maximumRowCount -> Maximum row count of the vertical stack view, ignores the rest of the subviews if the actual row count exceeds the limit
columnWidth -> Column width of the main horizontal stack view
maximumColumnCount -> Maximum column count of the horizontal stack view, ignores the rest of the subviews if the actual column count exceeds the limit
minimumInteritemSpacing -> Spacing between items in a row/column
insets -> Layout margins of main vertical stack view
subviews -> View array of elements to be added to the main stack view

License

MIT License, Copyright (c) 2018 Efekan Egeli, @efekanegeli

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