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
cefc7cb0
Commit
cefc7cb0
authored
Aug 26, 2015
by
adamdahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new card with button + image
parent
51dbc2fa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
147 additions
and
13 deletions
+147
-13
MaterialKit.xcodeproj/project.pbxproj
+4
-0
Source/BasicCard.swift
+12
-12
Source/ImageTextButtonCard.swift
+107
-0
Source/ImageTextCard.swift
+24
-1
No files found.
MaterialKit.xcodeproj/project.pbxproj
View file @
cefc7cb0
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
963832881B8908180015F710
/* Layout.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
963832871B8908180015F710
/* Layout.swift */
;
};
963832881B8908180015F710
/* Layout.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
963832871B8908180015F710
/* Layout.swift */
;
};
963832891B89097D0015F710
/* Layout.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
963832871B8908180015F710
/* Layout.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
963832891B89097D0015F710
/* Layout.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
963832871B8908180015F710
/* Layout.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9A3A3B6A1B8E992F005F16BC
/* ImageTextCard.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A3A3B691B8E992F005F16BC
/* ImageTextCard.swift */
;
};
9A3A3B6A1B8E992F005F16BC
/* ImageTextCard.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A3A3B691B8E992F005F16BC
/* ImageTextCard.swift */
;
};
9A3A3B6E1B8EA7A5005F16BC
/* ImageTextButtonCard.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A3A3B6D1B8EA7A5005F16BC
/* ImageTextButtonCard.swift */
;
};
9A94D0F91B895C8C00F586A5
/* Roboto.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9AAC38531B89559900FE6B2D
/* Roboto.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9A94D0F91B895C8C00F586A5
/* Roboto.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9AAC38531B89559900FE6B2D
/* Roboto.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9A94D0FA1B895EA500F586A5
/* LICENSE in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
963832631B88E5BF0015F710
/* LICENSE */
;
};
9A94D0FA1B895EA500F586A5
/* LICENSE in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
963832631B88E5BF0015F710
/* LICENSE */
;
};
9A94D0FB1B895EA500F586A5
/* Roboto-Regular.ttf in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9AAC38591B8956E300FE6B2D
/* Roboto-Regular.ttf */
;
};
9A94D0FB1B895EA500F586A5
/* Roboto-Regular.ttf in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9AAC38591B8956E300FE6B2D
/* Roboto-Regular.ttf */
;
};
...
@@ -75,6 +76,7 @@
...
@@ -75,6 +76,7 @@
963832681B88E5BF0015F710
/* TextView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
TextView.swift
;
sourceTree
=
"<group>"
;
};
963832681B88E5BF0015F710
/* TextView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
TextView.swift
;
sourceTree
=
"<group>"
;
};
963832871B8908180015F710
/* Layout.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Layout.swift
;
sourceTree
=
"<group>"
;
};
963832871B8908180015F710
/* Layout.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Layout.swift
;
sourceTree
=
"<group>"
;
};
9A3A3B691B8E992F005F16BC
/* ImageTextCard.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ImageTextCard.swift
;
sourceTree
=
"<group>"
;
};
9A3A3B691B8E992F005F16BC
/* ImageTextCard.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ImageTextCard.swift
;
sourceTree
=
"<group>"
;
};
9A3A3B6D1B8EA7A5005F16BC
/* ImageTextButtonCard.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ImageTextButtonCard.swift
;
sourceTree
=
"<group>"
;
};
9A94D1081B8A3F5100F586A5
/* MaterialPulseView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MaterialPulseView.swift
;
sourceTree
=
"<group>"
;
};
9A94D1081B8A3F5100F586A5
/* MaterialPulseView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MaterialPulseView.swift
;
sourceTree
=
"<group>"
;
};
9A94D10A1B8A485C00F586A5
/* ImageCard.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ImageCard.swift
;
sourceTree
=
"<group>"
;
};
9A94D10A1B8A485C00F586A5
/* ImageCard.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ImageCard.swift
;
sourceTree
=
"<group>"
;
};
9AAC384C1B89528900FE6B2D
/* BasicCard.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
BasicCard.swift
;
sourceTree
=
"<group>"
;
};
9AAC384C1B89528900FE6B2D
/* BasicCard.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
BasicCard.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -225,6 +227,7 @@
...
@@ -225,6 +227,7 @@
9AAC384C1B89528900FE6B2D
/* BasicCard.swift */
,
9AAC384C1B89528900FE6B2D
/* BasicCard.swift */
,
9A94D10A1B8A485C00F586A5
/* ImageCard.swift */
,
9A94D10A1B8A485C00F586A5
/* ImageCard.swift */
,
9A3A3B691B8E992F005F16BC
/* ImageTextCard.swift */
,
9A3A3B691B8E992F005F16BC
/* ImageTextCard.swift */
,
9A3A3B6D1B8EA7A5005F16BC
/* ImageTextButtonCard.swift */
,
);
);
name
=
Card
;
name
=
Card
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -372,6 +375,7 @@
...
@@ -372,6 +375,7 @@
963832711B88E5BF0015F710
/* Text.swift in Sources */
,
963832711B88E5BF0015F710
/* Text.swift in Sources */
,
9638326A1B88E5BF0015F710
/* CapturePreview.swift in Sources */
,
9638326A1B88E5BF0015F710
/* CapturePreview.swift in Sources */
,
65B965721B8A578D0055B139
/* MaterialViewController.swift in Sources */
,
65B965721B8A578D0055B139
/* MaterialViewController.swift in Sources */
,
9A3A3B6E1B8EA7A5005F16BC
/* ImageTextButtonCard.swift in Sources */
,
9AAC38541B89559900FE6B2D
/* Roboto.swift in Sources */
,
9AAC38541B89559900FE6B2D
/* Roboto.swift in Sources */
,
65B9657E1B8A7C330055B139
/* MaterialButton.swift in Sources */
,
65B9657E1B8A7C330055B139
/* MaterialButton.swift in Sources */
,
963832881B8908180015F710
/* Layout.swift in Sources */
,
963832881B8908180015F710
/* Layout.swift in Sources */
,
...
...
Source/BasicCard.swift
View file @
cefc7cb0
...
@@ -36,10 +36,10 @@ public class BasicCard : MaterialPulseView {
...
@@ -36,10 +36,10 @@ public class BasicCard : MaterialPulseView {
}
}
internal
override
func
initialize
()
{
internal
override
func
initialize
()
{
setup
TitleLabel
()
prepare
TitleLabel
()
setup
DetailTextLabel
()
prepare
DetailTextLabel
()
setupHorizontalLine
Separator
()
prepareHorizontal
Separator
()
setup
Buttons
()
prepare
Buttons
()
super
.
initialize
()
super
.
initialize
()
}
}
...
@@ -53,7 +53,7 @@ public class BasicCard : MaterialPulseView {
...
@@ -53,7 +53,7 @@ public class BasicCard : MaterialPulseView {
addConstraints
(
Layout
.
constraint
(
"V:|-(20)-[titleLabel(22)]-(10)-[detailTextLabel]-(20)-[horizontalSeparator(1)]-(10)-[otherButton]-(10)-|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
))
addConstraints
(
Layout
.
constraint
(
"V:|-(20)-[titleLabel(22)]-(10)-[detailTextLabel]-(20)-[horizontalSeparator(1)]-(10)-[otherButton]-(10)-|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
))
}
}
private
func
setup
TitleLabel
()
{
private
func
prepare
TitleLabel
()
{
titleLabel
.
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
titleLabel
.
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
titleLabel
.
font
=
Roboto
.
regularWithSize
(
22.0
)
titleLabel
.
font
=
Roboto
.
regularWithSize
(
22.0
)
titleLabel
.
textColor
=
UIColor
.
whiteColor
()
titleLabel
.
textColor
=
UIColor
.
whiteColor
()
...
@@ -62,7 +62,7 @@ public class BasicCard : MaterialPulseView {
...
@@ -62,7 +62,7 @@ public class BasicCard : MaterialPulseView {
views
[
"titleLabel"
]
=
titleLabel
views
[
"titleLabel"
]
=
titleLabel
}
}
private
func
setup
DetailTextLabel
()
{
private
func
prepare
DetailTextLabel
()
{
detailTextLabel
.
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
detailTextLabel
.
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
detailTextLabel
.
font
=
Roboto
.
lightWithSize
(
16.0
)
detailTextLabel
.
font
=
Roboto
.
lightWithSize
(
16.0
)
detailTextLabel
.
textColor
=
UIColor
.
whiteColor
()
detailTextLabel
.
textColor
=
UIColor
.
whiteColor
()
...
@@ -73,7 +73,7 @@ public class BasicCard : MaterialPulseView {
...
@@ -73,7 +73,7 @@ public class BasicCard : MaterialPulseView {
views
[
"detailTextLabel"
]
=
detailTextLabel
views
[
"detailTextLabel"
]
=
detailTextLabel
}
}
private
func
setupHorizontalLine
Separator
()
{
private
func
prepareHorizontal
Separator
()
{
horizontalSeparator
.
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
horizontalSeparator
.
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
horizontalSeparator
.
backgroundColor
=
UIColor
.
whiteColor
()
horizontalSeparator
.
backgroundColor
=
UIColor
.
whiteColor
()
horizontalSeparator
.
alpha
=
0.2
horizontalSeparator
.
alpha
=
0.2
...
@@ -81,12 +81,12 @@ public class BasicCard : MaterialPulseView {
...
@@ -81,12 +81,12 @@ public class BasicCard : MaterialPulseView {
views
[
"horizontalSeparator"
]
=
horizontalSeparator
views
[
"horizontalSeparator"
]
=
horizontalSeparator
}
}
private
func
setup
Buttons
()
{
private
func
prepare
Buttons
()
{
setup
CancelButton
()
prepare
CancelButton
()
setup
OtherButton
()
prepare
OtherButton
()
}
}
private
func
setup
CancelButton
()
{
private
func
prepare
CancelButton
()
{
cancelButton
.
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
cancelButton
.
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
cancelButton
.
setTitle
(
"Cancel"
,
forState
:
.
Normal
)
cancelButton
.
setTitle
(
"Cancel"
,
forState
:
.
Normal
)
cancelButton
.
setTitleColor
(
buttonColor
,
forState
:
.
Normal
)
cancelButton
.
setTitleColor
(
buttonColor
,
forState
:
.
Normal
)
...
@@ -95,7 +95,7 @@ public class BasicCard : MaterialPulseView {
...
@@ -95,7 +95,7 @@ public class BasicCard : MaterialPulseView {
views
[
"cancelButton"
]
=
cancelButton
views
[
"cancelButton"
]
=
cancelButton
}
}
private
func
setup
OtherButton
()
{
private
func
prepare
OtherButton
()
{
otherButton
.
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
otherButton
.
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
otherButton
.
setTitle
(
"Confirm"
,
forState
:
.
Normal
)
otherButton
.
setTitle
(
"Confirm"
,
forState
:
.
Normal
)
otherButton
.
setTitleColor
(
buttonColor
,
forState
:
.
Normal
)
otherButton
.
setTitleColor
(
buttonColor
,
forState
:
.
Normal
)
...
...
Source/ImageTextButtonCard.swift
0 → 100644
View file @
cefc7cb0
//
// ImageTextButtonCard.swift
// MaterialKit
//
// Created by Adam Dahan on 2015-08-26.
// Copyright (c) 2015 GraphKit Inc. All rights reserved.
//
import
UIKit
public
class
ImageTextButtonCard
:
MaterialPulseView
{
public
lazy
var
imageView
:
UIImageView
=
UIImageView
()
public
lazy
var
titleLabel
:
UILabel
=
UILabel
()
public
lazy
var
descriptionContainerView
:
UIView
=
UIView
()
public
lazy
var
descriptionLabel
:
UILabel
=
UILabel
()
public
lazy
var
horizontalSeparator
:
UIView
=
UIView
()
public
lazy
var
button
:
FlatButton
=
FlatButton
()
public
required
init
(
coder
aDecoder
:
NSCoder
)
{
super
.
init
(
coder
:
aDecoder
)
}
public
required
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
}
internal
override
func
initialize
()
{
prepareImageView
()
prepareTitleLabel
()
prepareDescriptionContainerView
()
prepareDescriptionLabel
()
prepareHorizontalSeparator
()
prepareButton
()
super
.
initialize
()
}
internal
override
func
constrainSubviews
()
{
super
.
constrainSubviews
()
addConstraints
(
Layout
.
constraint
(
"H:|[imageView]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
))
imageView
.
addConstraints
(
Layout
.
constraint
(
"H:|-20-[titleLabel]-(20)-|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
))
imageView
.
addConstraints
(
Layout
.
constraint
(
"V:[titleLabel(45)]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
))
addConstraints
(
Layout
.
constraint
(
"H:|[descriptionContainerView]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
))
descriptionContainerView
.
addConstraints
(
Layout
.
constraint
(
"H:|-20-[descriptionLabel]-(20)-|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
))
addConstraints
(
Layout
.
constraint
(
"V:|[imageView][descriptionContainerView(160)]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
))
descriptionContainerView
.
addConstraints
(
Layout
.
constraint
(
"H:|[horizontalSeparator]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
))
descriptionContainerView
.
addConstraints
(
Layout
.
constraint
(
"H:|-(10)-[button(70)]"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
))
descriptionContainerView
.
addConstraints
(
Layout
.
constraint
(
"V:|-(20)-[descriptionLabel]-(20)-[horizontalSeparator(1)]-(10)-[button(30)]-(10)-|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
))
}
private
func
prepareImageView
()
{
imageView
.
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
imageView
.
contentMode
=
.
ScaleAspectFill
imageView
.
userInteractionEnabled
=
false
imageView
.
clipsToBounds
=
true
addSubview
(
imageView
)
views
[
"imageView"
]
=
imageView
}
private
func
prepareTitleLabel
()
{
titleLabel
.
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
titleLabel
.
font
=
Roboto
.
mediumWithSize
(
18
)
titleLabel
.
textColor
=
.
whiteColor
()
titleLabel
.
text
=
"Card Title"
titleLabel
.
layer
.
shadowOffset
=
CGSizeMake
(
1
,
1
)
titleLabel
.
layer
.
shadowOpacity
=
0.4
titleLabel
.
layer
.
shadowRadius
=
5.0
imageView
.
addSubview
(
titleLabel
)
views
[
"titleLabel"
]
=
titleLabel
}
private
func
prepareDescriptionContainerView
()
{
descriptionContainerView
.
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
descriptionContainerView
.
backgroundColor
=
UIColor
.
whiteColor
()
addSubview
(
descriptionContainerView
)
views
[
"descriptionContainerView"
]
=
descriptionContainerView
}
private
func
prepareDescriptionLabel
()
{
descriptionLabel
.
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
descriptionLabel
.
font
=
Roboto
.
lightWithSize
(
14
)
descriptionLabel
.
textColor
=
.
darkTextColor
()
descriptionLabel
.
numberOfLines
=
0
descriptionLabel
.
lineBreakMode
=
NSLineBreakMode
.
ByWordWrapping
descriptionLabel
.
text
=
"I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively."
descriptionContainerView
.
addSubview
(
descriptionLabel
)
views
[
"descriptionLabel"
]
=
descriptionLabel
}
private
func
prepareHorizontalSeparator
()
{
horizontalSeparator
.
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
horizontalSeparator
.
backgroundColor
=
UIColor
.
darkGrayColor
()
horizontalSeparator
.
alpha
=
0.2
descriptionContainerView
.
addSubview
(
horizontalSeparator
)
views
[
"horizontalSeparator"
]
=
horizontalSeparator
}
private
func
prepareButton
()
{
button
.
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
button
.
setTitle
(
"Cancel"
,
forState
:
.
Normal
)
button
.
setTitleColor
(
UIColor
(
red
:
255.0
/
255.0
,
green
:
156.0
/
255.0
,
blue
:
38.0
/
255.0
,
alpha
:
1.0
),
forState
:
.
Normal
)
button
.
layer
.
shadowOpacity
=
0
button
.
titleLabel
!.
font
=
Roboto
.
lightWithSize
(
16.0
)
button
.
pulseColor
=
UIColor
(
red
:
255.0
/
255.0
,
green
:
156.0
/
255.0
,
blue
:
38.0
/
255.0
,
alpha
:
1.0
)
descriptionContainerView
.
addSubview
(
button
)
views
[
"button"
]
=
button
}
}
Source/ImageTextCard.swift
View file @
cefc7cb0
...
@@ -13,7 +13,10 @@ public class ImageTextCard : MaterialPulseView {
...
@@ -13,7 +13,10 @@ public class ImageTextCard : MaterialPulseView {
public
lazy
var
titleLabel
:
UILabel
=
UILabel
()
public
lazy
var
titleLabel
:
UILabel
=
UILabel
()
public
lazy
var
descriptionContainerView
:
UIView
=
UIView
()
public
lazy
var
descriptionContainerView
:
UIView
=
UIView
()
public
lazy
var
descriptionLabel
:
UILabel
=
UILabel
()
public
lazy
var
descriptionLabel
:
UILabel
=
UILabel
()
public
lazy
var
horizontalSeparator
:
UIView
=
UIView
()
public
lazy
var
ctaButton
:
FlatButton
=
FlatButton
()
public
lazy
var
showsCTA
:
Bool
=
false
public
required
init
(
coder
aDecoder
:
NSCoder
)
{
public
required
init
(
coder
aDecoder
:
NSCoder
)
{
super
.
init
(
coder
:
aDecoder
)
super
.
init
(
coder
:
aDecoder
)
}
}
...
@@ -27,6 +30,10 @@ public class ImageTextCard : MaterialPulseView {
...
@@ -27,6 +30,10 @@ public class ImageTextCard : MaterialPulseView {
prepareTitleLabel
()
prepareTitleLabel
()
prepareDescriptionContainerView
()
prepareDescriptionContainerView
()
prepareDescriptionLabel
()
prepareDescriptionLabel
()
if
showsCTA
{
prepareHorizontalSeparator
()
prepareCTAButton
()
}
super
.
initialize
()
super
.
initialize
()
}
}
...
@@ -39,6 +46,10 @@ public class ImageTextCard : MaterialPulseView {
...
@@ -39,6 +46,10 @@ public class ImageTextCard : MaterialPulseView {
descriptionContainerView
.
addConstraints
(
Layout
.
constraint
(
"H:|-20-[descriptionLabel]-(20)-|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
))
descriptionContainerView
.
addConstraints
(
Layout
.
constraint
(
"H:|-20-[descriptionLabel]-(20)-|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
))
descriptionContainerView
.
addConstraints
(
Layout
.
constraint
(
"V:|-(20)-[descriptionLabel]-(20)-|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
))
descriptionContainerView
.
addConstraints
(
Layout
.
constraint
(
"V:|-(20)-[descriptionLabel]-(20)-|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
))
addConstraints
(
Layout
.
constraint
(
"V:|[imageView][descriptionContainerView(120)]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
))
addConstraints
(
Layout
.
constraint
(
"V:|[imageView][descriptionContainerView(120)]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
))
if
showsCTA
{
descriptionContainerView
.
addConstraints
(
Layout
.
constraint
(
"H:|[horizontalSeparator]|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
))
descriptionContainerView
.
addConstraints
(
Layout
.
constraint
(
"V:|-(20)-[descriptionLabel]-(20)-[horizontalSeparator(1)]-(20)-|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
))
}
}
}
private
func
prepareImageView
()
{
private
func
prepareImageView
()
{
...
@@ -79,4 +90,16 @@ public class ImageTextCard : MaterialPulseView {
...
@@ -79,4 +90,16 @@ public class ImageTextCard : MaterialPulseView {
descriptionContainerView
.
addSubview
(
descriptionLabel
)
descriptionContainerView
.
addSubview
(
descriptionLabel
)
views
[
"descriptionLabel"
]
=
descriptionLabel
views
[
"descriptionLabel"
]
=
descriptionLabel
}
}
private
func
prepareHorizontalSeparator
()
{
horizontalSeparator
.
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
horizontalSeparator
.
backgroundColor
=
UIColor
.
whiteColor
()
horizontalSeparator
.
alpha
=
0.2
descriptionContainerView
.
addSubview
(
horizontalSeparator
)
views
[
"horizontalSeparator"
]
=
horizontalSeparator
}
private
func
prepareCTAButton
()
{
}
}
}
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