Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2022-09-15 16:15:00 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5d631fcb7bd06cf7b3a8576a9514359323d5d0b0
5d631fcb
1 parent
7c53de69
fix header back button size
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
SwiftWarplyFramework/SwiftWarplyFramework/ViewControllerExtensions.swift
SwiftWarplyFramework/SwiftWarplyFramework/ViewControllerExtensions.swift
View file @
5d631fc
...
...
@@ -13,9 +13,9 @@ extension UIViewController {
let
backButton
=
UIButton
(
type
:
UIButton
.
ButtonType
.
custom
)
as
UIButton
if
(
icon
==
"ic_close"
)
{
backButton
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
uiscreen
.
height
*
0.0
25
,
height
:
uiscreen
.
height
*
0.02
5
)
backButton
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
uiscreen
.
height
*
0.0
35
,
height
:
uiscreen
.
height
*
0.03
5
)
}
else
{
backButton
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
uiscreen
.
height
*
0.0
25
,
height
:
uiscreen
.
height
*
0.02
)
backButton
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
uiscreen
.
height
*
0.0
35
,
height
:
uiscreen
.
height
*
0.03
)
}
backButton
.
imageView
!.
contentMode
=
.
scaleAspectFit
//backButton.setBackgroundImage(UIImage(named:Assets.Navigation.backButton), for: UIControlState())
...
...
@@ -27,12 +27,12 @@ extension UIViewController {
backButton
.
translatesAutoresizingMaskIntoConstraints
=
false
// Add width, height constraints
if
(
icon
==
"ic_close"
)
{
let
widthContraints
=
NSLayoutConstraint
(
item
:
backButton
,
attribute
:
NSLayoutConstraint
.
Attribute
.
width
,
relatedBy
:
NSLayoutConstraint
.
Relation
.
equal
,
toItem
:
nil
,
attribute
:
NSLayoutConstraint
.
Attribute
.
notAnAttribute
,
multiplier
:
1
,
constant
:
uiscreen
.
height
*
0.0
2
5
)
let
heightContraints
=
NSLayoutConstraint
(
item
:
backButton
,
attribute
:
NSLayoutConstraint
.
Attribute
.
height
,
relatedBy
:
NSLayoutConstraint
.
Relation
.
equal
,
toItem
:
nil
,
attribute
:
NSLayoutConstraint
.
Attribute
.
notAnAttribute
,
multiplier
:
1
,
constant
:
uiscreen
.
height
*
0.0
2
5
)
let
widthContraints
=
NSLayoutConstraint
(
item
:
backButton
,
attribute
:
NSLayoutConstraint
.
Attribute
.
width
,
relatedBy
:
NSLayoutConstraint
.
Relation
.
equal
,
toItem
:
nil
,
attribute
:
NSLayoutConstraint
.
Attribute
.
notAnAttribute
,
multiplier
:
1
,
constant
:
uiscreen
.
height
*
0.0
3
5
)
let
heightContraints
=
NSLayoutConstraint
(
item
:
backButton
,
attribute
:
NSLayoutConstraint
.
Attribute
.
height
,
relatedBy
:
NSLayoutConstraint
.
Relation
.
equal
,
toItem
:
nil
,
attribute
:
NSLayoutConstraint
.
Attribute
.
notAnAttribute
,
multiplier
:
1
,
constant
:
uiscreen
.
height
*
0.0
3
5
)
NSLayoutConstraint
.
activate
([
heightContraints
,
widthContraints
])
}
else
{
let
widthContraints
=
NSLayoutConstraint
(
item
:
backButton
,
attribute
:
NSLayoutConstraint
.
Attribute
.
width
,
relatedBy
:
NSLayoutConstraint
.
Relation
.
equal
,
toItem
:
nil
,
attribute
:
NSLayoutConstraint
.
Attribute
.
notAnAttribute
,
multiplier
:
1
,
constant
:
uiscreen
.
height
*
0.0
2
5
)
let
heightContraints
=
NSLayoutConstraint
(
item
:
backButton
,
attribute
:
NSLayoutConstraint
.
Attribute
.
height
,
relatedBy
:
NSLayoutConstraint
.
Relation
.
equal
,
toItem
:
nil
,
attribute
:
NSLayoutConstraint
.
Attribute
.
notAnAttribute
,
multiplier
:
1
,
constant
:
uiscreen
.
height
*
0.0
2
)
let
widthContraints
=
NSLayoutConstraint
(
item
:
backButton
,
attribute
:
NSLayoutConstraint
.
Attribute
.
width
,
relatedBy
:
NSLayoutConstraint
.
Relation
.
equal
,
toItem
:
nil
,
attribute
:
NSLayoutConstraint
.
Attribute
.
notAnAttribute
,
multiplier
:
1
,
constant
:
uiscreen
.
height
*
0.0
3
5
)
let
heightContraints
=
NSLayoutConstraint
(
item
:
backButton
,
attribute
:
NSLayoutConstraint
.
Attribute
.
height
,
relatedBy
:
NSLayoutConstraint
.
Relation
.
equal
,
toItem
:
nil
,
attribute
:
NSLayoutConstraint
.
Attribute
.
notAnAttribute
,
multiplier
:
1
,
constant
:
uiscreen
.
height
*
0.0
3
)
NSLayoutConstraint
.
activate
([
heightContraints
,
widthContraints
])
}
...
...
Please
register
or
login
to post a comment