Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ayudapy
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
Julio Hermosa
ayudapy
Commits
364946d9
Commit
364946d9
authored
May 19, 2020
by
Julio Hermosa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
se agregan las imágenes de los pedidos
parent
e5f3a7a2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
11 deletions
+24
-11
ayudapy.xcworkspace/xcuserdata/roshka.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
ayudapy/Static/Format.swift
+3
-3
ayudapy/ViewControllers/RequestViewController.swift
+21
-8
No files found.
ayudapy.xcworkspace/xcuserdata/roshka.xcuserdatad/UserInterfaceState.xcuserstate
View file @
364946d9
No preview for this file type
ayudapy/Static/Format.swift
View file @
364946d9
...
...
@@ -19,9 +19,9 @@ class Format{
let
bodyTextColor
=
UIColor
(
displayP3Red
:
10
/
255
,
green
:
10
/
255
,
blue
:
10
/
255
,
alpha
:
1
)
let
dateTextColor
=
UIColor
(
displayP3Red
:
50
/
255
,
green
:
50
/
255
,
blue
:
50
/
255
,
alpha
:
1
)
let
dateFontStyle
=
UIFont
.
systemFont
(
ofSize
:
10
)
let
titleFontStyle
=
UIFont
.
boldSystemFont
(
ofSize
:
1
8
)
let
bodyFontStyle
=
UIFont
.
systemFont
(
ofSize
:
1
5
)
let
subTitleFontStyle
=
UIFont
.
systemFont
(
ofSize
:
1
6
)
let
titleFontStyle
=
UIFont
.
boldSystemFont
(
ofSize
:
1
6
)
let
bodyFontStyle
=
UIFont
.
systemFont
(
ofSize
:
1
4
)
let
subTitleFontStyle
=
UIFont
.
systemFont
(
ofSize
:
1
5
)
}
extension
String
{
...
...
ayudapy/ViewControllers/RequestViewController.swift
View file @
364946d9
...
...
@@ -72,32 +72,37 @@ class RequestViewController: UIViewController {
dateLabel
.
text
=
"Publicado el
\(
day
)
de
\(
month
)
de
\(
year
)
a las
\(
hour
)
"
dateLabel
.
font
=
format
.
dateFontStyle
dateLabel
.
textColor
=
format
.
dateTextColor
dateLabel
.
heightAnchor
.
constraint
(
equalToConstant
:
14
)
.
isActive
=
true
//titulo del pedido
let
titleLbl
=
UILabel
()
titleLbl
.
text
=
"
\(
hRequestTitle
)
"
titleLbl
.
font
=
format
.
titleFontStyle
titleLbl
.
textColor
=
format
.
titleTextColor
dateLabel
.
heightAnchor
.
constraint
(
equalToConstant
:
18
)
.
isActive
=
true
//detalle del pedido
let
messageLabel
=
UILabel
()
messageLabel
.
text
=
"
\(
message
)
"
messageLabel
.
font
=
format
.
bodyFontStyle
messageLabel
.
numberOfLines
=
.
max
messageLabel
.
lineBreakMode
=
.
byWordWrapping
messageLabel
.
sizeToFit
()
//print("ha upei \()")
//messageLabel.sizeToFit()
//Para mostrar la imagen en caso de que el campo no sea nulo
let
imageView
=
UIImageView
()
if
imageUrl
!=
nil
{
imageView
.
layer
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
100
,
height
:
100
)
imageView
.
heightAnchor
.
constraint
(
equalToConstant
:
view
.
frame
.
width
*
0.4
)
.
isActive
=
true
imageView
.
widthAnchor
.
constraint
(
equalToConstant
:
view
.
frame
.
width
*
0.4
)
.
isActive
=
true
imageView
.
kf
.
indicatorType
=
.
activity
imageView
.
kf
.
setImage
(
with
:
URL
(
string
:
imageUrl
!
))
imageView
.
kf
.
setImage
(
with
:
URL
(
string
:
imageUrl
!
.
convertURL
()
))
}
//Se agrupan las vistas en la cabecera
let
headerStackView
=
UIStackView
(
arrangedSubviews
:
[
dateLabel
,
titleLbl
,
messageLabel
])
let
headerStackView
=
UIStackView
(
arrangedSubviews
:
[
dateLabel
,
titleLbl
,
messageLabel
,
imageView
])
headerStackView
.
axis
=
.
vertical
headerStackView
.
spacing
=
5
headerStackView
.
distribution
=
.
equalSpacing
headerStackView
.
alignment
=
.
leading
//Dirección y como llegar
let
addressSubTittle
=
UILabel
()
...
...
@@ -114,8 +119,10 @@ class RequestViewController: UIViewController {
howToGetButton
.
setTitle
(
"Como llegar"
,
for
:
.
normal
)
howToGetButton
.
addTarget
(
self
,
action
:
#selector(
openGoogleMapsLink
)
,
for
:
.
touchUpInside
)
howToGetButton
.
titleLabel
?
.
font
=
format
.
subTitleFontStyle
howToGetButton
.
heightAnchor
.
constraint
(
equalToConstant
:
24
)
.
isActive
=
true
let
addressStackView
=
UIStackView
(
arrangedSubviews
:
[
addressSubTittle
,
addressLabel
,
howToGetButton
])
addressStackView
.
axis
=
.
vertical
addressStackView
.
distribution
=
.
equalSpacing
addressStackView
.
spacing
=
5
//Información del Contacto
...
...
@@ -131,8 +138,10 @@ class RequestViewController: UIViewController {
contactNumberButton
.
layer
.
cornerRadius
=
10
contactNumberButton
.
setTitle
(
"
\(
phoneNumber
)
"
,
for
:
.
normal
)
contactNumberButton
.
addTarget
(
self
,
action
:
#selector(
call
)
,
for
:
.
touchUpInside
)
contactNumberButton
.
heightAnchor
.
constraint
(
equalToConstant
:
24
)
.
isActive
=
true
let
contactInformationStackView
=
UIStackView
(
arrangedSubviews
:
[
contactLabel
,
contactNameLabel
,
contactNumberButton
])
contactInformationStackView
.
axis
=
.
vertical
contactInformationStackView
.
distribution
=
.
fillEqually
contactInformationStackView
.
spacing
=
5
//Se muestra el botón y la etiqueta de marcar como listo
...
...
@@ -173,11 +182,15 @@ class RequestViewController: UIViewController {
//Se agregan las vistas en un stack view vertical para que se vean ordenadamente, adaptando a la pantalla del dispositivo
let
stackView
=
UIStackView
(
arrangedSubviews
:
[
headerStackView
,
addressStackView
,
contactInformationStackView
,
footerStackView
])
stackView
.
axis
=
.
vertical
stackView
.
distribution
=
.
equal
Spac
ing
stackView
.
spacing
=
10
stackView
.
layer
.
frame
=
CGRect
(
x
:
20
,
y
:
20
,
width
:
view
.
frame
.
width
-
2
0
,
height
:
view
.
frame
.
height
*
0.9
)
stackView
.
distribution
=
.
equal
Center
ing
stackView
.
spacing
=
5
stackView
.
layer
.
frame
=
CGRect
(
x
:
20
,
y
:
20
,
width
:
view
.
frame
.
width
-
4
0
,
height
:
view
.
frame
.
height
*
0.9
)
view
.
addSubview
(
stackView
)
let
scrollView
=
UIScrollView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
view
.
frame
.
width
,
height
:
view
.
frame
.
height
))
scrollView
.
addSubview
(
stackView
)
//view.addSubview(stackView)
view
.
addSubview
(
scrollView
)
print
(
stackView
.
spacing
)
}
func
isReadyCheck
()
->
Bool
{
...
...
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