-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Revamp MVP (WIP) * Sets translateAutoresizingMaskIntoConstraints to false * Lazy Constrictor * Updated naming * Deleted Contrictor 4.1.0 * Added way of updating constraints for animations * Added deep find functions to retrieve a constraint * Updated naming * Updated Travis Configuration * Updated design * Unit tests Anchor, AnchorDimension, AnchorXAxis, AnchorYAxis and NSLayoutConstraint+Set * Updated .podspec * Updated README.md * Added new cover * Updated README.md * Added SnapshotTesting * Unit Tested Constants * Added Snapshots to Edge, Center and Size * Updated Travis Configuration * Updated Schema Configuration * Updated Travis Configuration * Updated Travis Configuration * Updated Travis Configuration * Updated Travis Configuration * Updated Travis Configuration * Updated Travis Configuration * Updated Travis Configuration * Updated Travis Configuration * Locked SnapshotTesting * Updated Project Configuration * Unit Tested UIView+Constrictor * United Tested UILayoutGuide+Constrictor * Added missing coverage to snapshots * Unit Tested Update * Fixed issue with Example * Added UILayoutPriority operators (+ & -) * Added MARKs * Updated .podspec * Fixed issues with tests * Added presentation.gif * Updated gif and css * Updated GIF * Updated GIF * LayoutPriority, LayoutState & LayoutState * Updated README.md * Updated README.md * Updated README.md * Updated README.md * Updated README.md * Added new sugar to NSLayoutConstraint (isActive) * Code Review
- Loading branch information
1 parent
bdc158e
commit ea0ea6b
Showing
146 changed files
with
8,230 additions
and
3,531 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
Constrictor/Constrictor.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
Constrictor/Constrictor.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// | ||
// Anchor.swift | ||
// Constrictor | ||
// | ||
// Created by Pedro Carrasco on 12/01/2019. | ||
// Copyright © 2019 Pedro Carrasco. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
// MARK: - Anchor | ||
public enum Anchor: CaseIterable { | ||
case top | ||
case bottom | ||
case leading | ||
case trailing | ||
case right | ||
case left | ||
case centerX | ||
case centerY | ||
case width | ||
case height | ||
} | ||
|
||
// MARK: - Properties | ||
extension Anchor { | ||
|
||
var attribute: NSLayoutConstraint.Attribute { | ||
switch self { | ||
case .top: return .top | ||
case .bottom: return .bottom | ||
case .leading: return .leading | ||
case .trailing: return .trailing | ||
case .right: return .right | ||
case .left: return .left | ||
case .centerX: return .centerX | ||
case .centerY: return .centerY | ||
case .width: return .width | ||
case .height: return .height | ||
} | ||
} | ||
} | ||
|
||
// MARK: - Functions | ||
extension Anchor { | ||
|
||
func constraints(for constraints: Constraints) -> [NSLayoutConstraint] { | ||
switch self { | ||
case .top: return constraints.top | ||
case .bottom: return constraints.bottom | ||
case .leading: return constraints.leading | ||
case .trailing: return constraints.trailing | ||
case .right: return constraints.right | ||
case .left: return constraints.left | ||
case .centerX: return constraints.centerX | ||
case .centerY: return constraints.centerY | ||
case .width: return constraints.width | ||
case .height: return constraints.height | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// AnchorDimension.swift | ||
// Constrictor | ||
// | ||
// Created by Pedro Carrasco on 11/01/2019. | ||
// Copyright © 2019 Pedro Carrasco. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
// MARK: - AnchorDimension | ||
public enum AnchorDimension: CaseIterable { | ||
case width | ||
case height | ||
} | ||
|
||
// MARK: - Properties | ||
extension AnchorDimension { | ||
|
||
var attribute: NSLayoutConstraint.Attribute { | ||
switch self { | ||
case .width: return .width | ||
case .height: return .height | ||
} | ||
} | ||
} | ||
|
||
// MARK: - Functions | ||
extension AnchorDimension { | ||
|
||
func anchor(for anchorable: Anchorable) -> NSLayoutDimension { | ||
switch self { | ||
case .width: return anchorable.widthAnchor | ||
case .height: return anchorable.heightAnchor | ||
} | ||
} | ||
|
||
func constraints(for constraints: Constraints) -> [NSLayoutConstraint] { | ||
switch self { | ||
case .width: return constraints.width | ||
case .height: return constraints.height | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// AnchorXAxis.swift | ||
// Constrictor | ||
// | ||
// Created by Pedro Carrasco on 11/01/2019. | ||
// Copyright © 2019 Pedro Carrasco. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
// MARK: - AnchorXAxis | ||
public enum AnchorXAxis: CaseIterable { | ||
case centerX | ||
case left | ||
case leading | ||
case right | ||
case trailing | ||
} | ||
|
||
// MARK: - Functions | ||
extension AnchorXAxis { | ||
|
||
func anchor(for anchorable: Anchorable) -> NSLayoutXAxisAnchor { | ||
switch self { | ||
case .centerX: return anchorable.centerXAnchor | ||
case .left: return anchorable.leftAnchor | ||
case .leading: return anchorable.leadingAnchor | ||
case .right: return anchorable.rightAnchor | ||
case .trailing: return anchorable.trailingAnchor | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// AnchorYAxis.swift | ||
// Constrictor | ||
// | ||
// Created by Pedro Carrasco on 11/01/2019. | ||
// Copyright © 2019 Pedro Carrasco. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
// MARK: - AnchorYAxis | ||
public enum AnchorYAxis: CaseIterable { | ||
case centerY | ||
case top | ||
case bottom | ||
} | ||
|
||
// MARK: - Functions | ||
extension AnchorYAxis { | ||
|
||
func anchor(for anchorable: Anchorable) -> NSLayoutYAxisAnchor { | ||
switch self { | ||
case .centerY: return anchorable.centerYAnchor | ||
case .top: return anchorable.topAnchor | ||
case .bottom: return anchorable.bottomAnchor | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// Anchorable.swift | ||
// Constrictor | ||
// | ||
// Created by Pedro Carrasco on 11/01/2019. | ||
// Copyright © 2019 Pedro Carrasco. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
// MARK: - Anchorable | ||
public protocol Anchorable: class { | ||
var leadingAnchor: NSLayoutXAxisAnchor { get } | ||
var trailingAnchor: NSLayoutXAxisAnchor { get } | ||
var leftAnchor: NSLayoutXAxisAnchor { get } | ||
var rightAnchor: NSLayoutXAxisAnchor { get } | ||
var topAnchor: NSLayoutYAxisAnchor { get } | ||
var bottomAnchor: NSLayoutYAxisAnchor { get } | ||
var widthAnchor: NSLayoutDimension { get } | ||
var heightAnchor: NSLayoutDimension { get } | ||
var centerXAnchor: NSLayoutXAxisAnchor { get } | ||
var centerYAnchor: NSLayoutYAxisAnchor { get } | ||
} |
12 changes: 12 additions & 0 deletions
12
Constrictor/Constrictor/Anchors/UILayoutGuide+Anchorable.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// UILayoutGuide+Anchorable.swift | ||
// Constrictor | ||
// | ||
// Created by Pedro Carrasco on 11/01/2019. | ||
// Copyright © 2019 Pedro Carrasco. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
// MARK: - Anchorable | ||
extension UILayoutGuide: Anchorable {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// UIView+Anchorable.swift | ||
// Constrictor | ||
// | ||
// Created by Pedro Carrasco on 11/01/2019. | ||
// Copyright © 2019 Pedro Carrasco. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
// MARK: - Anchorable | ||
extension UIView: Anchorable {} |
Oops, something went wrong.