Commit e2ec3173 by Daniel Dahan

updated Layout class and documentation

parent 97b9e45b
......@@ -11,8 +11,6 @@
96B8C0911D04BB430084F68A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96B8C0901D04BB430084F68A /* ViewController.swift */; };
96B8C0961D04BB430084F68A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96B8C0951D04BB430084F68A /* Assets.xcassets */; };
96B8C0991D04BB430084F68A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96B8C0971D04BB430084F68A /* LaunchScreen.storyboard */; };
96CB74EF1D0CAE440012D9F2 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96CB74EE1D0CAE440012D9F2 /* Material.framework */; };
96CB74F01D0CAE440012D9F2 /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 96CB74EE1D0CAE440012D9F2 /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
......@@ -22,7 +20,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
96CB74F01D0CAE440012D9F2 /* Material.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -36,7 +33,6 @@
96B8C0951D04BB430084F68A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
96B8C0981D04BB430084F68A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
96B8C09A1D04BB430084F68A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
96CB74EE1D0CAE440012D9F2 /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Material.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-dciwtavdzrmtrifplxfnouazaqvx/Build/Products/Debug-iphonesimulator/Material.framework"; sourceTree = "<absolute>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -44,7 +40,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
96CB74EF1D0CAE440012D9F2 /* Material.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -54,7 +49,6 @@
96B8C0821D04BB430084F68A = {
isa = PBXGroup;
children = (
96CB74EE1D0CAE440012D9F2 /* Material.framework */,
96B8C08D1D04BB430084F68A /* Layout */,
96B8C08C1D04BB430084F68A /* Products */,
);
......
......@@ -57,19 +57,23 @@ public class Layout {
/**
Prints a debug message when the parent context is not available.
- Parameter function: A String representation of the function that
caused the issue.
- Returns: The current Layout instance.
*/
public func debugParentNotAvailableMessage() -> Layout {
debugPrint("[Material Layout Error: Parent view context is not available.")
public func debugParentNotAvailableMessage(function: String = #function) -> Layout {
debugPrint("[Material Layout Error: Parent view context is not available for \(function).")
return self
}
/**
Prints a debug message when the child context is not available.
- Parameter function: A String representation of the function that
caused the issue.
- Returns: The current Layout instance.
*/
public func debugChildNotAvailableMessage() -> Layout {
debugPrint("[Material Layout Error: Chld view context is not available.")
public func debugChildNotAvailableMessage(function: String = #function) -> Layout {
debugPrint("[Material Layout Error: Chld view context is not available for \(function).")
return self
}
......@@ -83,6 +87,7 @@ public class Layout {
guard let v: UIView = parent else {
return debugParentNotAvailableMessage()
}
self.child = child
Layout.width(v, child: child, width: width)
return self
}
......@@ -109,6 +114,7 @@ public class Layout {
guard let v: UIView = parent else {
return debugParentNotAvailableMessage()
}
self.child = child
Layout.height(v, child: child, height: height)
return self
}
......@@ -136,6 +142,7 @@ public class Layout {
guard let v: UIView = parent else {
return debugParentNotAvailableMessage()
}
self.child = child
Layout.size(v, child: child, width: width, height: height)
return self
}
......@@ -198,6 +205,7 @@ public class Layout {
guard let v: UIView = parent else {
return debugParentNotAvailableMessage()
}
self.child = child
Layout.horizontally(v, child: child, left: left, right: right)
return self
}
......@@ -226,6 +234,7 @@ public class Layout {
guard let v: UIView = parent else {
return debugParentNotAvailableMessage()
}
self.child = child
Layout.vertically(v, child: child, top: top, bottom: bottom)
return self
}
......@@ -256,6 +265,7 @@ public class Layout {
guard let v: UIView = parent else {
return debugParentNotAvailableMessage()
}
self.child = child
Layout.edges(v, child: child, top: top, left: left, bottom: bottom, right: right)
return self
}
......@@ -286,6 +296,7 @@ public class Layout {
guard let v: UIView = parent else {
return debugParentNotAvailableMessage()
}
self.child = child
Layout.top(v, child: child, top: top)
return self
}
......@@ -312,6 +323,7 @@ public class Layout {
guard let v: UIView = parent else {
return debugParentNotAvailableMessage()
}
self.child = child
Layout.left(v, child: child, left: left)
return self
}
......@@ -338,6 +350,7 @@ public class Layout {
guard let v: UIView = parent else {
return debugParentNotAvailableMessage()
}
self.child = child
Layout.bottom(v, child: child, bottom: bottom)
return self
}
......@@ -365,6 +378,7 @@ public class Layout {
guard let v: UIView = parent else {
return debugParentNotAvailableMessage()
}
self.child = child
Layout.right(v, child: child, right: right)
return self
}
......@@ -392,6 +406,7 @@ public class Layout {
guard let v: UIView = parent else {
return debugParentNotAvailableMessage()
}
self.child = child
Layout.topLeft(v, child: child, top: top, left: left)
return self
}
......@@ -420,6 +435,7 @@ public class Layout {
guard let v: UIView = parent else {
return debugParentNotAvailableMessage()
}
self.child = child
Layout.topRight(v, child: child, top: top, right: right)
return self
}
......@@ -448,6 +464,7 @@ public class Layout {
guard let v: UIView = parent else {
return debugParentNotAvailableMessage()
}
self.child = child
Layout.bottomLeft(v, child: child, bottom: bottom, left: left)
return self
}
......@@ -476,6 +493,7 @@ public class Layout {
guard let v: UIView = parent else {
return debugParentNotAvailableMessage()
}
self.child = child
Layout.bottomRight(v, child: child, bottom: bottom, right: right)
return self
}
......@@ -504,6 +522,7 @@ public class Layout {
guard let v: UIView = parent else {
return debugParentNotAvailableMessage()
}
self.child = child
Layout.center(v, child: child, offsetX: offsetX, offsetY: offsetY)
return self
}
......@@ -531,6 +550,7 @@ public class Layout {
guard let v: UIView = parent else {
return debugParentNotAvailableMessage()
}
self.child = child
Layout.centerHorizontally(v, child: child, offset: offset)
return self
}
......@@ -557,6 +577,7 @@ public class Layout {
guard let v: UIView = parent else {
return debugParentNotAvailableMessage()
}
self.child = child
Layout.centerVertically(v, child: child, offset: offset)
return self
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment