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
6524daa8
Commit
6524daa8
authored
May 13, 2020
by
Julio Hermosa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
primera entrega
parent
57491b63
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
156 additions
and
76 deletions
+156
-76
ayudapy.xcworkspace/xcuserdata/roshka.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
ayudapy/Base.lproj/Main.storyboard
+87
-53
ayudapy/CoreData/CoreDataManager.swift
+9
-0
ayudapy/CoreData/Favorites.xcdatamodeld/favoriteRequests.xcdatamodel/contents
+3
-1
ayudapy/Entity+CoreDataProperties.swift
+1
-0
ayudapy/Static/Format.swift
+1
-1
ayudapy/ViewControllers/MapViewController.swift
+0
-1
ayudapy/ViewControllers/MyPendingsTableViewCell.swift
+13
-1
ayudapy/ViewControllers/PendingsViewController.swift
+34
-7
ayudapy/ViewControllers/RequestViewController.swift
+8
-12
No files found.
ayudapy.xcworkspace/xcuserdata/roshka.xcuserdatad/UserInterfaceState.xcuserstate
View file @
6524daa8
No preview for this file type
ayudapy/Base.lproj/Main.storyboard
View file @
6524daa8
...
...
@@ -42,79 +42,112 @@
<objects>
<viewController
storyboardIdentifier=
"pendientesVC"
id=
"Ncc-gI-9dq"
customClass=
"PendingsViewController"
customModule=
"ayudapy"
customModuleProvider=
"target"
sceneMemberID=
"viewController"
>
<view
key=
"view"
contentMode=
"scaleToFill"
id=
"s2s-eb-0xG"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"
414
"
height=
"896"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"
500
"
height=
"896"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
heightSizable=
"YES"
/>
<subviews>
<tableView
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
alwaysBounceVertical=
"YES"
dataMode=
"prototypes"
style=
"plain"
separatorStyle=
"default"
rowHeight=
"124"
estimatedRowHeight=
"-1"
sectionHeaderHeight=
"50"
sectionFooterHeight=
"28"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"FJC-EV-fMA"
>
<rect
key=
"frame"
x=
"0.0"
y=
"44"
width=
"
414
"
height=
"818"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"44"
width=
"
500
"
height=
"818"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<prototypes>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
preservesSuperviewLayoutMargins=
"YES"
selectionStyle=
"default"
indentationWidth=
"10"
reuseIdentifier=
"cell"
rowHeight=
"1
24
"
id=
"D8e-6i-a9c"
customClass=
"MyPendingsTableViewCell"
customModule=
"ayudapy"
customModuleProvider=
"target"
>
<rect
key=
"frame"
x=
"0.0"
y=
"28"
width=
"
414"
height=
"124
"
/>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
preservesSuperviewLayoutMargins=
"YES"
selectionStyle=
"default"
indentationWidth=
"10"
reuseIdentifier=
"cell"
rowHeight=
"1
10
"
id=
"D8e-6i-a9c"
customClass=
"MyPendingsTableViewCell"
customModule=
"ayudapy"
customModuleProvider=
"target"
>
<rect
key=
"frame"
x=
"0.0"
y=
"28"
width=
"
500"
height=
"110
"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
preservesSuperviewLayoutMargins=
"YES"
insetsLayoutMarginsFromSafeArea=
"NO"
tableViewCell=
"D8e-6i-a9c"
id=
"aAc-DI-Gps"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"
414"
height=
"124
"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"
500"
height=
"110
"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<subviews>
<scrollView
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"bU8-yM-Yme"
>
<rect
key=
"frame"
x=
"0.0"
y=
"
0.0"
width=
"414"
height=
"124
"
/>
<scrollView
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"scaleToFill"
showsHorizontalScrollIndicator=
"NO"
showsVerticalScrollIndicator=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"bU8-yM-Yme"
>
<rect
key=
"frame"
x=
"0.0"
y=
"
8"
width=
"499"
height=
"116
"
/>
<subviews>
<stackView
opaque=
"NO"
contentMode=
"scaleToFill"
axis=
"vertical"
alignment=
"top"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Arg-Pc-Vth"
>
<rect
key=
"frame"
x=
"90"
y=
"40.5"
width=
"50"
height=
"43.5"
/>
<subviews>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Title"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"dIv-9y-AeI"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"38"
height=
"24"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"20"
/>
<nil
key=
"textColor"
/>
<nil
key=
"highlightedColor"
/>
</label>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Details"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
numberOfLines=
"6"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"J2F-4P-f1j"
>
<rect
key=
"frame"
x=
"0.0"
y=
"24"
width=
"50"
height=
"19.5"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"16"
/>
<nil
key=
"textColor"
/>
<nil
key=
"highlightedColor"
/>
</label>
</subviews>
</stackView>
<stackView
opaque=
"NO"
contentMode=
"scaleToFill"
axis=
"vertical"
spacing=
"5"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"5uy-us-Ehr"
>
<rect
key=
"frame"
x=
"20"
y=
"28.5"
width=
"49.5"
height=
"67.5"
/>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"C7N-NJ-YuH"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"499"
height=
"116"
/>
<subviews>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"25"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"rt6-8B-njG"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"49.5"
height=
"42"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
weight=
"heavy"
pointSize=
"35"
/>
<nil
key=
"textColor"
/>
<nil
key=
"highlightedColor"
/>
</label>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Month"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"A6k-4E-FiW"
>
<rect
key=
"frame"
x=
"0.0"
y=
"47"
width=
"49.5"
height=
"20.5"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"17"
/>
<nil
key=
"textColor"
/>
<nil
key=
"highlightedColor"
/>
</label>
<stackView
opaque=
"NO"
contentMode=
"scaleToFill"
axis=
"vertical"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"5uy-us-Ehr"
>
<rect
key=
"frame"
x=
"32"
y=
"17"
width=
"49.5"
height=
"62.5"
/>
<subviews>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"25"
textAlignment=
"center"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"rt6-8B-njG"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"49.5"
height=
"42"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
weight=
"heavy"
pointSize=
"35"
/>
<nil
key=
"textColor"
/>
<nil
key=
"highlightedColor"
/>
</label>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Month"
textAlignment=
"center"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"A6k-4E-FiW"
>
<rect
key=
"frame"
x=
"0.0"
y=
"42"
width=
"49.5"
height=
"20.5"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"17"
/>
<nil
key=
"textColor"
/>
<nil
key=
"highlightedColor"
/>
</label>
</subviews>
</stackView>
<stackView
opaque=
"NO"
contentMode=
"scaleToFill"
axis=
"vertical"
distribution=
"fillProportionally"
alignment=
"top"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Arg-Pc-Vth"
>
<rect
key=
"frame"
x=
"91.5"
y=
"0.0"
width=
"407.5"
height=
"116"
/>
<subviews>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Title"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"dIv-9y-AeI"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"33.5"
height=
"59.5"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"17"
/>
<nil
key=
"textColor"
/>
<nil
key=
"highlightedColor"
/>
</label>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Details"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
numberOfLines=
"6"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"J2F-4P-f1j"
>
<rect
key=
"frame"
x=
"0.0"
y=
"59.5"
width=
"50"
height=
"56.5"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"16"
/>
<nil
key=
"textColor"
/>
<nil
key=
"highlightedColor"
/>
</label>
</subviews>
</stackView>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
fixedFrame=
"YES"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
buttonType=
"roundedRect"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"VLe-bj-MvJ"
>
<rect
key=
"frame"
x=
"360"
y=
"-6"
width=
"103"
height=
"108"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<color
key=
"backgroundColor"
red=
"1"
green=
"0.24040085119999999"
blue=
"0.2524891279"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
<state
key=
"normal"
title=
"Delete"
>
<color
key=
"titleColor"
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
</state>
<connections>
<action
selector=
"deleteRow:"
destination=
"D8e-6i-a9c"
eventType=
"touchUpInside"
id=
"eGP-bs-lFf"
/>
</connections>
</button>
</subviews>
</stackView>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<constraints>
<constraint
firstItem=
"Arg-Pc-Vth"
firstAttribute=
"leading"
secondItem=
"5uy-us-Ehr"
secondAttribute=
"trailing"
constant=
"10"
id=
"Dt9-oj-7qE"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"Arg-Pc-Vth"
secondAttribute=
"trailing"
id=
"Mck-4x-NwY"
/>
<constraint
firstItem=
"Arg-Pc-Vth"
firstAttribute=
"top"
secondItem=
"C7N-NJ-YuH"
secondAttribute=
"top"
id=
"SMK-db-fln"
/>
<constraint
firstItem=
"5uy-us-Ehr"
firstAttribute=
"leading"
secondItem=
"C7N-NJ-YuH"
secondAttribute=
"leading"
constant=
"32"
id=
"TQI-Bh-ycO"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"5uy-us-Ehr"
secondAttribute=
"bottom"
constant=
"36.5"
id=
"Zsu-RA-gIe"
/>
<constraint
firstItem=
"5uy-us-Ehr"
firstAttribute=
"top"
secondItem=
"C7N-NJ-YuH"
secondAttribute=
"top"
constant=
"17"
id=
"pHg-od-S6v"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"Arg-Pc-Vth"
secondAttribute=
"bottom"
id=
"wNj-fg-TIG"
/>
</constraints>
</view>
</subviews>
<constraints>
<constraint
first
Item=
"Arg-Pc-Vth"
firstAttribute=
"centerY"
secondItem=
"bU8-yM-Yme"
secondAttribute=
"centerY"
id=
"FLK-Iq-COf
"
/>
<constraint
first
Attribute=
"trailing"
secondItem=
"Arg-Pc-Vth"
secondAttribute=
"trailing"
constant=
"241"
id=
"LFe-8V-jB0
"
/>
<constraint
firstItem=
"
Arg-Pc-Vth"
firstAttribute=
"leading"
secondItem=
"5uy-us-Ehr"
secondAttribute=
"trailing"
constant=
"20.5"
id=
"Vq2-gE-s0
B"
/>
<constraint
first
Item=
"5uy-us-Ehr"
firstAttribute=
"leading"
secondItem=
"bU8-yM-Yme"
secondAttribute=
"leading"
constant=
"20"
id=
"Z0Q-cc-I8E
"
/>
<constraint
firstItem=
"
5uy-us-Ehr"
firstAttribute=
"centerY"
secondItem=
"bU8-yM-Yme"
secondAttribute=
"centerY"
id=
"hJS-Xf-8tM
"
/>
<constraint
first
Attribute=
"bottom"
secondItem=
"5uy-us-Ehr"
secondAttribute=
"bottom"
constant=
"20"
id=
"yNm-7i-4g1
"
/>
<constraint
first
Attribute=
"bottom"
secondItem=
"C7N-NJ-YuH"
secondAttribute=
"bottom"
id=
"90R-LQ-SCc
"
/>
<constraint
first
Item=
"C7N-NJ-YuH"
firstAttribute=
"leading"
secondItem=
"bU8-yM-Yme"
secondAttribute=
"leading"
id=
"Eab-SY-pQV
"
/>
<constraint
firstItem=
"
C7N-NJ-YuH"
firstAttribute=
"top"
secondItem=
"bU8-yM-Yme"
secondAttribute=
"top"
id=
"Mr3-vO-Lv
B"
/>
<constraint
first
Attribute=
"trailing"
secondItem=
"C7N-NJ-YuH"
secondAttribute=
"trailing"
id=
"Oxv-sN-EjK
"
/>
<constraint
firstItem=
"
C7N-NJ-YuH"
firstAttribute=
"trailing"
secondItem=
"50T-ZC-KZu"
secondAttribute=
"trailing"
id=
"VUP-Oz-xXO
"
/>
<constraint
first
Item=
"C7N-NJ-YuH"
firstAttribute=
"bottom"
secondItem=
"50T-ZC-KZu"
secondAttribute=
"bottom"
id=
"uIa-C8-d0Y
"
/>
</constraints>
<viewLayoutGuide
key=
"contentLayoutGuide"
id=
"26x-S3-ikO"
/>
<viewLayoutGuide
key=
"frameLayoutGuide"
id=
"50T-ZC-KZu"
/>
</scrollView>
</subviews>
<constraints>
<constraint
first
Item=
"bU8-yM-Yme"
firstAttribute=
"top"
secondItem=
"aAc-DI-Gps"
secondAttribute=
"top"
id=
"IdU-cZ-AcF
"
/>
<constraint
first
Attribute=
"bottom"
secondItem=
"bU8-yM-Yme"
secondAttribute=
"bottom"
id=
"S9W-33-DmU
"
/>
<constraint
first
Attribute=
"trailing"
secondItem=
"bU8-yM-Yme"
secondAttribute=
"trailing"
id=
"TFa-vg-O66
"
/>
<constraint
first
Item=
"bU8-yM-Yme"
firstAttribute=
"leading"
secondItem=
"aAc-DI-Gps"
secondAttribute=
"leading"
id=
"dMW-Y5-1L0
"
/>
<constraint
first
Attribute=
"leading"
secondItem=
"bU8-yM-Yme"
secondAttribute=
"trailing"
id=
"ElR-zd-A6I
"
/>
<constraint
first
Item=
"bU8-yM-Yme"
firstAttribute=
"leading"
secondItem=
"aAc-DI-Gps"
secondAttribute=
"leading"
id=
"QQw-tp-GAm
"
/>
<constraint
first
Item=
"bU8-yM-Yme"
firstAttribute=
"top"
secondItem=
"aAc-DI-Gps"
secondAttribute=
"top"
id=
"TyR-QX-96O
"
/>
<constraint
first
Attribute=
"bottom"
secondItem=
"bU8-yM-Yme"
secondAttribute=
"bottom"
id=
"xGU-Zw-Qhz
"
/>
</constraints>
</tableViewCellContentView>
<constraints>
<constraint
firstAttribute=
"trailing"
secondItem=
"bU8-yM-Yme"
secondAttribute=
"trailing"
constant=
"1"
id=
"2TT-oW-Udo"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"bU8-yM-Yme"
secondAttribute=
"bottom"
constant=
"-14"
id=
"FM1-nh-Pii"
/>
<constraint
firstItem=
"bU8-yM-Yme"
firstAttribute=
"top"
secondItem=
"D8e-6i-a9c"
secondAttribute=
"top"
constant=
"8"
id=
"h7S-b7-B9X"
/>
<constraint
firstItem=
"bU8-yM-Yme"
firstAttribute=
"leading"
secondItem=
"D8e-6i-a9c"
secondAttribute=
"leading"
id=
"qhI-My-wfT"
/>
</constraints>
<connections>
<outlet
property=
"dayLabel"
destination=
"rt6-8B-njG"
id=
"R9g-fH-iWH"
/>
<outlet
property=
"deleteButton"
destination=
"VLe-bj-MvJ"
id=
"Oxh-mM-u2B"
/>
<outlet
property=
"detailLabel"
destination=
"J2F-4P-f1j"
id=
"sDw-bP-ghK"
/>
<outlet
property=
"monthLabel"
destination=
"A6k-4E-FiW"
id=
"ffX-IQ-uuq"
/>
<outlet
property=
"titleLabel"
destination=
"dIv-9y-AeI"
id=
"jR9-VN-COa"
/>
...
...
@@ -125,13 +158,14 @@
</subviews>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<constraints>
<constraint
firstItem=
"
xjn-bv-SjL"
firstAttribute=
"bottom"
secondItem=
"FJC-EV-fMA"
secondAttribute=
"bottom"
id=
"ExC-6C-Zfl
"
/>
<constraint
firstItem=
"
xjn-bv-SjL"
firstAttribute=
"trailing"
secondItem=
"FJC-EV-fMA"
secondAttribute=
"trailing"
id=
"Jvz-bO-cUa
"
/>
<constraint
firstItem=
"FJC-EV-fMA"
firstAttribute=
"
leading"
secondItem=
"xjn-bv-SjL"
secondAttribute=
"leading"
id=
"gEp-mf-iCe
"
/>
<constraint
firstItem=
"FJC-EV-fMA"
firstAttribute=
"
top"
secondItem=
"xjn-bv-SjL"
secondAttribute=
"top"
id=
"imn-U6-gJo
"
/>
<constraint
firstItem=
"
FJC-EV-fMA"
firstAttribute=
"top"
secondItem=
"xjn-bv-SjL"
secondAttribute=
"top"
id=
"Xok-P4-ZNr
"
/>
<constraint
firstItem=
"
FJC-EV-fMA"
firstAttribute=
"leading"
secondItem=
"xjn-bv-SjL"
secondAttribute=
"leading"
id=
"ai1-l6-nNN
"
/>
<constraint
firstItem=
"FJC-EV-fMA"
firstAttribute=
"
trailing"
secondItem=
"xjn-bv-SjL"
secondAttribute=
"trailing"
id=
"gov-Ey-HOG
"
/>
<constraint
firstItem=
"FJC-EV-fMA"
firstAttribute=
"
bottom"
secondItem=
"xjn-bv-SjL"
secondAttribute=
"bottom"
id=
"ipl-yq-36T
"
/>
</constraints>
<viewLayoutGuide
key=
"safeArea"
id=
"xjn-bv-SjL"
/>
</view>
<size
key=
"freeformSize"
width=
"500"
height=
"896"
/>
<connections>
<outlet
property=
"tableView"
destination=
"FJC-EV-fMA"
id=
"z3n-NG-YzE"
/>
</connections>
...
...
ayudapy/CoreData/CoreDataManager.swift
View file @
6524daa8
...
...
@@ -42,6 +42,15 @@ class CoreDataManager {
print
(
"error al guardar
\(
error
)
"
)
}
}
func
deleteFavorites
(
id
:
Int
,
array
:
[
Entity
]){
let
context
=
container
.
viewContext
for
i
in
0
..<
array
.
count
{
if
array
[
i
]
.
id
==
Int64
(
id
){
context
.
delete
(
array
[
i
])
}
}
}
func
fetchFavorites
()
->
[
Entity
]{
let
fetchRequest
:
NSFetchRequest
<
Entity
>
=
Entity
.
fetchRequest
()
do
{
...
...
ayudapy/CoreData/Favorites.xcdatamodeld/favoriteRequests.xcdatamodel/contents
View file @
6524daa8
...
...
@@ -6,9 +6,10 @@
<attribute
name=
"id"
attributeType=
"Integer 64"
defaultValueString=
"0"
usesScalarValueType=
"YES"
/>
<attribute
name=
"message"
optional=
"YES"
attributeType=
"String"
/>
<attribute
name=
"name"
optional=
"YES"
attributeType=
"String"
/>
<attribute
name=
"phoneNumber"
optional=
"YES"
attributeType=
"String"
/>
<attribute
name=
"title"
optional=
"YES"
attributeType=
"String"
/>
</entity>
<elements>
<element
name=
"Entity"
positionX=
"-54"
positionY=
"-9"
width=
"128"
height=
"1
33
"
/>
<element
name=
"Entity"
positionX=
"-54"
positionY=
"-9"
width=
"128"
height=
"1
48
"
/>
</elements>
</model>
\ No newline at end of file
ayudapy/Entity+CoreDataProperties.swift
View file @
6524daa8
...
...
@@ -22,5 +22,6 @@ extension Entity {
@NSManaged
public
var
date
:
Date
?
@NSManaged
public
var
address
:
String
?
@NSManaged
public
var
title
:
String
?
@NSManaged
public
var
phoneNumber
:
String
?
}
ayudapy/Static/Format.swift
View file @
6524daa8
...
...
@@ -56,7 +56,7 @@ extension String{
returnValue
=
String
(
subStr
)
case
.
hour
:
let
start
=
date
.
index
(
date
.
startIndex
,
offsetBy
:
1
0
)
let
start
=
date
.
index
(
date
.
startIndex
,
offsetBy
:
1
1
)
let
end
=
date
.
index
(
date
.
startIndex
,
offsetBy
:
16
)
let
range
=
start
..<
end
let
subStr
=
date
[
range
]
...
...
ayudapy/ViewControllers/MapViewController.swift
View file @
6524daa8
...
...
@@ -149,7 +149,6 @@ class MapViewController: UIViewController {
marker
.
map
=
self
.
mapView
marker
.
iconView
=
markerView
//marker.icon = markerImage
marker
.
title
=
"
\(
features
[
i
]
.
properties
.
pk
)
"
}
})
...
...
ayudapy/ViewControllers/MyPendingsTableViewCell.swift
View file @
6524daa8
...
...
@@ -10,17 +10,29 @@ import UIKit
class
MyPendingsTableViewCell
:
UITableViewCell
{
var
id
=
Int
()
let
format
=
Format
.
init
()
let
manager
=
CoreDataManager
()
@IBOutlet
weak
var
dayLabel
:
UILabel
!
@IBOutlet
weak
var
monthLabel
:
UILabel
!
@IBOutlet
weak
var
titleLabel
:
UILabel
!
@IBOutlet
weak
var
detailLabel
:
UILabel
!
let
format
=
Format
.
init
()
@IBOutlet
weak
var
deleteButton
:
UIButton
!
@IBAction
func
deleteRow
(
_
sender
:
Any
)
{
let
array
=
manager
.
fetchFavorites
()
print
(
id
)
manager
.
deleteFavorites
(
id
:
id
,
array
:
array
)
}
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
dayLabel
.
textColor
=
format
.
subTitleTextColor
monthLabel
.
textColor
=
format
.
titleTextColor
}
override
func
setSelected
(
_
selected
:
Bool
,
animated
:
Bool
)
{
...
...
ayudapy/ViewControllers/PendingsViewController.swift
View file @
6524daa8
...
...
@@ -9,10 +9,20 @@
import
UIKit
import
CoreData
struct
MyPendings
{
var
id
:
Int
var
title
:
String
?
var
message
:
String
?
var
date
:
String
var
address
:
String
?
var
contactNumber
:
String
?
var
contactName
:
String
?
}
class
PendingsViewController
:
UIViewController
{
let
manager
=
CoreDataManager
()
var
favorites
=
[(
Int64
,
String
,
String
)
]()
var
myPendings
=
[
MyPendings
]()
let
format
=
Format
.
init
()
@IBOutlet
weak
var
tableView
:
UITableView
!
...
...
@@ -20,11 +30,10 @@ class PendingsViewController: UIViewController {
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
let
array
=
manager
.
fetchFavorites
()
for
i
in
0
..<
manager
.
fetchFavorites
()
.
count
{
favorites
.
append
((
Int64
(
array
[
i
]
.
id
),
array
[
i
]
.
message
!
,
"
\(
array
[
i
]
.
date
!
)
"
))
//print(array[i].id, array[i].name!, array[i].date!)
myPendings
.
append
(
MyPendings
(
id
:
Int
(
array
[
i
]
.
id
),
title
:
array
[
i
]
.
title
,
message
:
array
[
i
]
.
message
,
date
:
"
\(
array
[
i
]
.
date
!
)
"
,
address
:
array
[
i
]
.
address
,
contactNumber
:
array
[
i
]
.
name
,
contactName
:
array
[
i
]
.
phoneNumber
))
}
//print(favorites)
}
override
func
viewDidLoad
()
{
...
...
@@ -42,17 +51,35 @@ extension PendingsViewController: UITableViewDelegate, UITableViewDataSource{
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"cell"
,
for
:
indexPath
)
as!
MyPendingsTableViewCell
let
date
=
favorites
[
indexPath
.
row
]
.
2
let
date
=
myPendings
[
indexPath
.
row
]
.
date
let
month
=
date
.
getDatePart
(
dateUnit
:
.
month
)
let
monthString
=
month
.
getMonthShortString
()
let
day
=
date
.
getDatePart
(
dateUnit
:
.
day
)
cell
.
titleLabel
.
text
=
"
\(
favorites
[
indexPath
.
row
]
.
1
)
"
cell
.
detailLabel
.
text
=
"
\(
favorites
[
indexPath
.
row
]
.
2
)
"
var
detailLabel
:
String
=
""
cell
.
titleLabel
.
text
=
myPendings
[
indexPath
.
row
]
.
title
cell
.
titleLabel
.
textColor
=
format
.
subTitleTextColor
cell
.
titleLabel
.
font
=
format
.
subTitleFontStyle
if
let
address
=
myPendings
[
indexPath
.
row
]
.
address
{
detailLabel
=
address
}
if
let
contactName
=
myPendings
[
indexPath
.
row
]
.
contactName
{
detailLabel
=
detailLabel
+
"
\n\(
contactName
)
"
}
if
let
contactNumber
=
myPendings
[
indexPath
.
row
]
.
contactNumber
{
detailLabel
=
detailLabel
+
"
\n\(
contactNumber
)
"
}
cell
.
detailLabel
.
text
=
detailLabel
cell
.
detailLabel
.
font
=
format
.
bodyFontStyle
cell
.
dayLabel
.
text
=
day
cell
.
monthLabel
.
text
=
monthString
let
id
=
myPendings
[
indexPath
.
row
]
.
id
cell
.
id
=
id
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
let
headerLabel
=
UILabel
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
100
,
height
:
50
))
headerLabel
.
text
=
"Mis Pendientes"
...
...
ayudapy/ViewControllers/RequestViewController.swift
View file @
6524daa8
...
...
@@ -24,8 +24,6 @@ class RequestViewController: UIViewController {
var
isFavorite
=
Bool
()
var
checked
=
Bool
()
var
favorites
=
[
Int
]()
// private let appDelegate = UIApplication.shared.delegate as! AppDelegate
// private let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext
private
let
manager
=
CoreDataManager
()
...
...
@@ -52,8 +50,12 @@ class RequestViewController: UIViewController {
}
func
showRequestInformation
(){
let
day
=
date
.
getDatePart
(
dateUnit
:
.
day
)
let
month
=
(
date
.
getDatePart
(
dateUnit
:
.
month
))
.
getMonthInSpanish
()
let
year
=
date
.
getDatePart
(
dateUnit
:
.
year
)
let
hour
=
date
.
getDatePart
(
dateUnit
:
.
hour
)
let
dateLabel
=
UILabel
()
dateLabel
.
text
=
"Publicado el
:
\(
date
)
"
dateLabel
.
text
=
"Publicado el
\(
day
)
de
\(
month
)
de
\(
year
)
a las
\(
hour
)
"
dateLabel
.
font
=
format
.
dateFontStyle
dateLabel
.
textColor
=
format
.
dateTextColor
let
titleLbl
=
UILabel
()
...
...
@@ -81,17 +83,11 @@ class RequestViewController: UIViewController {
addressLabel
.
text
=
"
\(
address
)
"
addressLabel
.
lineBreakMode
=
.
byWordWrapping
addressLabel
.
numberOfLines
=
.
max
// let cityLabel = UILabel()
// cityLabel.text = city
let
howToGetButton
=
UIButton
()
//(frame: CGRect(x: 0, y: 0, width: view.frame.width * 0.9, height: 20))
let
howToGetButton
=
UIButton
()
howToGetButton
.
backgroundColor
=
format
.
subTitleTextColor
howToGetButton
.
layer
.
cornerRadius
=
10
// let howToGetLabel = UILabel()
// howToGetLabel.text = "Como LLegar"
// howToGetLabel.font = format.subTitleFontStyle
// howToGetLabel.textColor = .white
// howToGetLabel.textAlignment = .center
// howToGetButton.addSubview(howToGetLabel)
howToGetButton
.
setTitle
(
"Como llegar"
,
for
:
.
normal
)
howToGetButton
.
titleLabel
?
.
font
=
format
.
subTitleFontStyle
let
contactLabel
=
UILabel
()
...
...
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