Skip to content

Commit

Permalink
Create constraint assistant
Browse files Browse the repository at this point in the history
  • Loading branch information
Emerson Mendes Filho committed May 23, 2021
1 parent b7a76a1 commit f6f6384
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ViewCodeGuide/ViewCodeGuide.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
C69E43AD26583B52004E30A6 /* MyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C69E43AC26583B52004E30A6 /* MyView.swift */; };
C69E4406265A9C66004E30A6 /* TitleSubtitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C69E4405265A9C66004E30A6 /* TitleSubtitleView.swift */; };
C69E440B265A9E3D004E30A6 /* ViewCodeProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = C69E440A265A9E3D004E30A6 /* ViewCodeProtocol.swift */; };
C69E4410265AA257004E30A6 /* UIView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C69E440F265AA257004E30A6 /* UIView+Extensions.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -53,6 +54,7 @@
C69E43AC26583B52004E30A6 /* MyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyView.swift; sourceTree = "<group>"; };
C69E4405265A9C66004E30A6 /* TitleSubtitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleSubtitleView.swift; sourceTree = "<group>"; };
C69E440A265A9E3D004E30A6 /* ViewCodeProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewCodeProtocol.swift; sourceTree = "<group>"; };
C69E440F265AA257004E30A6 /* UIView+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Extensions.swift"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -145,6 +147,7 @@
C69E43AC26583B52004E30A6 /* MyView.swift */,
C69E4405265A9C66004E30A6 /* TitleSubtitleView.swift */,
C69E440A265A9E3D004E30A6 /* ViewCodeProtocol.swift */,
C69E440F265AA257004E30A6 /* UIView+Extensions.swift */,
);
path = Source;
sourceTree = "<group>";
Expand Down Expand Up @@ -287,6 +290,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C69E4410265AA257004E30A6 /* UIView+Extensions.swift in Sources */,
C69E43AD26583B52004E30A6 /* MyView.swift in Sources */,
C69E440B265A9E3D004E30A6 /* ViewCodeProtocol.swift in Sources */,
C69E436026582D94004E30A6 /* ViewController.swift in Sources */,
Expand Down
16 changes: 16 additions & 0 deletions ViewCodeGuide/ViewCodeGuide/Source/UIView+Extensions.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// UIView+Extensions.swift
// ViewCodeGuide
//
// Created by Emerson Mendes Filho on 23/05/21.
//

import UIKit

extension UIView {

func constraint(_ closure: (UIView) -> [NSLayoutConstraint]) {
self.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate(closure(self))
}
}

0 comments on commit f6f6384

Please sign in to comment.