Skip to content

Commit

Permalink
Merge pull request #14 from Pimine/denis_release_1_6_0
Browse files Browse the repository at this point in the history
Release 1.6.0
  • Loading branch information
denandreychuk authored Feb 16, 2021
2 parents bb5aa5d + 3aa9e1f commit 470d0f3
Show file tree
Hide file tree
Showing 17 changed files with 394 additions and 121 deletions.
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion EasySwiftLayout.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'EasySwiftLayout'
s.version = '1.5.1'
s.version = '1.6.0'
s.license = 'MIT'
s.summary = 'Lightweight Swift framework for Auto-Layout. Helps you write readable and compact UI code using simple API.'
s.homepage = 'https://github.com/denandreychuk/EasySwiftLayout'
Expand Down
20 changes: 8 additions & 12 deletions EasySwiftLayout.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
B74F8CB62378292C00C67F28 /* UIEdgeInsets + Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = B74F8CB52378292C00C67F28 /* UIEdgeInsets + Helpers.swift */; };
B76960B123E2E5B50034ED31 /* ESLSuperviewGuide.swift in Sources */ = {isa = PBXBuildFile; fileRef = B76960B023E2E5B50034ED31 /* ESLSuperviewGuide.swift */; };
B7735CF9245C62E7007C6DAD /* ESLSizeInsets.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7735CF8245C62E7007C6DAD /* ESLSizeInsets.swift */; };
B784771A234B37DD002386DC /* EasySwiftLayoutTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7847719234B37DD002386DC /* EasySwiftLayoutTests.swift */; };
B784771A234B37DD002386DC /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7847719234B37DD002386DC /* Tests.swift */; };
B784771C234B37DD002386DC /* EasySwiftLayout.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B7B6606222FF122B006FDD7E /* EasySwiftLayout.framework */; };
B7AA38CC23DB950100EB93E2 /* ESLGuide.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7AA38CB23DB950100EB93E2 /* ESLGuide.swift */; };
B7B0692C230B17BA00CB6386 /* UIView + Size.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7B0692B230B17BA00CB6386 /* UIView + Size.swift */; };
Expand All @@ -34,7 +34,6 @@
B7B6608922FF61EE006FDD7E /* ESLAxis.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7B6608822FF61EE006FDD7E /* ESLAxis.swift */; };
B7B6608B22FF6AAF006FDD7E /* UIView + Pin.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7B6608A22FF6AAF006FDD7E /* UIView + Pin.swift */; };
B7B6608E22FF6B02006FDD7E /* ESLEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7B6608D22FF6B02006FDD7E /* ESLEdge.swift */; };
B7C829D6246CAAAE000F90DC /* ESLOffset.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7C829D5246CAAAE000F90DC /* ESLOffset.swift */; };
B7DB422D2471A096001FE565 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7DB422C2471A096001FE565 /* AppDelegate.swift */; };
B7DB422F2471A096001FE565 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7DB422E2471A096001FE565 /* SceneDelegate.swift */; };
B7DB42312471A096001FE565 /* HomeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7DB42302471A096001FE565 /* HomeController.swift */; };
Expand Down Expand Up @@ -65,7 +64,7 @@
B76960B023E2E5B50034ED31 /* ESLSuperviewGuide.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ESLSuperviewGuide.swift; sourceTree = "<group>"; };
B7735CF8245C62E7007C6DAD /* ESLSizeInsets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ESLSizeInsets.swift; sourceTree = "<group>"; };
B7847717234B37DD002386DC /* EasySwiftLayoutTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EasySwiftLayoutTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
B7847719234B37DD002386DC /* EasySwiftLayoutTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EasySwiftLayoutTests.swift; sourceTree = "<group>"; };
B7847719234B37DD002386DC /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = "<group>"; };
B784771B234B37DD002386DC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
B7AA38CB23DB950100EB93E2 /* ESLGuide.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ESLGuide.swift; sourceTree = "<group>"; };
B7B0692B230B17BA00CB6386 /* UIView + Size.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView + Size.swift"; sourceTree = "<group>"; };
Expand All @@ -76,7 +75,6 @@
B7B6608822FF61EE006FDD7E /* ESLAxis.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ESLAxis.swift; sourceTree = "<group>"; };
B7B6608A22FF6AAF006FDD7E /* UIView + Pin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView + Pin.swift"; sourceTree = "<group>"; };
B7B6608D22FF6B02006FDD7E /* ESLEdge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ESLEdge.swift; sourceTree = "<group>"; };
B7C829D5246CAAAE000F90DC /* ESLOffset.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ESLOffset.swift; sourceTree = "<group>"; };
B7DB422A2471A096001FE565 /* Example-IOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example-IOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
B7DB422C2471A096001FE565 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
B7DB422E2471A096001FE565 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -138,7 +136,6 @@
B7B6608822FF61EE006FDD7E /* ESLAxis.swift */,
B7B6608D22FF6B02006FDD7E /* ESLEdge.swift */,
B71AD507236EE37300C5AE64 /* ESLEdgeGroup.swift */,
B7C829D5246CAAAE000F90DC /* ESLOffset.swift */,
B7AA38CB23DB950100EB93E2 /* ESLGuide.swift */,
B76960B023E2E5B50034ED31 /* ESLSuperviewGuide.swift */,
B7735CF8245C62E7007C6DAD /* ESLSizeInsets.swift */,
Expand All @@ -158,7 +155,7 @@
B7847718234B37DD002386DC /* Tests */ = {
isa = PBXGroup;
children = (
B7847719234B37DD002386DC /* EasySwiftLayoutTests.swift */,
B7847719234B37DD002386DC /* Tests.swift */,
B784771B234B37DD002386DC /* Info.plist */,
);
path = Tests;
Expand Down Expand Up @@ -438,7 +435,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B784771A234B37DD002386DC /* EasySwiftLayoutTests.swift in Sources */,
B784771A234B37DD002386DC /* Tests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -457,7 +454,6 @@
B7B6608E22FF6B02006FDD7E /* ESLEdge.swift in Sources */,
B7E52714236EFE0C006760A0 /* Deprecated.swift in Sources */,
B7B0692C230B17BA00CB6386 /* UIView + Size.swift in Sources */,
B7C829D6246CAAAE000F90DC /* ESLOffset.swift in Sources */,
B76960B123E2E5B50034ED31 /* ESLSuperviewGuide.swift in Sources */,
B7B6608422FF18C7006FDD7E /* UIView + Center.swift in Sources */,
);
Expand Down Expand Up @@ -675,7 +671,7 @@
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 0;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = F7NGW4S7J5;
DYLIB_COMPATIBILITY_VERSION = 1;
Expand All @@ -685,7 +681,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.5;
MARKETING_VERSION = 1.6;
PRODUCT_BUNDLE_IDENTIFIER = com.denandreychuk.EasySwiftLayout;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand All @@ -703,7 +699,7 @@
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 0;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = F7NGW4S7J5;
DYLIB_COMPATIBILITY_VERSION = 1;
Expand All @@ -713,7 +709,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.5;
MARKETING_VERSION = 1.6;
PRODUCT_BUNDLE_IDENTIFIER = com.denandreychuk.EasySwiftLayout;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down
23 changes: 23 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "EasySwiftLayout",
platforms: [.iOS(.v9)],
products: [
.library(
name: "EasySwiftLayout",
targets: ["EasySwiftLayoutTarget"]
)
],
dependencies: [],
targets: [
.target(
name: "EasySwiftLayoutTarget",
path: "Sources",
exclude: ["Info.plist"]
)
]
)
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ pod 'EasySwiftLayout'
github "denandreychuk/EasySwiftLayout"
```

### Swift Package Manager

The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. It is in early development, but EasySwiftLayout does support its use on supported platforms.

Once you have your Swift package set up, adding EasySwiftLayout as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.

```swift
dependencies: [
.package(url: "https://github.com/Pimine/EasySwiftLayout.git", .upToNextMajor(from: "1.7.0"))
]
```

### Manually

If you prefer not to use any of the aforementioned dependency managers, you can integrate EasySwiftLayout into your project manually.
Expand Down Expand Up @@ -1369,7 +1381,7 @@ Centers the view in another view with the offset and priority of the constraint.
##### Declaration
```swift
func centerInView(_ anotherView: UIView, withOffset offset: ESLOffset = .zero, priority: UILayoutPriority = .required) -> Self
func centerInView(_ anotherView: UIView, withOffset offset: UIOffset = .zero, priority: UILayoutPriority = .required) -> Self
```
##### Discussion
Expand All @@ -1385,7 +1397,7 @@ Another view must be in the same view hierarchy as this view.
Parameter | Type | Description
---------- | ---- |------------
anotherView | `UIView` | Another view to center in.
offset | `ESLOffset` | Axis offset.
offset | `UIOffset` | Axis offset.
priority | `UILayoutPriority` | The priority of the constraint.
##### Returns
Expand Down Expand Up @@ -1424,7 +1436,7 @@ Parameter | Type | Description
---------- | ---- |------------
anotherView | `UIView` | View to center in.
axis | `ESLAxis` | Axis to center
offset | `ESLOffset` | Axis offset.
offset | `UIOffset` | Axis offset.
priority | `UILayoutPriority` | The priority of the constraint.
##### Returns
Expand All @@ -1446,7 +1458,7 @@ Centers the view in its superview view with the offset and priority of the const
##### Declaration
```swift
func centerInSuperview(withOffset offset: ESLOffset = .zero, priority: UILayoutPriority = .required) -> Self
func centerInSuperview(withOffset offset: UIOffset = .zero, priority: UILayoutPriority = .required) -> Self
```
##### Discussion
Expand All @@ -1461,7 +1473,7 @@ The view should have the superview, otherwise this method will have no effect.
Parameter | Type | Description
---------- | ---- |------------
offset | `ESLOffset` | Axis offset.
offset | `UIOffset` | Axis offset.
priority | `UILayoutPriority` | The priority of the constraint.
##### Returns
Expand Down
42 changes: 39 additions & 3 deletions Sources/Deprecated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,25 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

import Foundation
import UIKit

@available(*, deprecated, message: "Use `ESLSizeOffset` instead")
@available(*, deprecated, message: "`ESL2DimensionalInsets` deprecated and replaced with `ESLSizeInsets`")
typealias ESL2DimensionalInsets = CGSize

@available(*, deprecated, message: "`ESLOffset` deprecated and replaced with `UIOffset`")
public struct ESLOffset {

public let x: CGFloat
public let y: CGFloat

public static let zero = ESLOffset(x: 0, y: 0)

public init(x: CGFloat, y: CGFloat) {
self.x = x
self.y = y
}
}

// MARK: - Pin Methods

public extension UIView {
Expand Down Expand Up @@ -134,11 +148,33 @@ public extension UIView {
public extension UIView {

@available(*, deprecated, renamed: "centerInSuperview(axis:withOffset:priority:)")
@discardableResult
func centerInSuperview(
_ axis: ESLAxis,
withOffset offset: CGFloat = .zero,
priority: UILayoutPriority = .required
) {
) -> Self {
centerInSuperview(axis: axis)
}

@available(*, deprecated, message: "")
@discardableResult
func centerInView(
_ anotherView: UIView,
withOffset offset: ESLOffset = .zero,
priority: UILayoutPriority = .required
) -> Self {
centerInView(anotherView, axis: .horizontal, withOffset: offset.x, priority: priority)
centerInView(anotherView, axis: .vertical, withOffset: offset.y, priority: priority)

return self
}

@available(*, deprecated)
@discardableResult
func centerInSuperview(withOffset offset: ESLOffset = .zero, priority: UILayoutPriority = .required) -> Self {
guard let superview = superview else { return self }
centerInView(superview, withOffset: offset, priority: priority)
return self
}
}
22 changes: 17 additions & 5 deletions Sources/ESLAxis.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// https://github.com/denandreychuk/EasySwiftLayout
//
// This code is distributed under the terms and conditions of the MIT license.
// Copyright (c) 2019 Denis Andreychuk
// Copyright (c) 2019-2020 Denis Andreychuk
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,12 +25,24 @@

public enum ESLAxis {

//MARK: Cases
// MARK: Cases

case horizontal

case vertical

// MARK: Properties

public static let both: [ESLAxis] = [.horizontal, .vertical]

// MARK: - Deprecated

@available(*, deprecated, renamed: "horizontal")
case x
case y

//MARK: Variables
@available(*, deprecated, renamed: "vertical")
case y

public static let all: [ESLAxis] = [.x, .y]
@available(*, deprecated, renamed: "both")
public static let all: [ESLAxis] = [.horizontal, .vertical]
}
2 changes: 2 additions & 0 deletions Sources/ESLEdge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

import UIKit

public enum ESLEdge {

//MARK: Cases
Expand Down
41 changes: 0 additions & 41 deletions Sources/ESLOffset.swift

This file was deleted.

2 changes: 2 additions & 0 deletions Sources/ESLSizeInsets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

import UIKit

public typealias ESLSizeInsets = UIOffset
2 changes: 1 addition & 1 deletion Sources/ESLSuperviewGuide.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

import Foundation
import UIKit

public enum ESLSuperviewGuide {

Expand Down
Loading

0 comments on commit 470d0f3

Please sign in to comment.