Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
liberty
tunnel
liberty-tunnel-client-library-apple
Commits
6eae57a5
Commit
6eae57a5
authored
Jul 31, 2019
by
Jose Blaya
Browse files
Green sticky note for success statuses
parent
85e244a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
PIALibrary/Sources/UI/iOS/Macros+UI.swift
View file @
6eae57a5
...
...
@@ -218,6 +218,40 @@ extension Macros {
}
/**
Shortcut to display a success `EKImageNoteMessageView`.
- Parameter image: The note image
- Parameter message: The note message
- Parameter duration: Optional duration of the note
*/
public
static
func
displaySuccessImageNote
(
withImage
image
:
UIImage
,
message
:
String
,
andDuration
duration
:
Double
?
=
nil
)
{
var
attributes
=
EKAttributes
()
attributes
=
.
topToast
attributes
.
hapticFeedbackType
=
.
success
attributes
.
entryBackground
=
.
color
(
color
:
UIColor
.
piaGreenDark20
)
attributes
.
positionConstraints
.
size
=
.
init
(
width
:
EKAttributes
.
PositionConstraints
.
Edge
.
fill
,
height
:
EKAttributes
.
PositionConstraints
.
Edge
.
constant
(
value
:
bannerHeight
))
if
let
duration
=
duration
{
attributes
.
displayDuration
=
duration
}
let
labelContent
=
EKProperty
.
LabelContent
(
text
:
message
,
style
:
.
init
(
font
:
TextStyle
.
textStyle7
.
font
!
,
color
:
.
white
))
let
imageContent
=
EKProperty
.
ImageContent
(
image
:
image
)
let
contentView
=
EKImageNoteMessageView
(
with
:
labelContent
,
imageContent
:
imageContent
)
SwiftEntryKit
.
display
(
entry
:
contentView
,
using
:
attributes
)
}
/**
Shortcut to display an infinite `EKImageNoteMessageView`.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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