Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
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
c58385bd
Commit
c58385bd
authored
Nov 15, 2018
by
Jose Blaya
Browse files
- Complete login flow
- Show warning icon in textfields when status is .error
parent
acbbe341
Changes
4
Hide whitespace changes
Inline
Side-by-side
PIALibrary/Sources/UI/iOS/BorderedTextField.swift
View file @
c58385bd
...
...
@@ -77,7 +77,7 @@ public class BorderedTextField: UITextField {
/// :nodoc:
public
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
rightViewMode
=
.
unlessEditing
borderStyle
=
.
none
textColor
=
.
darkText
self
.
delegate
=
self
...
...
@@ -138,6 +138,12 @@ public class BorderedTextField: UITextField {
return
UIEdgeInsetsInsetRect
(
bounds
,
UIEdgeInsetsMake
(
0
,
16
,
0
,
16
))
}
public
override
func
rightViewRect
(
forBounds
bounds
:
CGRect
)
->
CGRect
{
var
rightViewRect
=
super
.
rightViewRect
(
forBounds
:
bounds
)
rightViewRect
.
origin
.
x
-=
16
return
rightViewRect
}
}
...
...
PIALibrary/Sources/UI/iOS/ViewControllers/AutolayoutViewController.swift
View file @
c58385bd
...
...
@@ -122,12 +122,16 @@ open class AutolayoutViewController: UIViewController, ModalController, Restylab
private
func
restoreFormElementBorder
(
_
element
:
UIView
)
{
if
let
element
=
element
as?
UITextField
{
Theme
.
current
.
applyInput
(
element
)
element
.
rightView
=
nil
}
}
private
func
updateFormElementBorder
(
_
element
:
UIView
)
{
if
let
element
=
element
as?
UITextField
{
Theme
.
current
.
applyInputError
(
element
)
let
iconWarning
=
UIImageView
(
image
:
Asset
.
iconWarning
.
image
.
withRenderingMode
(
.
alwaysTemplate
))
iconWarning
.
tintColor
=
.
piaRed
element
.
rightView
=
iconWarning
}
}
...
...
PIALibrary/Sources/UI/iOS/ViewControllers/GetStartedViewController.swift
View file @
c58385bd
...
...
@@ -21,7 +21,9 @@ public class GetStartedViewController: AutolayoutViewController, ConfigurationAc
@IBOutlet
private
weak
var
buyButton
:
PIAButton
!
@IBOutlet
private
weak
var
redeemButton
:
UIButton
!
@IBOutlet
private
weak
var
couldNotGetPlanButton
:
UIButton
!
var
preset
=
Preset
()
private
weak
var
delegate
:
PIAWelcomeViewControllerDelegate
?
deinit
{
NotificationCenter
.
default
.
removeObserver
(
self
)
...
...
@@ -42,18 +44,30 @@ public class GetStartedViewController: AutolayoutViewController, ConfigurationAc
/**
Creates a wrapped `GetStartedViewController` ready for presentation.
- Parameter preset: The optional `Preset` to configure this controller with
- Parameter delegate: The `PIAWelcomeViewControllerDelegate` to handle raised events
*/
public
static
func
create
(
)
->
UIViewController
{
public
static
func
with
(
preset
:
Preset
?
=
nil
,
delegate
:
PIAWelcomeViewControllerDelegate
?
=
nil
)
->
UIViewController
{
let
nav
=
StoryboardScene
.
Welcome
.
initialScene
.
instantiate
()
let
vc
=
nav
.
topViewController
as!
GetStartedViewController
if
let
customPreset
=
preset
{
vc
.
preset
=
customPreset
}
vc
.
delegate
=
delegate
return
nav
}
public
override
func
prepare
(
for
segue
:
UIStoryboardSegue
,
sender
:
Any
?)
{
guard
let
vc
=
segue
.
destination
as?
PIAWelcomeViewController
else
{
return
}
vc
.
delegate
=
self
.
delegate
vc
.
preset
=
self
.
preset
switch
segue
.
identifier
{
case
StoryboardSegue
.
Welcome
.
redeemGiftCardSegue
.
rawValue
:
vc
.
preset
.
pages
=
.
redeem
...
...
PIALibrary/Sources/UI/iOS/ViewControllers/PIAWelcomeViewController.swift
View file @
c58385bd
...
...
@@ -19,8 +19,7 @@ public class PIAWelcomeViewController: AutolayoutViewController, WelcomeCompleti
var
preset
=
Preset
()
private
var
pendingSignupRequest
:
SignupRequest
?
private
weak
var
delegate
:
PIAWelcomeViewControllerDelegate
?
weak
var
delegate
:
PIAWelcomeViewControllerDelegate
?
/// It's `true` if the controller was created with `Preset.isEphemeral`.
///
...
...
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