All Projects → spicyShrimp → Snapkitextend

spicyShrimp / Snapkitextend

Licence: mit
SnapKit的扩展,SnapKit类似于Masonry,但是其没有对Arry的设置和对等间距排列的布局等,此扩展是类似Masonry的写法对SnapKit的补充,同时补充九宫格布局方式

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Snapkitextend

SuperPuperDuperLayout
Super puper duper mega easy awesome wrapper over auto layout!!111!!1!!!1!!!11111!!!1!!
Stars: ✭ 14 (-87.27%)
Mutual labels:  layout, constraints
Cupcake
An easy way to create and layout UI components for iOS (Swift version).
Stars: ✭ 273 (+148.18%)
Mutual labels:  layout, constraints
VanillaConstraints
🍦 Simplified and chainable AutoLayout constraints for iOS.
Stars: ✭ 42 (-61.82%)
Mutual labels:  layout, constraints
Arranged
Open source replacement of UIStackView for iOS 8 (100% layouts supported)
Stars: ✭ 202 (+83.64%)
Mutual labels:  layout, constraints
Tinyconstraints
Nothing but sugar.
Stars: ✭ 3,721 (+3282.73%)
Mutual labels:  layout, constraints
Kvconstraintkit
An Impressive Auto Layout DSL for iOS, tvOS & OSX. & It is written in pure swift.
Stars: ✭ 91 (-17.27%)
Mutual labels:  layout, constraints
EZAnchor
An easier and faster way to code Autolayout
Stars: ✭ 25 (-77.27%)
Mutual labels:  layout, constraints
Core Layout
Flexbox & CSS-style Layout in Swift.
Stars: ✭ 215 (+95.45%)
Mutual labels:  layout, constraints
Easyswiftlayout
Lightweight Swift framework for Apple's Auto-Layout
Stars: ✭ 345 (+213.64%)
Mutual labels:  layout, constraints
Snapkit
A Swift Autolayout DSL for iOS & OS X
Stars: ✭ 18,091 (+16346.36%)
Mutual labels:  layout, constraints
Easypeasy
Auto Layout made easy
Stars: ✭ 1,877 (+1606.36%)
Mutual labels:  layout, constraints
Uicollectionview Layouts Kit
📐 A set of custom layouts for UICollectionView with examples [Swift 5.3, iOS 12].
Stars: ✭ 410 (+272.73%)
Mutual labels:  layout, constraints
wwlayout
Swifty DSL for programmatic Auto Layout in iOS
Stars: ✭ 46 (-58.18%)
Mutual labels:  layout, constraints
Stevia
🍃 Concise Autolayout code
Stars: ✭ 3,182 (+2792.73%)
Mutual labels:  layout, constraints
Nerdyui
An easy way to create and layout UI components for iOS.
Stars: ✭ 381 (+246.36%)
Mutual labels:  layout, constraints
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 (+3674.55%)
Mutual labels:  layout, constraints
Interfacss
The CSS-inspired styling and layout framework for iOS
Stars: ✭ 92 (-16.36%)
Mutual labels:  layout
Form
Form is an iOS Swift library for building and styling UIs
Stars: ✭ 99 (-10%)
Mutual labels:  layout
Bannerlayout
Support unlimited picture rotation BannerLayout, the minimum implementation of the code banner
Stars: ✭ 92 (-16.36%)
Mutual labels:  layout
Jafar
🌟!(Just another form application renderer)
Stars: ✭ 107 (-2.73%)
Mutual labels:  layout

SnapKitExtend

SnapKit的扩展,SnapKit类似于Masonry,但是其没有对Arry的设置和对等间距排列的布局等,此扩展是类似Masonry的写法对SnapKit的补充,同时补充九宫格布局方式

pod 'SnapKitExtend', '~> 1.1.0'

数组布局

let arr = [view1, view2, view3, view4]
        
arr.snp.makeConstraints{
    $0.width.height.equalTo(100)
    $0.center.equalTo(CGPoint(x: CGFloat(arc4random_uniform(300)) + 50,
                              y: CGFloat(arc4random_uniform(300)) + 50))
}

数组布局2

let arr = [view1, view2, view3, view4]
         
arr.snp.makeConstraints{
    $0.width.height.equalTo(100)
}

view1.snp.makeConstraints{ $0.top.equalTo(0) }
view2.snp.makeConstraints{ $0.top.equalTo(100) }
view3.snp.makeConstraints{ $0.top.equalTo(200) }
view4.snp.makeConstraints{ $0.top.equalTo(300) } 

等间距布局

let arr = [view1, view2, view3, view4]

//        axisType:方向
//        fixedSpacing:中间间距
//        leadSpacing:左边距(上边距)
//        tailSpacing:右边距(下边距)
arr.snp.distributeViewsAlong(axisType: .horizontal, fixedSpacing: 10, leadSpacing: 10, tailSpacing: 10)
//        上面的可以约束x+w,还需要另外约束y+h
//        约束y和height()如果方向是纵向,那么则另外需要设置x+w
arr.snp.makeConstraints{
    $0.top.equalTo(100)
    $0.height.equalTo(CGFloat(arc4random_uniform(100) + 50))
}

等大小布局

let arr = [view1, view2, view3, view4]
        
//        axisType:方向
//        fixedItemLength:item对应方向的宽或者高
//        leadSpacing:左边距(上边距)
//        tailSpacing:右边距(下边距)
arr.snp.distributeViewsAlong(axisType: .vertical, fixedItemLength: 100, leadSpacing: 30, tailSpacing: 30)
//        上面的可以约束y+h,还需要另外约束x+w
//        约束y和height()如果方向是纵向,那么则另外需要设置y+h
arr.snp.makeConstraints{
    $0.width.left.equalTo(100)
}

九宫格布局

var arr: Array<ConstraintView> = [];
for _ in 0..<9 {
    let subview = UIView()
    subview.backgroundColor = UIColor.random
    view.addSubview(subview)
    arr.append(subview)
}

//        固定大小,可变中间间距,上下左右间距默认为0,可以设置
arr.snp.distributeSudokuViews(fixedItemWidth: 100, fixedItemHeight: 100, warpCount: 3)

九宫格布局2

var arr: Array<ConstraintView> = [];
for _ in 0..<9 {
    let subview = UIView()
    subview.backgroundColor = UIColor.random
    view.addSubview(subview)
    arr.append(subview)
}

//        固定间距,可变大小,上下左右间距默认为0,可以设置
arr.snp.distributeSudokuViews(fixedLineSpacing: 10, fixedInteritemSpacing: 10, warpCount: 3)
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].