Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Snapkit | 18,937 | 3,093 | 7 months ago | 27 | April 13, 2022 | 88 | mit | Swift | ||
A Swift Autolayout DSL for iOS & OS X | ||||||||||
Sdautolayout | 5,868 | 326 | 2 years ago | 20 | October 08, 2018 | 155 | mit | Objective-C | ||
One line of code to implement automatic layout. 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于做最简单易用的AutoLayout库。The most easy way for autoLayout. Based on runtime. | ||||||||||
Mylinearlayout | 4,113 | 25 | 2 years ago | 42 | December 23, 2019 | 26 | mit | Objective-C | ||
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 UITableView UICollectionView RTL | ||||||||||
Stevia | 3,328 | 48 | a year ago | 33 | December 10, 2019 | 14 | mit | Swift | ||
:leaves: Concise Autolayout code | ||||||||||
Aloestackview | 2,762 | 3 years ago | 21 | apache-2.0 | Swift | |||||
A simple class for laying out a collection of views with a convenient API, while leveraging the power of Auto Layout. | ||||||||||
Pinlayout | 2,148 | 29 | 16 days ago | 70 | December 18, 2020 | 14 | mit | Swift | ||
Fast Swift Views layouting without auto layout. No magic, pure code, full control and blazing fast. Concise syntax, intuitive, readable & chainable. [iOS/macOS/tvOS/CALayer] | ||||||||||
Easypeasy | 1,821 | 48 | 2 years ago | 25 | January 15, 2021 | 17 | mit | Swift | ||
Auto Layout made easy | ||||||||||
Gskstretchyheaderview | 1,698 | 12 | 8 months ago | 16 | February 07, 2018 | 12 | mit | Objective-C | ||
A generic stretchy header for UITableView and UICollectionView | ||||||||||
Flexlib | 1,649 | 2 | 2 months ago | 100 | January 18, 2021 | 9 | mit | Objective-C | ||
FlexLib是一个基于flexbox模型,使用xml文件进行界面布局的框架,融合了web快速布局的能力,让iOS界面开发像写网页一样简单快速 | ||||||||||
Uiview Autolayout | 1,485 | 49 | 9 years ago | 15 | March 24, 2015 | 1 | other | Objective-C | ||
Deprecated in favor of PureLayout, which includes OS X support: |
SnapKit is a DSL to make Auto Layout easy on both iOS and OS X.
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
CocoaPods 1.1.0+ is required to build SnapKit 4.0.0+.
To integrate SnapKit into your Xcode project using CocoaPods, specify it in your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target '<Your Target Name>' do
pod 'SnapKit', '~> 5.6.0'
end
Then, run the following command:
$ pod install
Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with Homebrew using the following command:
$ brew update
$ brew install carthage
To integrate SnapKit into your Xcode project using Carthage, specify it in your Cartfile
:
github "SnapKit/SnapKit" ~> 5.0.0
Run carthage update
to build the framework and drag the built SnapKit.framework
into your Xcode project.
Swift Package Manager is a tool for managing the distribution of Swift code. Its integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.
Xcode 11+ is required to build SnapKit using Swift Package Manager.
To integrate SnapKit into your Xcode project using Swift Package Manager, add it to the dependencies value of your Package.swift
:
dependencies: [
.package(url: "https://github.com/SnapKit/SnapKit.git", .upToNextMajor(from: "5.0.1"))
]
If you prefer not to use either of the aforementioned dependency managers, you can integrate SnapKit into your project manually.
import SnapKit
class MyViewController: UIViewController {
lazy var box = UIView()
override func viewDidLoad() {
super.viewDidLoad()
self.view.addSubview(box)
box.backgroundColor = .green
box.snp.makeConstraints { (make) -> Void in
make.width.height.equalTo(50)
make.center.equalTo(self.view)
}
}
}
You can try SnapKit in Playground.
Note:
To try SnapKit in playground, open
SnapKit.xcworkspace
and build SnapKit.framework for any simulator first.
SnapKit is released under the MIT license. See LICENSE for details.