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
fd927b36
Commit
fd927b36
authored
Sep 07, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added more control over card spacing
parent
5ca791c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
105 additions
and
30 deletions
+105
-30
Source/BasicCardView.swift
+47
-14
Source/ImageCardView.swift
+58
-16
No files found.
Source/BasicCardView.swift
View file @
fd927b36
...
@@ -30,14 +30,38 @@ public class BasicCardView : MaterialCardView, Comparable, Equatable {
...
@@ -30,14 +30,38 @@ public class BasicCardView : MaterialCardView, Comparable, Equatable {
internal
lazy
var
views
:
Dictionary
<
String
,
AnyObject
>
=
Dictionary
<
String
,
AnyObject
>
()
internal
lazy
var
views
:
Dictionary
<
String
,
AnyObject
>
=
Dictionary
<
String
,
AnyObject
>
()
/**
/**
:name: verticalSpace
:name: vertical
TitleLabel
Space
*/
*/
public
var
verticalSpace
:
CGFloat
=
MaterialTheme
.
verticalSpace
public
var
vertical
TitleLabel
Space
:
CGFloat
=
MaterialTheme
.
verticalSpace
/**
/**
:name: horizontalSpace
:name: horizontalTitleLabelSpace
*/
public
var
horizontalTitleLabelSpace
:
CGFloat
=
MaterialTheme
.
horizontalSpace
/**
:name: verticalDetailLabelSpace
*/
public
var
verticalDetailLabelSpace
:
CGFloat
=
MaterialTheme
.
verticalSpace
/**
:name: horizontalDetailLabelSpace
*/
public
var
horizontalDetailLabelSpace
:
CGFloat
=
MaterialTheme
.
horizontalSpace
/**
:name: verticalButtonSpace
*/
public
var
verticalButtonSpace
:
CGFloat
=
MaterialTheme
.
verticalSpace
/**
:name: horizontalButtonSpace
*/
public
var
horizontalButtonSpace
:
CGFloat
=
MaterialTheme
.
horizontalSpace
/**
:name: horizontalButtonSpace
*/
*/
public
var
horizontalSpace
:
CGFloat
=
MaterialTheme
.
horizontalSpace
/**
/**
:name: titleLabelContainer
:name: titleLabelContainer
...
@@ -237,6 +261,9 @@ public class BasicCardView : MaterialCardView, Comparable, Equatable {
...
@@ -237,6 +261,9 @@ public class BasicCardView : MaterialCardView, Comparable, Equatable {
// title
// title
if
nil
!=
titleLabelContainer
&&
nil
!=
titleLabel
{
if
nil
!=
titleLabelContainer
&&
nil
!=
titleLabel
{
// clear for updated constraints
titleLabelContainer
!.
removeConstraints
(
titleLabelContainer
!.
constraints
())
// container
// container
layoutConstraints
+=
Layout
.
constraint
(
"H:|[titleLabelContainer]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
[
"titleLabelContainer"
:
titleLabelContainer
!
])
layoutConstraints
+=
Layout
.
constraint
(
"H:|[titleLabelContainer]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
[
"titleLabelContainer"
:
titleLabelContainer
!
])
verticalFormat
+=
"[titleLabelContainer]"
verticalFormat
+=
"[titleLabelContainer]"
...
@@ -244,24 +271,30 @@ public class BasicCardView : MaterialCardView, Comparable, Equatable {
...
@@ -244,24 +271,30 @@ public class BasicCardView : MaterialCardView, Comparable, Equatable {
// common text
// common text
Layout
.
height
(
titleLabelContainer
!
,
child
:
titleLabel
!
,
height
:
1.5
*
titleLabel
!.
font
.
pointSize
)
Layout
.
height
(
titleLabelContainer
!
,
child
:
titleLabel
!
,
height
:
1.5
*
titleLabel
!.
font
.
pointSize
)
Layout
.
expandToParentVerticallyWithPad
(
titleLabelContainer
!
,
child
:
titleLabel
!
,
top
:
vertical
Space
,
bottom
:
vertica
lSpace
)
Layout
.
expandToParentVerticallyWithPad
(
titleLabelContainer
!
,
child
:
titleLabel
!
,
top
:
vertical
TitleLabelSpace
,
bottom
:
verticalTitleLabe
lSpace
)
Layout
.
expandToParentHorizontallyWithPad
(
titleLabelContainer
!
,
child
:
titleLabel
!
,
left
:
horizontal
Space
,
right
:
horizonta
lSpace
)
Layout
.
expandToParentHorizontallyWithPad
(
titleLabelContainer
!
,
child
:
titleLabel
!
,
left
:
horizontal
TitleLabelSpace
,
right
:
horizontalTitleLabe
lSpace
)
}
}
// detail
// detail
if
nil
!=
detailLabelContainer
&&
nil
!=
detailLabel
{
if
nil
!=
detailLabelContainer
&&
nil
!=
detailLabel
{
// clear for updated constraints
detailLabelContainer
!.
removeConstraints
(
detailLabelContainer
!.
constraints
())
// container
// container
layoutConstraints
+=
Layout
.
constraint
(
"H:|[detailLabelContainer]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
[
"detailLabelContainer"
:
detailLabelContainer
!
])
layoutConstraints
+=
Layout
.
constraint
(
"H:|[detailLabelContainer]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
[
"detailLabelContainer"
:
detailLabelContainer
!
])
verticalFormat
+=
"[detailLabelContainer]"
verticalFormat
+=
"[detailLabelContainer]"
views
[
"detailLabelContainer"
]
=
detailLabelContainer
!
views
[
"detailLabelContainer"
]
=
detailLabelContainer
!
// text
// text
Layout
.
expandToParentHorizontallyWithPad
(
detailLabelContainer
!
,
child
:
detailLabel
!
,
left
:
horizontal
Space
,
right
:
horizonta
lSpace
)
Layout
.
expandToParentHorizontallyWithPad
(
detailLabelContainer
!
,
child
:
detailLabel
!
,
left
:
horizontal
DetailLabelSpace
,
right
:
horizontalDetailLabe
lSpace
)
detailLabelContainer
!.
addConstraints
(
Layout
.
constraint
(
"V:|-(vertical
Space)-[detailLabel(<=maximumDetailLabelHeight)]-(verticalSpace)-|"
,
options
:
nil
,
metrics
:
[
"verticalSpace"
:
vertica
lSpace
,
"maximumDetailLabelHeight"
:
maximumDetailLabelHeight
],
views
:
[
"detailLabel"
:
detailLabel
!
]))
detailLabelContainer
!.
addConstraints
(
Layout
.
constraint
(
"V:|-(vertical
DetailLabelSpace)-[detailLabel(<=maximumDetailLabelHeight)]-(verticalDetailLabelSpace)-|"
,
options
:
nil
,
metrics
:
[
"verticalDetailLabelSpace"
:
verticalDetailLabe
lSpace
,
"maximumDetailLabelHeight"
:
maximumDetailLabelHeight
],
views
:
[
"detailLabel"
:
detailLabel
!
]))
}
}
// buttons
// buttons
if
nil
!=
buttonsContainer
&&
(
nil
!=
leftButtons
||
nil
!=
rightButtons
)
{
if
nil
!=
buttonsContainer
&&
(
nil
!=
leftButtons
||
nil
!=
rightButtons
)
{
// clear for updated constraints
buttonsContainer
!.
removeConstraints
(
buttonsContainer
!.
constraints
())
// divider
// divider
if
nil
!=
divider
{
if
nil
!=
divider
{
layoutConstraints
+=
Layout
.
constraint
(
"H:|[divider]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
[
"divider"
:
divider
!
])
layoutConstraints
+=
Layout
.
constraint
(
"H:|[divider]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
[
"divider"
:
divider
!
])
...
@@ -282,10 +315,10 @@ public class BasicCardView : MaterialCardView, Comparable, Equatable {
...
@@ -282,10 +315,10 @@ public class BasicCardView : MaterialCardView, Comparable, Equatable {
let
button
:
MaterialButton
=
leftButtons
!
[
i
]
let
button
:
MaterialButton
=
leftButtons
!
[
i
]
buttonsContainer
!.
addSubview
(
button
)
buttonsContainer
!.
addSubview
(
button
)
buttonViews
[
"button
\(
i
)
"
]
=
button
buttonViews
[
"button
\(
i
)
"
]
=
button
horizontalFormat
+=
"-(horizontalSpace)-[button
\(
i
)
]"
horizontalFormat
+=
"-(horizontal
Button
Space)-[button
\(
i
)
]"
Layout
.
expandToParentVerticallyWithPad
(
buttonsContainer
!
,
child
:
button
,
top
:
vertical
Space
,
bottom
:
vertical
Space
)
Layout
.
expandToParentVerticallyWithPad
(
buttonsContainer
!
,
child
:
button
,
top
:
vertical
ButtonSpace
,
bottom
:
verticalButton
Space
)
}
}
buttonsContainer
!.
addConstraints
(
Layout
.
constraint
(
horizontalFormat
,
options
:
nil
,
metrics
:
[
"horizontal
Space"
:
horizontal
Space
],
views
:
buttonViews
))
buttonsContainer
!.
addConstraints
(
Layout
.
constraint
(
horizontalFormat
,
options
:
nil
,
metrics
:
[
"horizontal
ButtonSpace"
:
horizontalButton
Space
],
views
:
buttonViews
))
}
}
// rightButtons
// rightButtons
...
@@ -296,10 +329,10 @@ public class BasicCardView : MaterialCardView, Comparable, Equatable {
...
@@ -296,10 +329,10 @@ public class BasicCardView : MaterialCardView, Comparable, Equatable {
let
button
:
MaterialButton
=
rightButtons
!
[
i
]
let
button
:
MaterialButton
=
rightButtons
!
[
i
]
buttonsContainer
!.
addSubview
(
button
)
buttonsContainer
!.
addSubview
(
button
)
buttonViews
[
"button
\(
i
)
"
]
=
button
buttonViews
[
"button
\(
i
)
"
]
=
button
horizontalFormat
+=
"[button
\(
i
)
]-(horizontalSpace)-"
horizontalFormat
+=
"[button
\(
i
)
]-(horizontal
Button
Space)-"
Layout
.
expandToParentVerticallyWithPad
(
buttonsContainer
!
,
child
:
button
,
top
:
vertical
Space
,
bottom
:
vertical
Space
)
Layout
.
expandToParentVerticallyWithPad
(
buttonsContainer
!
,
child
:
button
,
top
:
vertical
ButtonSpace
,
bottom
:
verticalButton
Space
)
}
}
buttonsContainer
!.
addConstraints
(
Layout
.
constraint
(
horizontalFormat
+
"|"
,
options
:
nil
,
metrics
:
[
"horizontal
Space"
:
horizontal
Space
],
views
:
buttonViews
))
buttonsContainer
!.
addConstraints
(
Layout
.
constraint
(
horizontalFormat
+
"|"
,
options
:
nil
,
metrics
:
[
"horizontal
ButtonSpace"
:
horizontalButton
Space
],
views
:
buttonViews
))
}
}
}
}
...
...
Source/ImageCardView.swift
View file @
fd927b36
...
@@ -30,14 +30,44 @@ public class ImageCardView : MaterialCardView, Comparable, Equatable {
...
@@ -30,14 +30,44 @@ public class ImageCardView : MaterialCardView, Comparable, Equatable {
internal
lazy
var
views
:
Dictionary
<
String
,
AnyObject
>
=
Dictionary
<
String
,
AnyObject
>
()
internal
lazy
var
views
:
Dictionary
<
String
,
AnyObject
>
=
Dictionary
<
String
,
AnyObject
>
()
/**
/**
:name: verticalSpace
:name: vertical
ImageView
Space
*/
*/
public
var
vertical
Space
:
CGFloat
=
MaterialTheme
.
verticalSpace
public
var
vertical
ImageViewSpace
:
CGFloat
=
0
/**
/**
:name: horizontalSpace
:name: horizontal
ImageView
Space
*/
*/
public
var
horizontalSpace
:
CGFloat
=
MaterialTheme
.
horizontalSpace
public
var
horizontalImageViewSpace
:
CGFloat
=
0
/**
:name: verticalTitleLabelSpace
*/
public
var
verticalTitleLabelSpace
:
CGFloat
=
MaterialTheme
.
verticalSpace
/**
:name: horizontalTitleLabelSpace
*/
public
var
horizontalTitleLabelSpace
:
CGFloat
=
MaterialTheme
.
horizontalSpace
/**
:name: verticalDetailLabelSpace
*/
public
var
verticalDetailLabelSpace
:
CGFloat
=
MaterialTheme
.
verticalSpace
/**
:name: horizontalDetailLabelSpace
*/
public
var
horizontalDetailLabelSpace
:
CGFloat
=
MaterialTheme
.
horizontalSpace
/**
:name: verticalButtonSpace
*/
public
var
verticalButtonSpace
:
CGFloat
=
MaterialTheme
.
verticalSpace
/**
:name: horizontalButtonSpace
*/
public
var
horizontalButtonSpace
:
CGFloat
=
MaterialTheme
.
horizontalSpace
/**
/**
:name: shadow
:name: shadow
...
@@ -288,18 +318,24 @@ public class ImageCardView : MaterialCardView, Comparable, Equatable {
...
@@ -288,18 +318,24 @@ public class ImageCardView : MaterialCardView, Comparable, Equatable {
// image
// image
if
nil
!=
imageViewContainer
&&
nil
!=
imageView
{
if
nil
!=
imageViewContainer
&&
nil
!=
imageView
{
// clear for updated constraints
imageViewContainer
!.
removeConstraints
(
imageViewContainer
!.
constraints
())
// container
// container
layoutConstraints
+=
Layout
.
constraint
(
"H:|[imageViewContainer]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
[
"imageViewContainer"
:
imageViewContainer
!
])
layoutConstraints
+=
Layout
.
constraint
(
"H:|[imageViewContainer]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
[
"imageViewContainer"
:
imageViewContainer
!
])
verticalFormat
+=
"[imageViewContainer]"
verticalFormat
+=
"[imageViewContainer]"
views
[
"imageViewContainer"
]
=
imageViewContainer
!
views
[
"imageViewContainer"
]
=
imageViewContainer
!
// text
// text
imageViewContainer
!.
addConstraints
(
Layout
.
constraint
(
"H:|
[imageView]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
[
"imageView"
:
imageView
!
]))
imageViewContainer
!.
addConstraints
(
Layout
.
constraint
(
"H:|
-(horizontalImageViewSpace)-[imageView]-(horizontalImageViewSpace)-|"
,
options
:
nil
,
metrics
:
[
"horizontalImageViewSpace"
:
horizontalImageViewSpace
]
,
views
:
[
"imageView"
:
imageView
!
]))
imageViewContainer
!.
addConstraints
(
Layout
.
constraint
(
"V:|
[imageView(maximumImageViewHeight)]|"
,
options
:
nil
,
metrics
:
[
"maximumImageViewHeight"
:
maximumImageViewHeight
],
views
:
[
"imageView"
:
imageView
!
]))
imageViewContainer
!.
addConstraints
(
Layout
.
constraint
(
"V:|
-(verticalImageViewSpace)-[imageView(maximumImageViewHeight)]-(verticalImageViewSpace)-|"
,
options
:
nil
,
metrics
:
[
"verticalImageViewSpace"
:
verticalImageViewSpace
,
"maximumImageViewHeight"
:
maximumImageViewHeight
],
views
:
[
"imageView"
:
imageView
!
]))
}
}
// title
// title
if
nil
!=
titleLabelContainer
&&
nil
!=
titleLabel
{
if
nil
!=
titleLabelContainer
&&
nil
!=
titleLabel
{
// clear for updated constraints
titleLabelContainer
!.
removeConstraints
(
titleLabelContainer
!.
constraints
())
if
nil
==
imageView
{
if
nil
==
imageView
{
// container
// container
layoutConstraints
+=
Layout
.
constraint
(
"H:|[titleLabelContainer]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
[
"titleLabelContainer"
:
titleLabelContainer
!
])
layoutConstraints
+=
Layout
.
constraint
(
"H:|[titleLabelContainer]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
[
"titleLabelContainer"
:
titleLabelContainer
!
])
...
@@ -313,24 +349,30 @@ public class ImageCardView : MaterialCardView, Comparable, Equatable {
...
@@ -313,24 +349,30 @@ public class ImageCardView : MaterialCardView, Comparable, Equatable {
// common text
// common text
Layout
.
height
(
titleLabelContainer
!
,
child
:
titleLabel
!
,
height
:
1.5
*
titleLabel
!.
font
.
pointSize
)
Layout
.
height
(
titleLabelContainer
!
,
child
:
titleLabel
!
,
height
:
1.5
*
titleLabel
!.
font
.
pointSize
)
Layout
.
expandToParentVerticallyWithPad
(
titleLabelContainer
!
,
child
:
titleLabel
!
,
top
:
vertical
Space
,
bottom
:
vertica
lSpace
)
Layout
.
expandToParentVerticallyWithPad
(
titleLabelContainer
!
,
child
:
titleLabel
!
,
top
:
vertical
TitleLabelSpace
,
bottom
:
verticalTitleLabe
lSpace
)
Layout
.
expandToParentHorizontallyWithPad
(
titleLabelContainer
!
,
child
:
titleLabel
!
,
left
:
horizontal
Space
,
right
:
horizonta
lSpace
)
Layout
.
expandToParentHorizontallyWithPad
(
titleLabelContainer
!
,
child
:
titleLabel
!
,
left
:
horizontal
TitleLabelSpace
,
right
:
horizontalTitleLabe
lSpace
)
}
}
// detail
// detail
if
nil
!=
detailLabelContainer
&&
nil
!=
detailLabel
{
if
nil
!=
detailLabelContainer
&&
nil
!=
detailLabel
{
// clear for updated constraints
detailLabelContainer
!.
removeConstraints
(
detailLabelContainer
!.
constraints
())
// container
// container
layoutConstraints
+=
Layout
.
constraint
(
"H:|[detailLabelContainer]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
[
"detailLabelContainer"
:
detailLabelContainer
!
])
layoutConstraints
+=
Layout
.
constraint
(
"H:|[detailLabelContainer]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
[
"detailLabelContainer"
:
detailLabelContainer
!
])
verticalFormat
+=
"[detailLabelContainer]"
verticalFormat
+=
"[detailLabelContainer]"
views
[
"detailLabelContainer"
]
=
detailLabelContainer
!
views
[
"detailLabelContainer"
]
=
detailLabelContainer
!
// text
// text
Layout
.
expandToParentHorizontallyWithPad
(
detailLabelContainer
!
,
child
:
detailLabel
!
,
left
:
horizontal
Space
,
right
:
horizonta
lSpace
)
Layout
.
expandToParentHorizontallyWithPad
(
detailLabelContainer
!
,
child
:
detailLabel
!
,
left
:
horizontal
DetailLabelSpace
,
right
:
horizontalDetailLabe
lSpace
)
detailLabelContainer
!.
addConstraints
(
Layout
.
constraint
(
"V:|-(vertical
Space)-[detailLabel(<=maximumDetailLabelHeight)]-(verticalSpace)-|"
,
options
:
nil
,
metrics
:
[
"verticalSpace"
:
vertica
lSpace
,
"maximumDetailLabelHeight"
:
maximumDetailLabelHeight
],
views
:
[
"detailLabel"
:
detailLabel
!
]))
detailLabelContainer
!.
addConstraints
(
Layout
.
constraint
(
"V:|-(vertical
DetailLabelSpace)-[detailLabel(<=maximumDetailLabelHeight)]-(verticalDetailLabelSpace)-|"
,
options
:
nil
,
metrics
:
[
"verticalDetailLabelSpace"
:
verticalDetailLabe
lSpace
,
"maximumDetailLabelHeight"
:
maximumDetailLabelHeight
],
views
:
[
"detailLabel"
:
detailLabel
!
]))
}
}
// buttons
// buttons
if
nil
!=
buttonsContainer
&&
(
nil
!=
leftButtons
||
nil
!=
rightButtons
)
{
if
nil
!=
buttonsContainer
&&
(
nil
!=
leftButtons
||
nil
!=
rightButtons
)
{
// clear for updated constraints
buttonsContainer
!.
removeConstraints
(
buttonsContainer
!.
constraints
())
// divider
// divider
if
nil
!=
divider
{
if
nil
!=
divider
{
layoutConstraints
+=
Layout
.
constraint
(
"H:|[divider]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
[
"divider"
:
divider
!
])
layoutConstraints
+=
Layout
.
constraint
(
"H:|[divider]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
[
"divider"
:
divider
!
])
...
@@ -351,10 +393,10 @@ public class ImageCardView : MaterialCardView, Comparable, Equatable {
...
@@ -351,10 +393,10 @@ public class ImageCardView : MaterialCardView, Comparable, Equatable {
let
button
:
MaterialButton
=
leftButtons
!
[
i
]
let
button
:
MaterialButton
=
leftButtons
!
[
i
]
buttonsContainer
!.
addSubview
(
button
)
buttonsContainer
!.
addSubview
(
button
)
buttonViews
[
"button
\(
i
)
"
]
=
button
buttonViews
[
"button
\(
i
)
"
]
=
button
horizontalFormat
+=
"-(horizontalSpace)-[button
\(
i
)
]"
horizontalFormat
+=
"-(horizontal
Button
Space)-[button
\(
i
)
]"
Layout
.
expandToParentVerticallyWithPad
(
buttonsContainer
!
,
child
:
button
,
top
:
vertical
Space
,
bottom
:
vertical
Space
)
Layout
.
expandToParentVerticallyWithPad
(
buttonsContainer
!
,
child
:
button
,
top
:
vertical
ButtonSpace
,
bottom
:
verticalButton
Space
)
}
}
buttonsContainer
!.
addConstraints
(
Layout
.
constraint
(
horizontalFormat
,
options
:
nil
,
metrics
:
[
"horizontal
Space"
:
horizontal
Space
],
views
:
buttonViews
))
buttonsContainer
!.
addConstraints
(
Layout
.
constraint
(
horizontalFormat
,
options
:
nil
,
metrics
:
[
"horizontal
ButtonSpace"
:
horizontalButton
Space
],
views
:
buttonViews
))
}
}
// rightButtons
// rightButtons
...
@@ -365,10 +407,10 @@ public class ImageCardView : MaterialCardView, Comparable, Equatable {
...
@@ -365,10 +407,10 @@ public class ImageCardView : MaterialCardView, Comparable, Equatable {
let
button
:
MaterialButton
=
rightButtons
!
[
i
]
let
button
:
MaterialButton
=
rightButtons
!
[
i
]
buttonsContainer
!.
addSubview
(
button
)
buttonsContainer
!.
addSubview
(
button
)
buttonViews
[
"button
\(
i
)
"
]
=
button
buttonViews
[
"button
\(
i
)
"
]
=
button
horizontalFormat
+=
"[button
\(
i
)
]-(horizontalSpace)-"
horizontalFormat
+=
"[button
\(
i
)
]-(horizontal
Button
Space)-"
Layout
.
expandToParentVerticallyWithPad
(
buttonsContainer
!
,
child
:
button
,
top
:
vertical
Space
,
bottom
:
vertical
Space
)
Layout
.
expandToParentVerticallyWithPad
(
buttonsContainer
!
,
child
:
button
,
top
:
vertical
ButtonSpace
,
bottom
:
verticalButton
Space
)
}
}
buttonsContainer
!.
addConstraints
(
Layout
.
constraint
(
horizontalFormat
+
"|"
,
options
:
nil
,
metrics
:
[
"horizontal
Space"
:
horizontal
Space
],
views
:
buttonViews
))
buttonsContainer
!.
addConstraints
(
Layout
.
constraint
(
horizontalFormat
+
"|"
,
options
:
nil
,
metrics
:
[
"horizontal
ButtonSpace"
:
horizontalButton
Space
],
views
:
buttonViews
))
}
}
}
}
...
...
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