From 394b3058d2af9f3d3be45d0d1ba1c6bb302d4a27 Mon Sep 17 00:00:00 2001 From: "Alex.Liu" <447106+alexliubj@users.noreply.github.com> Date: Tue, 12 Feb 2019 16:14:59 -0500 Subject: [PATCH 1/9] Added cocoapods --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 61e1f27..64c1cc7 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,11 @@ Directly drag `EZAnchor` and drop into your Xcode project. ### CocoaPods To integrate EZAnchor into your Xcode project using CocoaPods, specify it in your Podfile: -`coming soon` +``` +target 'MyApp' do + pod 'EZAnchor', '~> 0.0' +end +``` ### Carthage To integrate EZAnchor into your Xcode project using Carthage, specify it in your Cartfile: From abb077fc130de707575d12791efc9c41dbf641fa Mon Sep 17 00:00:00 2001 From: "Alex.Liu" <447106+alexliubj@users.noreply.github.com> Date: Tue, 12 Feb 2019 16:15:28 -0500 Subject: [PATCH 2/9] Updated version . --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 64c1cc7..03425cc 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Directly drag `EZAnchor` and drop into your Xcode project. To integrate EZAnchor into your Xcode project using CocoaPods, specify it in your Podfile: ``` target 'MyApp' do - pod 'EZAnchor', '~> 0.0' + pod 'EZAnchor' end ``` From 54076532f0d099e825c801c4be16cfa96712f98d Mon Sep 17 00:00:00 2001 From: "Alex.Liu" <447106+alexliubj@users.noreply.github.com> Date: Tue, 12 Feb 2019 16:16:26 -0500 Subject: [PATCH 3/9] Updated read.me --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index 03425cc..73ac455 100644 --- a/README.md +++ b/README.md @@ -90,13 +90,8 @@ Run carthage update to build the framework and drag the built EZAnchor.framework ## Other helpful tools ##### [WTF Autolayout](https://www.wtfautolayout.com) will help you debug autolayout complaints. ##### Logo is generated with [Shopify logo maker](https://hatchful.shopify.com/) -##### Inspired by: -[PureLayout](https://github.com/PureLayout/PureLayout) -[Stevia](https://github.com/freshOS/Stevia) -[layout](https://github.com/nicklockwood/layout) +##### Inspired by: [PureLayout](https://github.com/PureLayout/PureLayout) [Stevia](https://github.com/freshOS/Stevia) [layout](https://github.com/nicklockwood/layout) ## License This code and tool is under the MIT License. - - From 7d231a0f944e8ccdad58a4522435bbc32406445a Mon Sep 17 00:00:00 2001 From: "Alex.Liu" <447106+alexliubj@users.noreply.github.com> Date: Tue, 12 Feb 2019 16:19:15 -0500 Subject: [PATCH 4/9] Added tags. --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 73ac455..7c136eb 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,11 @@ An easier way to code Autolayout ![Image of EZAnchor](https://raw.githubusercontent.com/alexliubj/EZAnchor/master/Logo.png) +[![Language: Swift 4](https://img.shields.io/badge/language-swift%204-f48041.svg?style=flat)](https://developer.apple.com/swift) +![Platform: iOS 9+](https://img.shields.io/badge/platform-iOS%20|%20tvOS-blue.svg?style=flat) +[![CocoaPods compatible](https://img.shields.io/badge/Cocoapods-compatible-4BC51D.svg?style=flat)](https://cocoapods.org/pods/SteviaLayout) +[![License: MIT](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)] + - [x] Are you annoyed of coding `.active = true` while using Autolayout Anchors over and over again? - [x] Are you annoyed of coding such long constraint sentence `refreshView.heightAnchor.constraint(equalToConstant: self.refreshViewHeight).isActive = true` over and over again? From f6aaaf08362530b731e295faff4276e4023b01a7 Mon Sep 17 00:00:00 2001 From: "Alex.Liu" <447106+alexliubj@users.noreply.github.com> Date: Tue, 12 Feb 2019 16:20:14 -0500 Subject: [PATCH 5/9] README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7c136eb..509cc48 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ An easier way to code Autolayout ![Image of EZAnchor](https://raw.githubusercontent.com/alexliubj/EZAnchor/master/Logo.png) [![Language: Swift 4](https://img.shields.io/badge/language-swift%204-f48041.svg?style=flat)](https://developer.apple.com/swift) -![Platform: iOS 9+](https://img.shields.io/badge/platform-iOS%20|%20tvOS-blue.svg?style=flat) +![Platform: iOS 9+](https://img.shields.io/badge/platform-iOS%20.svg?style=flat) [![CocoaPods compatible](https://img.shields.io/badge/Cocoapods-compatible-4BC51D.svg?style=flat)](https://cocoapods.org/pods/SteviaLayout) -[![License: MIT](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)] +[![License: MIT](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat) - [x] Are you annoyed of coding `.active = true` while using Autolayout Anchors over and over again? - [x] Are you annoyed of coding such long constraint sentence `refreshView.heightAnchor.constraint(equalToConstant: self.refreshViewHeight).isActive = true` over and over again? From f327334006b0afe3119ac528f691d5d9889ecb1c Mon Sep 17 00:00:00 2001 From: "Alex.Liu" <447106+alexliubj@users.noreply.github.com> Date: Tue, 12 Feb 2019 16:23:22 -0500 Subject: [PATCH 6/9] README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 509cc48..db5a8e8 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ An easier way to code Autolayout ![Image of EZAnchor](https://raw.githubusercontent.com/alexliubj/EZAnchor/master/Logo.png) [![Language: Swift 4](https://img.shields.io/badge/language-swift%204-f48041.svg?style=flat)](https://developer.apple.com/swift) -![Platform: iOS 9+](https://img.shields.io/badge/platform-iOS%20.svg?style=flat) +![Platform: iOS 9+](https://img.shields.io/badge/platform-iOS-green.svg?style=flat) [![CocoaPods compatible](https://img.shields.io/badge/Cocoapods-compatible-4BC51D.svg?style=flat)](https://cocoapods.org/pods/SteviaLayout) -[![License: MIT](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat) +![License: MIT](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat) - [x] Are you annoyed of coding `.active = true` while using Autolayout Anchors over and over again? - [x] Are you annoyed of coding such long constraint sentence `refreshView.heightAnchor.constraint(equalToConstant: self.refreshViewHeight).isActive = true` over and over again? From 7394ec0b320c8616444e99e901cb14f7aaaead9b Mon Sep 17 00:00:00 2001 From: "Alex.Liu" <447106+alexliubj@users.noreply.github.com> Date: Tue, 12 Feb 2019 16:25:08 -0500 Subject: [PATCH 7/9] Updated Read.me --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index db5a8e8..aeacfd7 100644 --- a/README.md +++ b/README.md @@ -92,11 +92,17 @@ Run carthage update to build the framework and drag the built EZAnchor.framework 2. Avoid defining custom `UIControl` or view has same name with `height` or `width`, there may have conflict with `EZAnchor` library -## Other helpful tools +## Others ##### [WTF Autolayout](https://www.wtfautolayout.com) will help you debug autolayout complaints. ##### Logo is generated with [Shopify logo maker](https://hatchful.shopify.com/) ##### Inspired by: [PureLayout](https://github.com/PureLayout/PureLayout) [Stevia](https://github.com/freshOS/Stevia) [layout](https://github.com/nicklockwood/layout) +## Todo +- [] Unit tests +- [] UI Tests +- CI +- Fastlane + ## License This code and tool is under the MIT License. From c43a9d5ce4cf97ddde57889f6166ac52a2701dc9 Mon Sep 17 00:00:00 2001 From: "Alex.Liu" <447106+alexliubj@users.noreply.github.com> Date: Tue, 12 Feb 2019 16:25:34 -0500 Subject: [PATCH 8/9] Readme --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index aeacfd7..ece9c5d 100644 --- a/README.md +++ b/README.md @@ -98,10 +98,10 @@ Run carthage update to build the framework and drag the built EZAnchor.framework ##### Inspired by: [PureLayout](https://github.com/PureLayout/PureLayout) [Stevia](https://github.com/freshOS/Stevia) [layout](https://github.com/nicklockwood/layout) ## Todo -- [] Unit tests -- [] UI Tests -- CI -- Fastlane +- [ ] Unit tests +- [ ] UI Tests +- [ ] CI +- [ ] Fastlane ## License From c12413de400a5485e229927be466638bdb8b7b3e Mon Sep 17 00:00:00 2001 From: "Alex.Liu" <447106+alexliubj@users.noreply.github.com> Date: Tue, 12 Feb 2019 16:28:23 -0500 Subject: [PATCH 9/9] Updated Read.me --- README.md | 53 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index ece9c5d..c853592 100644 --- a/README.md +++ b/README.md @@ -16,55 +16,78 @@ Let's see how it works: * Anchor constraint to another anchor ```swift -viewA.leadingAnchor.constraint(equalTo: self.view.leadingAnchor).isActive = true -viewA.leading == self.view.leading +//Traditional way +viewA.leadingAnchor.constraint(equalTo: viewB.leadingAnchor).isActive = true + +//With EZAnchor +viewA.leading == viewB.leading ``` * Anchor constraint to another anchor with constant ```swift +//Traditional way viewA.leadingAnchor.constraint(equalTo: self.view.leadingAnchor, constant: 10).isActive = true + +//With EZAnchor viewA.leading == self.view.leading + 10 ``` * Anchor constraint to another anchor with negative constant ```swift -viewA.leadingAnchor.constraint(equalTo: self.view.leadingAnchor, constant: -10).isActive = true -viewA.leading == self.view.leading - 10 +//Traditional way +viewA.leadingAnchor.constraint(equalTo: viewB.leadingAnchor, constant: -10).isActive = true + +//With EZAnchor +viewA.leading == viewB.leading - 10 ``` * Anchor lessThanOrEqualTo another anchor ```swift -viewA.leadingAnchor.constraint(lessThanOrEqualTo: self.view.leadingAnchor).isActive = true -viewA.leading <= self.view.leading +//Traditional way +viewA.leadingAnchor.constraint(lessThanOrEqualTo: viewB.leadingAnchor).isActive = true + +//With EZAnchor +viewA.leading <= viewB.leading ``` * Anchor greaterThanOrEqualTo another anchor ```swift -viewA.leadingAnchor.constraint(greaterThanOrEqualTo: self.view.leadingAnchor).isActive = true -viewA.leading >= self.view.leading +viewA.leadingAnchor.constraint(greaterThanOrEqualTo: viewB.leadingAnchor).isActive = true + +//With EZAnchor +viewA.leading >= viewB.leading ``` * Anchor lessThanOrEqualTo another anchor with constant ```swift -viewA.leadingAnchor.constraint(lessThanOrEqualTo: self.view.leadingAnchor, constant: 10).isActive = true -viewA.leading <= self.view.leading + 10 +viewA.leadingAnchor.constraint(lessThanOrEqualTo: viewB.leadingAnchor, constant: 10).isActive = true + +//With EZAnchor +viewA.leading <= viewB.leading + 10 ``` * Anchor greaterThanOrEqualTo another anchor with constant ```swift -viewA.leadingAnchor.constraint(greaterThanOrEqualTo: self.view.leadingAnchor, constant: 10).isActive = true -viewA.leading >= self.view.leading - 10 +//Traditional way +viewA.leadingAnchor.constraint(greaterThanOrEqualTo: viewB.leadingAnchor, constant: 10).isActive = true + +//With EZAnchor +viewA.leading >= viewB.leading - 10 ``` * Anchor equalTo another anchor with constant and multiplier ```swift -viewA.heightAnchor.constraint(equalTo: self.view.heightAnchor, multiplier: 0.1, constant: -10).isActive = true -viewA.height == self.view.height * 0.1 - 10 +//Traditional way +viewA.heightAnchor.constraint(equalTo: viewB.heightAnchor, multiplier: 0.1, constant: -10).isActive = true + +//With EZAnchor +viewA.height == viewB.height * 0.1 - 10 ``` * Work with Priority ```swift -viewA.leading == (self.view.leading + 0.1) ^ UILayoutPriority.defaultLow +//With EZAnchor +viewA.leading == (viewB.leading + 0.1) ^ .defaultLow ``` ## Installation