SnapKit/index.html

38 lines
1.3 KiB
HTML
Raw Normal View History

2015-04-15 07:39:21 +08:00
---
layout: default
2015-04-15 18:52:48 +08:00
id: home
2015-04-15 07:39:21 +08:00
---
2015-04-16 20:10:40 +08:00
<div class="row">
<div id="info" class="small-12 large-6 columns">
2015-04-16 20:15:43 +08:00
<h4>SnapKit is a DSL to make Auto Layout easy on both iOS&nbsp;and&nbsp;OS&nbsp;X.</h4>
2015-04-15 18:52:48 +08:00
<ul>
<li><strong>Simple &amp; Expressive</strong> chaining DSL allows building constraints with minimal amounts of code while ensuring they are easy to read and understand.</li>
2015-04-16 20:10:40 +08:00
<li><strong>Type Safe</strong> by design to reduce programmer error and keep invalid constraints from being created in the first place for maximized productivity.</li>
<li><strong>Compatible</strong> for both iOS and OS X apps installable through Cocoapods or Carthage.</li>
2015-04-15 18:52:48 +08:00
<li><strong>Free</strong> to use in all projects and licensed under the flexible MIT&nbsp;license.</li>
</ul>
</div>
2015-04-15 07:39:21 +08:00
2015-04-16 20:10:40 +08:00
<div id="example" class="small-12 large-6 columns">
2015-04-15 18:52:48 +08:00
{% highlight swift %}
let box = UIView()
let container = UIView()
2015-04-15 07:39:21 +08:00
2015-04-15 18:52:48 +08:00
container.addSubview(box)
2015-04-15 07:39:21 +08:00
2015-04-15 18:52:48 +08:00
box.snp_makeConstraints { (make) -> Void in
make.size.equalTo(50)
make.center.equalTo(container)
}
{% endhighlight %}
<h6>makes</h6>
<div class="box">
<span>container</span>
<div class="box">
<span>box</span>
</div>
</div>
</div>
2015-04-15 07:39:21 +08:00
</div>
2015-04-15 18:52:48 +08:00
2015-04-16 20:10:40 +08:00
<button id="get-started-btn"><a href="/docs">Getting Started &amp; Docs &rarr;</a></button>