Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
2d5ca9d5
Commit
2d5ca9d5
authored
Sep 17, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: added Layout methods top, left, right, bottom
parent
1d287d03
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
Source/Layout.swift
+28
-0
No files found.
Source/Layout.swift
View file @
2d5ca9d5
...
...
@@ -132,6 +132,34 @@ public struct Layout {
}
/**
:name: alignFromTop
*/
public
static
func
alignFromTop
(
parent
:
UIView
,
child
:
UIView
,
top
:
CGFloat
=
0
)
{
parent
.
addConstraints
(
constraint
(
"V:|-(top)-[child]"
,
options
:
[],
metrics
:
[
"top"
:
top
],
views
:
[
"child"
:
child
]))
}
/**
:name: alignFromLeft
*/
public
static
func
alignFromLeft
(
parent
:
UIView
,
child
:
UIView
,
left
:
CGFloat
=
0
)
{
parent
.
addConstraints
(
constraint
(
"H:|-(left)-[child]"
,
options
:
[],
metrics
:
[
"left"
:
left
],
views
:
[
"child"
:
child
]))
}
/**
:name: alignFromBottom
*/
public
static
func
alignFromBottom
(
parent
:
UIView
,
child
:
UIView
,
bottom
:
CGFloat
=
0
)
{
parent
.
addConstraints
(
constraint
(
"V:[child]-(bottom)-|"
,
options
:
[],
metrics
:
[
"bottom"
:
bottom
],
views
:
[
"child"
:
child
]))
}
/**
:name: alignFromRight
*/
public
static
func
alignFromRight
(
parent
:
UIView
,
child
:
UIView
,
right
:
CGFloat
=
0
)
{
parent
.
addConstraints
(
constraint
(
"H:[child]-(right)-|"
,
options
:
[],
metrics
:
[
"right"
:
right
],
views
:
[
"child"
:
child
]))
}
/**
:name: alignAllSides
*/
public
static
func
alignAllSides
(
parent
:
UIView
,
child
:
UIView
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment