Skip to content

Commit

Permalink
Merge pull request #13 from denandreychuk/denis_release_1_5_1
Browse files Browse the repository at this point in the history
Release 1.5.1
  • Loading branch information
denandreychuk authored May 17, 2020
2 parents a523906 + 8678e96 commit 7ed6c6f
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 18 deletions.
4 changes: 2 additions & 2 deletions EasySwiftLayout.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Pod::Spec.new do |s|
s.name = 'EasySwiftLayout'
s.version = '1.5.0'
s.version = '1.5.1'
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'
s.authors = { 'Den Andreychuk' => 'denis.andrei4uk@yandex.ua' }
s.social_media_url = 'https://www.instagram.com/den.andreychuk'
s.source = { :git => 'https://github.com/denandreychuk/EasySwiftLayout.git', :tag => s.version.to_s }

s.source_files = 'Source/*.swift'
s.source_files = 'Sources/*.swift'
s.swift_version = '5.0'
s.platform = :ios, "9.0"
end
8 changes: 6 additions & 2 deletions EasySwiftLayout.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
B7DB42432471A106001FE565 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7DB42412471A106001FE565 /* Utilities.swift */; };
B7DB424A2471A216001FE565 /* UIStackView+Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7DB42482471A216001FE565 /* UIStackView+Utilities.swift */; };
B7DB424B2471A216001FE565 /* UIView+Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7DB42492471A216001FE565 /* UIView+Utilities.swift */; };
B7DB424D2471B038001FE565 /* UIView + Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7DB424C2471B038001FE565 /* UIView + Helpers.swift */; };
B7E52714236EFE0C006760A0 /* Deprecated.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7E52713236EFE0C006760A0 /* Deprecated.swift */; };
B7FC923523422CAA009947A3 /* UIView + Pin(Superview).swift in Sources */ = {isa = PBXBuildFile; fileRef = B7FC923423422CAA009947A3 /* UIView + Pin(Superview).swift */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -87,6 +88,7 @@
B7DB42412471A106001FE565 /* Utilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = "<group>"; };
B7DB42482471A216001FE565 /* UIStackView+Utilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIStackView+Utilities.swift"; sourceTree = "<group>"; };
B7DB42492471A216001FE565 /* UIView+Utilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Utilities.swift"; sourceTree = "<group>"; };
B7DB424C2471B038001FE565 /* UIView + Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView + Helpers.swift"; sourceTree = "<group>"; };
B7E52713236EFE0C006760A0 /* Deprecated.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Deprecated.swift; sourceTree = "<group>"; };
B7F431AE234A5CF700C7E7C7 /* EasySwiftLayout.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = EasySwiftLayout.framework; path = ../ContentProtectorKit/EasySwiftLayout.framework; sourceTree = "<group>"; };
B7FC923423422CAA009947A3 /* UIView + Pin(Superview).swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView + Pin(Superview).swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -147,6 +149,7 @@
B74F8CB823784CCD00C67F28 /* Helpers */ = {
isa = PBXGroup;
children = (
B7DB424C2471B038001FE565 /* UIView + Helpers.swift */,
B74F8CB52378292C00C67F28 /* UIEdgeInsets + Helpers.swift */,
);
name = Helpers;
Expand Down Expand Up @@ -443,6 +446,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B7DB424D2471B038001FE565 /* UIView + Helpers.swift in Sources */,
B7B6608B22FF6AAF006FDD7E /* UIView + Pin.swift in Sources */,
B7B6608922FF61EE006FDD7E /* ESLAxis.swift in Sources */,
B7735CF9245C62E7007C6DAD /* ESLSizeInsets.swift in Sources */,
Expand Down Expand Up @@ -671,7 +675,7 @@
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 0;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = F7NGW4S7J5;
DYLIB_COMPATIBILITY_VERSION = 1;
Expand Down Expand Up @@ -699,7 +703,7 @@
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 0;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = F7NGW4S7J5;
DYLIB_COMPATIBILITY_VERSION = 1;
Expand Down
6 changes: 0 additions & 6 deletions Example-IOS/Sources/Extensions/UIView+Utilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ import UIKit

extension UIView {

@discardableResult
func add(toSuperview superview: UIView) -> Self {
superview.addSubview(self)
return self
}

func addShadow(ofColor color: UIColor = .black, radius: CGFloat = 3, offset: CGSize = .zero, opacity: Float = 0.5) {
layer.shadowColor = color.cgColor
layer.shadowOffset = offset
Expand Down
6 changes: 3 additions & 3 deletions Example-IOS/Sources/HomeController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ final class HomeController: UIViewController {
$0.text = "Join a community dedicated \nto keeping each other safe"
}

private let startButton = configure(RoundedButton(type: .system)) {
private let nextButton = configure(RoundedButton(type: .system)) {
$0.tintColor = .white
$0.backgroundColor = #colorLiteral(red: 0.8078431373, green: 0.3882352941, blue: 1, alpha: 1)
$0.setTitle("Next", for: .normal)
Expand Down Expand Up @@ -120,9 +120,9 @@ private extension HomeController {
.add(toSuperview: view)
.pinEdgesToSuperview(excludingEdge: .bottom, withInset: 25, respectingGuide: .safeAreaLayout)

// Start button
// Next button

startButton
nextButton
.add(toSuperview: view)
.centerInSuperview(axis: .x)
.size(CGSize(width: 150, height: 55))
Expand Down
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class ViewController: UIViewController {

<img src="https://github.com/denandreychuk/EasySwiftLayout/blob/master/Resources/Example.jpg?raw=true" width="140">

EasySwiftLayout comes with [project example](https://github.com/denandreychuk/EasySwiftLayout/tree/master/Example-IOS). You can check out how easily you can create screens like this with ESL.
EasySwiftLayout comes with [project example](https://github.com/denandreychuk/EasySwiftLayout/tree/master/Example-IOS). You can check out how easily you can create screens like this with ESL:

- Navigate to the project folder and open `EasySwiftLayout.xcodeproj`.
- Select scheme `Example-IOS` by pressing `^ + 0` and just run it on any device.
Expand All @@ -109,6 +109,36 @@ EasySwiftLayout comes with [project example](https://github.com/denandreychuk/Ea

### `UIView` Extenstions:

#### Helpers

<details>
<summary><code>add(toSuperview:)</code></summary>

##### Summary

Adds the view as a subview of specified superview.

##### Declaration

```swift
func add(toSuperview superview: UIView) -> Self
```

##### Parameters

Parameter | Type | Description
---------- | ---- |------------
superview | `UIView` | The superview to which add subview.

##### Returns

`self` with attribute `@discardableResult`.

##### Declared In
[UIView + Helpers.swift](https://github.com/denandreychuk/EasySwiftLayout/blob/master/Sources/UIView%20%2B%20Helpers.swift)

</details>

#### Size Methods (Constants)

<details>
Expand Down
25 changes: 21 additions & 4 deletions Sources/UIEdgeInsets + Helpers.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
//
// UIEdgeInsets + Helpers.swift
// EasySwiftLayout
// UIView + Pin.swift
// https://github.com/denandreychuk/EasySwiftLayout
//
// Created by Денис Андрейчук on 10.11.2019.
// Copyright © 2019 Denis Andreychuk. All rights reserved.
// This code is distributed under the terms and conditions of the MIT license.
// 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
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

import UIKit

Expand Down
41 changes: 41 additions & 0 deletions Sources/UIView + Helpers.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// UIView + Helpers.swift
// https://github.com/denandreychuk/EasySwiftLayout
//
// This code is distributed under the terms and conditions of the MIT license.
// Copyright (c) 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
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

import UIKit

public extension UIView {

/// Adds the view as a subview of specified superview.
///
/// - Parameter superview: The superview to which add subview.
///
/// - Returns: `self` with attribute `@discardableResult`.
///
@discardableResult
func add(toSuperview superview: UIView) -> Self {
superview.addSubview(self)
return self
}
}

0 comments on commit 7ed6c6f

Please sign in to comment.