Manos Chorianopoulos

add error popup at MarketPassViewController

......@@ -243,6 +243,25 @@ import AVFoundation
spinner.view.removeFromSuperview()
spinner.removeFromParent()
}
func showDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
switch action.style{
case .default:
print("default")
case .cancel:
print("cancel")
case .destructive:
print("destructive")
}
}))
self.present(alert, animated: true, completion: nil)
}
func constructBarcode() -> String? {
// EAN 13 barcode construction
......@@ -287,6 +306,7 @@ import AVFoundation
swiftApi().getMarketPassDetailsAsync(getMarketPassDetailsCallback, failureCallback: {errorCode in
print("========= getMarketPassDetailsRequest ERROR CODE =========", errorCode)
self.hideSpinner()
self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
})
}
......@@ -301,6 +321,7 @@ import AVFoundation
}
}
} else {
self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
}
}
// MARK: - API Functions
......