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
05e84977
Commit
05e84977
authored
Oct 26, 2018
by
Jose Blaya
Browse files
wip
parent
d27d30aa
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
PIALibrary.xcodeproj/project.pbxproj
View file @
05e84977
This diff is collapsed.
Click to expand it.
PIALibrary/Resources/UI/iOS/Welcome.storyboard
View file @
05e84977
This diff is collapsed.
Click to expand it.
PIALibrary/Sources/UI/iOS/ViewControllers/GetStartedViewController.swift
0 → 100644
View file @
05e84977
//
// GetStartedViewController.swift
// PIALibrary-iOS
//
// Created by Jose Antonio Blaya Garcia on 26/10/2018.
// Copyright © 2018 London Trust Media. All rights reserved.
//
import
UIKit
class
GetStartedViewController
:
AutolayoutViewController
,
ConfigurationAccess
{
@IBOutlet
private
weak
var
viewHeaderBackground
:
UIView
!
@IBOutlet
private
weak
var
viewHeader
:
UIView
!
@IBOutlet
private
weak
var
labelVersion
:
UILabel
!
@IBOutlet
private
weak
var
buttonCancel
:
UIButton
!
@IBOutlet
private
weak
var
constraintHeaderHeight
:
NSLayoutConstraint
!
@IBOutlet
private
weak
var
buttonEnvironment
:
UIButton
!
@IBOutlet
private
weak
var
imvLogo
:
UIImageView
!
deinit
{
NotificationCenter
.
default
.
removeObserver
(
self
)
}
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
imvLogo
.
image
=
Theme
.
current
.
palette
.
logo
constraintHeaderHeight
.
constant
=
(
Macros
.
isDeviceBig
?
250.0
:
150.0
)
buttonCancel
.
accessibilityLabel
=
L10n
.
Ui
.
Global
.
cancel
buttonEnvironment
.
isHidden
=
!
accessedConfiguration
.
isDevelopment
labelVersion
.
text
=
Macros
.
localizedVersionFullString
()
}
/// :nodoc:
public
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
refreshEnvironmentButton
()
}
@IBAction
private
func
toggleEnvironment
(
_
sender
:
Any
?)
{
if
(
Client
.
environment
==
.
production
)
{
Client
.
environment
=
.
staging
}
else
{
Client
.
environment
=
.
production
}
refreshEnvironmentButton
()
}
private
func
refreshEnvironmentButton
()
{
if
(
Client
.
environment
==
.
production
)
{
buttonEnvironment
.
setTitle
(
"Production"
,
for
:
.
normal
)
}
else
{
buttonEnvironment
.
setTitle
(
"Staging"
,
for
:
.
normal
)
}
}
// MARK: Restylable
/// :nodoc:
public
override
func
viewShouldRestyle
()
{
super
.
viewShouldRestyle
()
Theme
.
current
.
applyLightBackground
(
viewHeaderBackground
)
Theme
.
current
.
applyLightBackground
(
viewHeader
)
Theme
.
current
.
applyCancelButton
(
buttonCancel
,
appearance
:
.
dark
)
Theme
.
current
.
applyCaption
(
labelVersion
,
appearance
:
.
dark
)
buttonEnvironment
.
setTitleColor
(
buttonCancel
.
titleColor
(
for
:
.
normal
),
for
:
.
normal
)
}
}
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