Manos Chorianopoulos

add error popup at MarketPassViewController

...@@ -243,6 +243,25 @@ import AVFoundation ...@@ -243,6 +243,25 @@ import AVFoundation
243 spinner.view.removeFromSuperview() 243 spinner.view.removeFromSuperview()
244 spinner.removeFromParent() 244 spinner.removeFromParent()
245 } 245 }
246 +
247 + func showDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
248 +
249 + let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
250 + alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
251 + switch action.style{
252 + case .default:
253 + print("default")
254 +
255 + case .cancel:
256 + print("cancel")
257 +
258 + case .destructive:
259 + print("destructive")
260 +
261 + }
262 + }))
263 + self.present(alert, animated: true, completion: nil)
264 + }
246 265
247 func constructBarcode() -> String? { 266 func constructBarcode() -> String? {
248 // EAN 13 barcode construction 267 // EAN 13 barcode construction
...@@ -287,6 +306,7 @@ import AVFoundation ...@@ -287,6 +306,7 @@ import AVFoundation
287 swiftApi().getMarketPassDetailsAsync(getMarketPassDetailsCallback, failureCallback: {errorCode in 306 swiftApi().getMarketPassDetailsAsync(getMarketPassDetailsCallback, failureCallback: {errorCode in
288 print("========= getMarketPassDetailsRequest ERROR CODE =========", errorCode) 307 print("========= getMarketPassDetailsRequest ERROR CODE =========", errorCode)
289 self.hideSpinner() 308 self.hideSpinner()
309 + self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
290 }) 310 })
291 } 311 }
292 312
...@@ -301,6 +321,7 @@ import AVFoundation ...@@ -301,6 +321,7 @@ import AVFoundation
301 } 321 }
302 } 322 }
303 } else { 323 } else {
324 + self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
304 } 325 }
305 } 326 }
306 // MARK: - API Functions 327 // MARK: - API Functions
......