Commit 9d76d329 by Julio Hermosa

Se ordena y documenta el código

parent f2c90045
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<!--Request View Controller--> <!--Request View Controller-->
<scene sceneID="MGi-Q6-5W5"> <scene sceneID="MGi-Q6-5W5">
<objects> <objects>
<viewController storyboardIdentifier="pedidosVC" id="efO-tm-e7g" customClass="RequestViewController" customModule="ayudapy" customModuleProvider="target" sceneMemberID="viewController"> <viewController storyboardIdentifier="requestsVC" id="efO-tm-e7g" customClass="RequestViewController" customModule="ayudapy" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="2Bp-lZ-T6S"> <view key="view" contentMode="scaleToFill" id="2Bp-lZ-T6S">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/> <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<!--Pendings View Controller--> <!--Pendings View Controller-->
<scene sceneID="1wO-Og-nyO"> <scene sceneID="1wO-Og-nyO">
<objects> <objects>
<viewController storyboardIdentifier="pendientesVC" id="Ncc-gI-9dq" customClass="PendingsViewController" customModule="ayudapy" customModuleProvider="target" sceneMemberID="viewController"> <viewController storyboardIdentifier="pendingsVC" id="Ncc-gI-9dq" customClass="PendingsViewController" customModule="ayudapy" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="s2s-eb-0xG"> <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="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
......
...@@ -69,6 +69,16 @@ class CoreDataManager { ...@@ -69,6 +69,16 @@ class CoreDataManager {
} }
return [] return []
} }
func checkData(id: Int, entityList: [Entity])->Bool{
let array = entityList
var bool = false
for i in 0..<array.count {
if array[i].id == Int64(id){
bool = true
}
}
return bool
}
// func saveInCheckedList(id: Int, latitude: Double, longitude: Double, completion: @escaping()-> Void){ // func saveInCheckedList(id: Int, latitude: Double, longitude: Double, completion: @escaping()-> Void){
// let context = container.viewContext // let context = container.viewContext
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
<string>1</string> <string>1</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>UIApplicationSceneManifest</key> <key>UIApplicationSceneManifest</key>
<dict> <dict>
<key>UIApplicationSupportsMultipleScenes</key> <key>UIApplicationSupportsMultipleScenes</key>
...@@ -50,11 +52,7 @@ ...@@ -50,11 +52,7 @@
<key>UISupportedInterfaceOrientations</key> <key>UISupportedInterfaceOrientations</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>UISupportedInterfaceOrientations~ipad</key> <key>UISupportedInterfaceOrientations~ipad</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
......
...@@ -129,12 +129,12 @@ extension String{ ...@@ -129,12 +129,12 @@ extension String{
} }
return month return month
} }
func convertURL()->String{ // func convertURL()->String{
var newURL = self // var newURL = self
let subStr:Substring = "_th" // let subStr:Substring = "_th"
//
return newURL // return newURL
} // }
} }
...@@ -54,7 +54,7 @@ class MapViewController: UIViewController { ...@@ -54,7 +54,7 @@ class MapViewController: UIViewController {
infoLabel.font = UIFont.systemFont(ofSize: 8) infoLabel.font = UIFont.systemFont(ofSize: 8)
infoLabel.textColor = format.footerTextColor infoLabel.textColor = format.footerTextColor
infoButton.setImage(UIImage(named: "infoButton"), for: .normal) infoButton.setImage(UIImage(named: "infoButton"), for: .normal)
infoButton.addTarget(self, action: #selector(goToInfo), for: .touchUpInside) infoButton.addTarget(self, action: #selector(goToInfoVC), for: .touchUpInside)
footerView.addSubview(infoLabel) footerView.addSubview(infoLabel)
footerView.addSubview(infoButton) footerView.addSubview(infoButton)
...@@ -83,7 +83,7 @@ class MapViewController: UIViewController { ...@@ -83,7 +83,7 @@ class MapViewController: UIViewController {
pendingLabel.font = UIFont.systemFont(ofSize: 8) pendingLabel.font = UIFont.systemFont(ofSize: 8)
pendingLabel.textAlignment = .center pendingLabel.textAlignment = .center
pendingButton.setImage(UIImage(named: "pendientesButton"), for: .normal) pendingButton.setImage(UIImage(named: "pendientesButton"), for: .normal)
pendingButton.addTarget(self, action: #selector(goToPendientes), for: .touchUpInside) pendingButton.addTarget(self, action: #selector(goToPendingsVC), for: .touchUpInside)
footerView.addSubview(pendingLabel) footerView.addSubview(pendingLabel)
...@@ -114,7 +114,7 @@ class MapViewController: UIViewController { ...@@ -114,7 +114,7 @@ class MapViewController: UIViewController {
let position = CLLocationCoordinate2D(latitude: lat, longitude: long) let position = CLLocationCoordinate2D(latitude: lat, longitude: long)
let markerView = UIView(frame: CGRect(x: 0, y: 0, width: 30, height: 35)) let markerView = UIView(frame: CGRect(x: 0, y: 0, width: 30, height: 35))
let markerButton = UIButton(frame: CGRect(x: 0, y: 0, width: 30, height: 35)) let markerButton = UIButton(frame: CGRect(x: 0, y: 0, width: 30, height: 35))
if self.isFavorite(id: self.id) { if self.manager.checkData(id: self.id, entityList: self.favorites){
markerButton.setImage(UIImage(named: "pinFavGMAPS"), for: .normal) markerButton.setImage(UIImage(named: "pinFavGMAPS"), for: .normal)
} }
else { else {
...@@ -148,28 +148,10 @@ class MapViewController: UIViewController { ...@@ -148,28 +148,10 @@ class MapViewController: UIViewController {
mapView.isHidden = true mapView.isHidden = true
} }
//Verificamos si el marcador corresponde a un favorito
func isFavorite(id: Int)->Bool{
var bool = Bool()
if favorites.count > 0{
for i in 0 ..< favorites.count{
if favorites[i].id == Int64(id) {
bool = true
}
else {
bool = false
}
}
}
else{
bool = false
}
return bool
}
//Mostramos en el mapa los marcadores de los pedidos guardados en mis pendientes y/o marcados como listo //Mostramos en el mapa los marcadores de los pedidos guardados en mis pendientes y/o marcados como listo
func showFavoritesOrCheckedIcons(){ func showFavoritesOrCheckedIcons(){
let named = "pinFavGMAPS" let named = "pinFavGMAPS"
favorites = manager.fetchFavorites()
for i in 0 ..< favorites.count{ for i in 0 ..< favorites.count{
let markerView = UIView(frame: CGRect(x: 0, y: 0, width: 30, height: 35)) let markerView = UIView(frame: CGRect(x: 0, y: 0, width: 30, height: 35))
let markerButton = UIButton(frame: CGRect(x: 0, y: 0, width: 30, height: 35)) let markerButton = UIButton(frame: CGRect(x: 0, y: 0, width: 30, height: 35))
...@@ -184,7 +166,7 @@ class MapViewController: UIViewController { ...@@ -184,7 +166,7 @@ class MapViewController: UIViewController {
} }
//Selectors //Selectors
@objc func goToInfo(){ @objc func goToInfoVC(){
let infoVC = self.storyboard?.instantiateViewController(withIdentifier: "infoVC") as! InfoViewController let infoVC = self.storyboard?.instantiateViewController(withIdentifier: "infoVC") as! InfoViewController
show(infoVC, sender: nil) show(infoVC, sender: nil)
} }
...@@ -193,28 +175,30 @@ class MapViewController: UIViewController { ...@@ -193,28 +175,30 @@ class MapViewController: UIViewController {
UIApplication.shared.open(url as URL) UIApplication.shared.open(url as URL)
} }
} }
@objc func goToPendientes(){ @objc func goToPendingsVC(){
let pendientesVC = self.storyboard?.instantiateViewController(withIdentifier: "pendientesVC") as! PendingsViewController let pendingsVC = self.storyboard?.instantiateViewController(withIdentifier: "pendingsVC") as! PendingsViewController
show(pendientesVC, sender: nil) pendingsVC.currentLatitude = (currentLocation?.coordinate.latitude)!
pendingsVC.currentLongitude = (currentLocation?.coordinate.longitude)!
show(pendingsVC, sender: nil)
} }
@objc func goToRequestViewController(pk: Int){ @objc func goToRequestVC(pk: Int){
let pedidosVC = self.storyboard?.instantiateViewController(withIdentifier: "pedidosVC")as! RequestViewController let requestsVC = self.storyboard?.instantiateViewController(withIdentifier: "requestsVC")as! RequestViewController
pedidosVC.id = id requestsVC.id = id
pedidosVC.currentLatitude = (currentLocation?.coordinate.latitude)! requestsVC.currentLatitude = (currentLocation?.coordinate.latitude)!
pedidosVC.currentLongitude = (currentLocation?.coordinate.longitude)! requestsVC.currentLongitude = (currentLocation?.coordinate.longitude)!
if isFavorite(id: id){ if manager.checkData(id: id, entityList: favorites){
pedidosVC.isFavorite = true requestsVC.isFavorite = true
print("El pedido\(id) es favorito") print("El pedido\(id) es favorito")
} }
pedidosVC.helpRequest() requestsVC.helpRequest()
//show(pedidosVC, sender: nil)
isModalInPresentation = true isModalInPresentation = true
present(pedidosVC, animated: true, completion: nil) present(requestsVC, animated: true, completion: nil)
} }
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(true) super.viewWillAppear(true)
favorites = manager.fetchFavorites() favorites = manager.fetchFavorites()
print("Estos son los favoritos \(favorites)")
helpRequest() helpRequest()
} }
...@@ -271,7 +255,7 @@ extension MapViewController: CLLocationManagerDelegate, GMSMapViewDelegate { ...@@ -271,7 +255,7 @@ extension MapViewController: CLLocationManagerDelegate, GMSMapViewDelegate {
func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool { func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool {
id = Int(marker.title!)! id = Int(marker.title!)!
goToRequestViewController(pk: id) goToRequestVC(pk: id)
return true return true
} }
func mapView(_ mapView: GMSMapView, willMove gesture: Bool) { func mapView(_ mapView: GMSMapView, willMove gesture: Bool) {
......
...@@ -13,20 +13,23 @@ class PendingsViewController: UIViewController { ...@@ -13,20 +13,23 @@ class PendingsViewController: UIViewController {
let manager = CoreDataManager() let manager = CoreDataManager()
var favorites = [Entity]() var favorites = [Entity]()
let format = Format.init() let format = Format.init()
var currentLatitude = Double()
var currentLongitude = Double()
@IBOutlet weak var tableView: UITableView! @IBOutlet weak var tableView: UITableView!
func goToRequestViewController(pk: Int){ func goToRequestViewController(pk: Int){
let pedidosVC = self.storyboard?.instantiateViewController(withIdentifier: "pedidosVC")as! RequestViewController let requestsVC = self.storyboard?.instantiateViewController(withIdentifier: "requestsVC")as! RequestViewController
pedidosVC.id = pk requestsVC.id = pk
requestsVC.currentLatitude = currentLatitude
requestsVC.currentLongitude = currentLongitude
if isFavorite(id: pk){ if isFavorite(id: pk){
pedidosVC.isFavorite = true requestsVC.isFavorite = true
} }
print("ID del pedido: \(pk)") print("ID del pedido: \(pk)")
pedidosVC.helpRequest() requestsVC.helpRequest()
//show(pedidosVC, sender: nil) //show(pedidosVC, sender: nil)
present(pedidosVC, animated: true, completion: nil) present(requestsVC, animated: true, completion: nil)
} }
func isFavorite(id: Int)->Bool{ func isFavorite(id: Int)->Bool{
var bool = Bool() var bool = Bool()
......
...@@ -36,12 +36,12 @@ class RequestViewController: UIViewController { ...@@ -36,12 +36,12 @@ class RequestViewController: UIViewController {
let checkImage = UIImage(named: "iconListoUnchecked") let checkImage = UIImage(named: "iconListoUnchecked")
let checkLabel = UILabel() let checkLabel = UILabel()
//solicitud api segun nro de pedido de ayuda "pk"
func helpRequest(){ func helpRequest(){
let url = "https://ayudapy.org/api/v1/helprequests/" let url = "https://ayudapy.org/api/v1/helprequests/"
HTTPClient.request(endpoint: url + "\(id)", onSuccess: { (response: Request?) in HTTPClient.request(endpoint: url + "\(id)", onSuccess: { (response: Request?) in
if let requestInformation = response{ if let requestInformation = response{
print("Estos son los datos\(requestInformation)") print("Estos son los datos: \(requestInformation)")
self.name = response!.name self.name = response!.name
self.message = response!.message self.message = response!.message
self.hRequestTitle = response!.title self.hRequestTitle = response!.title
...@@ -52,7 +52,6 @@ class RequestViewController: UIViewController { ...@@ -52,7 +52,6 @@ class RequestViewController: UIViewController {
self.imageUrl = response!.picture self.imageUrl = response!.picture
self.longitude = response!.location.coordinates[0] self.longitude = response!.location.coordinates[0]
self.latitude = response!.location.coordinates[1] self.latitude = response!.location.coordinates[1]
self.isFavorite = self.isFavoriteCheck()
self.showRequestInformation() self.showRequestInformation()
} }
else { else {
...@@ -62,7 +61,9 @@ class RequestViewController: UIViewController { ...@@ -62,7 +61,9 @@ class RequestViewController: UIViewController {
}) })
} }
//Muestra la información recibida en pantalla
func showRequestInformation(){ func showRequestInformation(){
//fecha (se convierte el string de la fecha completa a otro con la unidad de tiempo seleccionada
let day = date.getDatePart(dateUnit: .day) let day = date.getDatePart(dateUnit: .day)
let month = (date.getDatePart(dateUnit: .month)).getMonthInSpanish() let month = (date.getDatePart(dateUnit: .month)).getMonthInSpanish()
let year = date.getDatePart(dateUnit: .year) let year = date.getDatePart(dateUnit: .year)
...@@ -71,22 +72,28 @@ class RequestViewController: UIViewController { ...@@ -71,22 +72,28 @@ class RequestViewController: UIViewController {
dateLabel.text = "Publicado el \(day) de \(month) de \(year) a las \(hour)" dateLabel.text = "Publicado el \(day) de \(month) de \(year) a las \(hour)"
dateLabel.font = format.dateFontStyle dateLabel.font = format.dateFontStyle
dateLabel.textColor = format.dateTextColor dateLabel.textColor = format.dateTextColor
//titulo del pedido
let titleLbl = UILabel() let titleLbl = UILabel()
titleLbl.text = "\(hRequestTitle)" titleLbl.text = "\(hRequestTitle)"
titleLbl.font = format.titleFontStyle titleLbl.font = format.titleFontStyle
titleLbl.textColor = format.titleTextColor titleLbl.textColor = format.titleTextColor
//detalle del pedido
let messageLabel = UILabel() let messageLabel = UILabel()
messageLabel.text = "\(message)" messageLabel.text = "\(message)"
messageLabel.font = format.bodyFontStyle messageLabel.font = format.bodyFontStyle
messageLabel.numberOfLines = .max messageLabel.numberOfLines = .max
messageLabel.lineBreakMode = .byWordWrapping messageLabel.lineBreakMode = .byWordWrapping
messageLabel.sizeToFit() messageLabel.sizeToFit()
//Para mostrar la imagen en caso de que el campo no sea nulo
let imageView = UIImageView() let imageView = UIImageView()
if imageUrl != nil { if imageUrl != nil {
imageView.layer.frame = CGRect(x: 0, y: 0, width: 100, height: 100) imageView.layer.frame = CGRect(x: 0, y: 0, width: 100, height: 100)
imageView.kf.indicatorType = .activity imageView.kf.indicatorType = .activity
imageView.kf.setImage(with: URL(string: imageUrl!)) imageView.kf.setImage(with: URL(string: imageUrl!))
} }
//Se agrupan las vistas en la cabecera
let headerStackView = UIStackView(arrangedSubviews: [dateLabel, titleLbl, messageLabel]) let headerStackView = UIStackView(arrangedSubviews: [dateLabel, titleLbl, messageLabel])
headerStackView.axis = .vertical headerStackView.axis = .vertical
headerStackView.spacing = 5 headerStackView.spacing = 5
...@@ -128,17 +135,18 @@ class RequestViewController: UIViewController { ...@@ -128,17 +135,18 @@ class RequestViewController: UIViewController {
contactInformationStackView.axis = .vertical contactInformationStackView.axis = .vertical
contactInformationStackView.spacing = 5 contactInformationStackView.spacing = 5
//Se muestra el botón y la etiqueta de marcar como listo
//checkButton.frame.size = CGSize(width: 80, height: 80)
checkLabel.text = "Marcar como listo" checkLabel.text = "Marcar como listo"
checkLabel.font = format.bodyFontStyle checkLabel.font = format.bodyFontStyle
checkLabel.textAlignment = .center checkLabel.textAlignment = .center
checkButton.setImage(checkImage, for: .normal)
let checkStackView = UIStackView(arrangedSubviews: [checkButton, checkLabel]) let checkStackView = UIStackView(arrangedSubviews: [checkButton, checkLabel])
checkStackView.axis = .vertical checkStackView.axis = .vertical
checkStackView.distribution = .fillEqually checkStackView.distribution = .fillEqually
checkStackView.spacing = 0 checkStackView.spacing = 0
//se muestra el botón y etiqueta para Agregar a pendientes
isFavoriteButton.frame.size = CGSize(width: 80, height: 80) isFavoriteButton.frame.size = CGSize(width: 80, height: 80)
if isFavorite{ if isFavorite{
isFavoriteButton.setImage(UIImage(named: "iconPendientesChecked"), for: .normal) isFavoriteButton.setImage(UIImage(named: "iconPendientesChecked"), for: .normal)
...@@ -149,7 +157,6 @@ class RequestViewController: UIViewController { ...@@ -149,7 +157,6 @@ class RequestViewController: UIViewController {
isFavoriteButton.addTarget(self, action: #selector(addOrRemoveFavorite(sender: )), for: .touchUpInside) isFavoriteButton.addTarget(self, action: #selector(addOrRemoveFavorite(sender: )), for: .touchUpInside)
isFavoriteLabel.text = "Agregar a mis Pendientes" isFavoriteLabel.text = "Agregar a mis Pendientes"
} }
isFavoriteLabel.font = format.bodyFontStyle isFavoriteLabel.font = format.bodyFontStyle
isFavoriteLabel.numberOfLines = 2 isFavoriteLabel.numberOfLines = 2
isFavoriteLabel.textAlignment = .center isFavoriteLabel.textAlignment = .center
...@@ -158,37 +165,20 @@ class RequestViewController: UIViewController { ...@@ -158,37 +165,20 @@ class RequestViewController: UIViewController {
isFavoriteStackView.distribution = .fillEqually isFavoriteStackView.distribution = .fillEqually
isFavoriteStackView.spacing = 0 isFavoriteStackView.spacing = 0
checkButton.setImage(checkImage, for: .normal)
let footerStackView = UIStackView(arrangedSubviews: [isFavoriteStackView, checkStackView]) let footerStackView = UIStackView(arrangedSubviews: [isFavoriteStackView, checkStackView])
footerStackView.axis = .horizontal footerStackView.axis = .horizontal
footerStackView.distribution = .fillEqually footerStackView.distribution = .fillEqually
footerStackView.heightAnchor.constraint(equalToConstant: 100).isActive = true footerStackView.heightAnchor.constraint(equalToConstant: 80).isActive = true
//viewHeightAnchor += Int(isFavoriteStackView.frame.height)
//viewHeightAnchor += 30
//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]) let stackView = UIStackView(arrangedSubviews: [headerStackView, addressStackView, contactInformationStackView, footerStackView])
stackView.axis = .vertical stackView.axis = .vertical
stackView.distribution = .equalSpacing stackView.distribution = .equalSpacing
stackView.spacing = 10 stackView.spacing = 10
stackView.layer.frame = CGRect(x: 20, y: 20, width: view.frame.width * 0.9, height: view.frame.height*0.9) stackView.layer.frame = CGRect(x: 20, y: 20, width: view.frame.width - 20 , height: view.frame.height*0.9)
view.addSubview(stackView) view.addSubview(stackView)
} }
func isFavoriteCheck()->Bool{
var bool = false
for i in 0 ..< favorites.count {
if favorites[i].id == Int64(id) {
bool = true
}
else {
bool = false
}
}
return bool
}
func isReadyCheck()->Bool{ func isReadyCheck()->Bool{
return false return false
...@@ -200,6 +190,7 @@ class RequestViewController: UIViewController { ...@@ -200,6 +190,7 @@ class RequestViewController: UIViewController {
self.isFavorite = false self.isFavorite = false
sender.setImage(UIImage(named: "iconPendientesUnchecked"), for: .normal) sender.setImage(UIImage(named: "iconPendientesUnchecked"), for: .normal)
self.isFavoriteLabel.text = "Agregar a mis Pendientes" self.isFavoriteLabel.text = "Agregar a mis Pendientes"
reloadInputViews()
}else }else
{ {
manager.saveFavorites(id: id, name: name, date: date, address: address, message: message, title: hRequestTitle, phoneNumber: phoneNumber, latitude: latitude, longitude: longitude) { [weak self] in manager.saveFavorites(id: id, name: name, date: date, address: address, message: message, title: hRequestTitle, phoneNumber: phoneNumber, latitude: latitude, longitude: longitude) { [weak self] in
...@@ -209,10 +200,10 @@ class RequestViewController: UIViewController { ...@@ -209,10 +200,10 @@ class RequestViewController: UIViewController {
self.isFavorite = true self.isFavorite = true
sender.setImage(UIImage(named: "iconPendientesChecked"), for: .normal) sender.setImage(UIImage(named: "iconPendientesChecked"), for: .normal)
self.isFavoriteLabel.text = "Quitar de mis Pendientes" self.isFavoriteLabel.text = "Quitar de mis Pendientes"
reloadInputViews()
} }
} }
@objc func openGoogleMapsLink(){ @objc func openGoogleMapsLink(){
//https://www.google.com/maps/dir/-25.2860598,-57.6162619/-25.287641,-57.611509/
if let url = NSURL(string: "https://www.google.com/maps/dir/\(currentLatitude),\(currentLongitude )/\(latitude),\(longitude)"){ if let url = NSURL(string: "https://www.google.com/maps/dir/\(currentLatitude),\(currentLongitude )/\(latitude),\(longitude)"){
UIApplication.shared.open(url as URL) UIApplication.shared.open(url as URL)
} }
...@@ -252,6 +243,11 @@ class RequestViewController: UIViewController { ...@@ -252,6 +243,11 @@ class RequestViewController: UIViewController {
self.present(alert, animated: true) self.present(alert, animated: true)
} }
override func viewWillAppear(_ animated: Bool) {
favorites = manager.fetchFavorites()
isFavorite = manager.checkData(id: id, entityList: favorites)
}
override func viewDidLoad() { override func viewDidLoad() {
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment