Skip to content

Commit d0d91b4

Browse files
committed
Rename to SwiftAutoLayout
1 parent 872c608 commit d0d91b4

15 files changed

+85
-85
lines changed
File renamed without changes.

README.md

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
# SwiftLayout
1+
# SwiftAutoLayout
22

33
[![Twitter: @TimothyMoose](https://img.shields.io/badge/contact-@TimothyMoose-blue.svg?style=flat)](https://twitter.com/TimothyMoose)
4-
[![Version](https://img.shields.io/cocoapods/v/SwiftLayout.svg?style=flat)](http://cocoadocs.org/docsets/SwiftLayout)
5-
[![License](https://img.shields.io/cocoapods/l/SwiftLayout.svg?style=flat)](http://cocoadocs.org/docsets/SwiftLayout)
6-
[![Platform](https://img.shields.io/cocoapods/p/SwiftLayout.svg?style=flat)](http://cocoadocs.org/docsets/SwiftLayout)
4+
[![Version](https://img.shields.io/cocoapods/v/SwiftAutoLayout.svg?style=flat)](http://cocoadocs.org/docsets/SwiftAutoLayout)
5+
[![License](https://img.shields.io/cocoapods/l/SwiftAutoLayout.svg?style=flat)](http://cocoadocs.org/docsets/SwiftAutoLayout)
6+
[![Platform](https://img.shields.io/cocoapods/p/SwiftAutoLayout.svg?style=flat)](http://cocoadocs.org/docsets/SwiftAutoLayout)
77
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
88

99
<p align="center">
10-
<img src="./Design/SwiftLayoutBanner.gif" />
10+
<img src="./Design/SwiftAutoLayoutBanner.gif" />
1111
</p>
1212

1313
## Overview
1414

15-
SwiftLayout helps you write AutoLayout constraints as consisely, Swiftly, and as natively as possible. Constrain `UIView` and `UILayoutGuide`s interchangeably with a familiar syntax named to match their native properties. This library purposefuly minimizes the repetitive code of defining view hierarchies and building constraints while maximizing constraint flexibility via optional parameters.
15+
SwiftAutoLayout helps you write AutoLayout constraints as consisely, Swiftly, and as natively as possible. Constrain `UIView` and `UILayoutGuide`s interchangeably with a familiar syntax named to match their native properties. This library purposefuly minimizes the repetitive code of defining view hierarchies and building constraints while maximizing constraint flexibility via optional parameters.
1616

17-
SwiftLayout is written to match the AutoLayout APIs as closely as possible, only wrapping types where it improves legibility and simplifies amount of written code. This means your knowledge of AutoLayout directly translates to SwiftLayout, with minimal functionality introduced on top. SwiftLayout does not provide any custom closures or syntaxes for defining constraints, and prefers a functional proramming angle to keep things on a minimum number of lines.
17+
SwiftAutoLayout is written to match the AutoLayout APIs as closely as possible, only wrapping types where it improves legibility and simplifies amount of written code. This means your knowledge of AutoLayout directly translates to SwiftAutoLayout, with minimal functionality introduced on top. SwiftAutoLayout does not provide any custom closures or syntaxes for defining constraints, and prefers a functional proramming angle to keep things on a minimum number of lines.
1818

1919
## Usage
2020

@@ -29,7 +29,7 @@ override func viewDidLoad() {
2929

3030
// Create a label
3131
let label = UILabel()
32-
label.text = "SwiftLayout is neato!"
32+
label.text = "SwiftAutoLayout is neato!"
3333

3434
// Constrain its leading and centerY anchors to be equal to our view's respective anchors
3535
// Because label doesn't yet have a parent, it will become a child of our view
@@ -57,7 +57,7 @@ let label = UILabel()
5757
label.constrain(to: container.layoutMarginsGuide).leadingTrailingTopBottom()
5858

5959
// Ensure the label doesn't get wider than our view within a constant.
60-
// Since label is a child of container by this point, SwiftLayout doesn't set its parent.
60+
// Since label is a child of container by this point, SwiftAutoLayout doesn't set its parent.
6161
label.constrain(to: view).width(.lessThanOrEqual, constant: -60, priority: .defaultHigh)
6262

6363
// The view hierarchy is now:
@@ -68,7 +68,7 @@ label.constrain(to: view).width(.lessThanOrEqual, constant: -60, priority: .defa
6868

6969
### Customizing Constraints
7070

71-
SwiftLayout makes use of optional arguments to provide clean code when the constraint criteria is an `.equal` relationship, has a constant of 0, multiplier of 1, priority of `.required` and should activate the constraint upon creation. To specify custom values, supply the appropriate method with an argument.
71+
SwiftAutoLayout makes use of optional arguments to provide clean code when the constraint criteria is an `.equal` relationship, has a constant of 0, multiplier of 1, priority of `.required` and should activate the constraint upon creation. To specify custom values, supply the appropriate method with an argument.
7272

7373
```swift
7474
// Simple leading padding of 16 points
@@ -97,13 +97,13 @@ label.constrain(to: view.layoutMarginsGuide).leadingTrailingTopBottom()
9797

9898
### Defining Different Kinds of Constraints
9999

100-
SwiftLayout has 3 main methods for creating different constraint builders suited for different tasks.
100+
SwiftAutoLayout has 3 main methods for creating different constraint builders suited for different tasks.
101101

102-
- `constrain(to:)` returns a [`RelationalConstraintBuilder`](./SwiftLayout/RelationalConstraintBuilder.swift) that is useful for embedding a view inside another and creating constraints that match anchors. In uncommon scenarios where you want to define a constraint between two different anchors, use this builder's `xAxis(_:to:)`, `yAxis(_:to:)`, and `dimension(_:to:)` methods.
102+
- `constrain(to:)` returns a [`RelationalConstraintBuilder`](./SwiftAutoLayout/RelationalConstraintBuilder.swift) that is useful for embedding a view inside another and creating constraints that match anchors. In uncommon scenarios where you want to define a constraint between two different anchors, use this builder's `xAxis(_:to:)`, `yAxis(_:to:)`, and `dimension(_:to:)` methods.
103103

104-
- `constrain(after:)` returns a [`DistributiveConstraintBuilder`](./SwiftLayout/DistributiveConstraintBuilder.swift) that has a couple methods for placing this view vertically or horizontally after another. This builder expects its views and layout guides to already have parents.
104+
- `constrain(after:)` returns a [`DistributiveConstraintBuilder`](./SwiftAutoLayout/DistributiveConstraintBuilder.swift) that has a couple methods for placing this view vertically or horizontally after another. This builder expects its views and layout guides to already have parents.
105105

106-
- `constrainSelf()` returns a [`SelfConstraintBuilder`](./SwiftLayout/SelfConstraintBuilder.swift) which is great for constraining your view's width, height, or aspect ratio.
106+
- `constrainSelf()` returns a [`SelfConstraintBuilder`](./SwiftAutoLayout/SelfConstraintBuilder.swift) which is great for constraining your view's width, height, or aspect ratio.
107107

108108
### Getting Constraints
109109

@@ -136,7 +136,7 @@ constraint.isActive = true // smoosh!
136136

137137
### System Spacing
138138

139-
You can specify constraints that use system spacing for their "constant" in iOS 11 and later. This is accomplished by an extension on `CGFloat` named `.systemSpacing` — which is a special placeholder value SwiftLayout will take into account when creating your constraint. This value has no use outside of SwiftLayout, and does not work with the `constrainSelf()` builder.
139+
You can specify constraints that use system spacing for their "constant" in iOS 11 and later. This is accomplished by an extension on `CGFloat` named `.systemSpacing` — which is a special placeholder value SwiftAutoLayout will take into account when creating your constraint. This value has no use outside of SwiftAutoLayout, and does not work with the `constrainSelf()` builder.
140140

141141
```swift
142142
label.constrain(to: view).leadingTrailing(constant: .systemSpacing)
@@ -161,7 +161,7 @@ label.constrain(to: view).dimension(.width, to: .height)
161161

162162
### Note about Left and Right Anchors
163163

164-
SwiftLayout does not use left and right anchors. This simplifies x axis anchors usage by disallowing incorrect usage (mixing left and leading) and cleans up autocomplete. [Apple states](https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/AutolayoutPG/AnatomyofaConstraint.html) you should use leading and trailing anchors always, and in scenarios where you want your constraints to not be affected by language direction, change your view's [`semanticContentAttribute`](https://developer.apple.com/documentation/uikit/uiview/1622461-semanticcontentattribute).
164+
SwiftAutoLayout does not use left and right anchors. This simplifies x axis anchors usage by disallowing incorrect usage (mixing left and leading) and cleans up autocomplete. [Apple states](https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/AutolayoutPG/AnatomyofaConstraint.html) you should use leading and trailing anchors always, and in scenarios where you want your constraints to not be affected by language direction, change your view's [`semanticContentAttribute`](https://developer.apple.com/documentation/uikit/uiview/1622461-semanticcontentattribute).
165165

166166
> Avoid using Left and Right attributes. Use Leading and Trailing instead. This allows the layout to adapt to the view’s reading direction.
167167
@@ -171,7 +171,7 @@ SwiftLayout does not use left and right anchors. This simplifies x axis anchors
171171

172172
### Custom Parents
173173

174-
If you have a special scenario where you want a view's parent to not be set when using `constrain(to:)`, just set its parent beforehand. SwiftLayout's goal is to simplify hierarchy generation and ensure a view has a parent when constraints are created, and it will not change a hierarchy once it exists.
174+
If you have a special scenario where you want a view's parent to not be set when using `constrain(to:)`, just set its parent beforehand. SwiftAutoLayout's goal is to simplify hierarchy generation and ensure a view has a parent when constraints are created, and it will not change a hierarchy once it exists.
175175

176176
### Work from the Bottom Up
177177

@@ -187,7 +187,7 @@ As a reminder, setting a view's [`accessibilityIdentifier`](https://developer.ap
187187

188188
### Use Layout Guides!
189189

190-
`UILayoutGuide`s are awesome. If you set up your views correctly and use their [`directionalLayoutMargins`](https://developer.apple.com/documentation/uikit/uiview/2865930-directionallayoutmargins) you can write elegant constraints with minimal constants. Since SwiftLayout doesn't use left and right anchors, it's recommended to use [`NSDirectionalEdgeInsets`](https://developer.apple.com/documentation/uikit/nsdirectionaledgeinsets) when setting up your layout guides.
190+
`UILayoutGuide`s are awesome. If you set up your views correctly and use their [`directionalLayoutMargins`](https://developer.apple.com/documentation/uikit/uiview/2865930-directionallayoutmargins) you can write elegant constraints with minimal constants. Since SwiftAutoLayout doesn't use left and right anchors, it's recommended to use [`NSDirectionalEdgeInsets`](https://developer.apple.com/documentation/uikit/nsdirectionaledgeinsets) when setting up your layout guides.
191191

192192
You can also create new layout guides instead of views when you need to simplify view layout.
193193

@@ -207,9 +207,9 @@ zip(buttons, [0.5, 1.0, 1.5]) { (button, multiplier)
207207

208208
## Room for Improvement
209209

210-
As of now, SwiftLayout does not support AppKit, but is open to pull requests!
210+
As of now, SwiftAutoLayout does not support AppKit, but is open to pull requests!
211211

212-
SwiftLayout only supports anchors that both `UIView` and `UILayoutGuide` have, so `firstBaselineAnchor` and `lastBaselineAnchor` (which only exist on `UIView`) are not yet supported. Again, pull requests are welcome!
212+
SwiftAutoLayout only supports anchors that both `UIView` and `UILayoutGuide` have, so `firstBaselineAnchor` and `lastBaselineAnchor` (which only exist on `UIView`) are not yet supported. Again, pull requests are welcome!
213213

214214
## Installation
215215

@@ -218,22 +218,22 @@ SwiftLayout only supports anchors that both `UIView` and `UILayoutGuide` have, s
218218
Add the following line to your Podfile:
219219

220220
````ruby
221-
pod 'SwiftLayout'
221+
pod 'SwiftAutoLayout'
222222
````
223223

224224
### Carthage
225225

226226
Add the following line to your Cartfile:
227227

228228
````ruby
229-
github "SwiftKickMobile/SwiftLayout"
229+
github "SwiftKickMobile/SwiftAutoLayout"
230230
````
231231

232232
### Manual
233233

234-
1. Put SwiftLayout repo somewhere in your project directory.
235-
1. In Xcode, add `SwiftLayout.xcodeproj` to your project.
236-
1. On your app's target, add the SwiftLayout framework:
234+
1. Put SwiftAutoLayout repo somewhere in your project directory.
235+
1. In Xcode, add `SwiftAutoLayout.xcodeproj` to your project.
236+
1. On your app's target, add the SwiftAutoLayout framework:
237237
1. as an embedded binary on the General tab.
238238
1. as a target dependency on the Build Phases tab.
239239

@@ -242,4 +242,4 @@ We build high quality apps! [Get in touch](http://www.swiftkickmobile.com) if yo
242242

243243
## License
244244

245-
SwiftLayout is distributed under the MIT license. [See LICENSE](./LICENSE.md) for details.
245+
SwiftAutoLayout is distributed under the MIT license. [See LICENSE](./LICENSE.md) for details.
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
Pod::Spec.new do |spec|
2-
spec.name = 'SwiftLayout'
2+
spec.name = 'SwiftAutoLayout'
33
spec.version = '1.0.0'
44
spec.license = { :type => 'MIT' }
5-
spec.homepage = 'https://github.com/SwiftKickMobile/SwiftLayout'
5+
spec.homepage = 'https://github.com/SwiftKickMobile/SwiftAutoLayout'
66
spec.authors = { 'Timothy Moose' => 'tim@swiftkick.it' }
77
spec.summary = 'Write constraints in a concise, expressive, Swifty way.'
8-
spec.source = {:git => 'https://github.com/SwiftKickMobile/SwiftLayout.git', :tag => spec.version}
8+
spec.source = {:git => 'https://github.com/SwiftKickMobile/SwiftAutoLayout.git', :tag => spec.version}
99
spec.platform = :ios, '10.0'
1010
spec.swift_version = '4.2'
1111
spec.ios.deployment_target = '10.0'
12-
spec.source_files = 'SwiftLayout/**/*.swift'
12+
spec.source_files = 'SwiftAutoLayout/**/*.swift'
1313
spec.framework = 'UIKit'
1414
spec.requires_arc = true
1515
end

0 commit comments

Comments
 (0)