Manos Chorianopoulos

Added ShareVC popup back action

...@@ -185,6 +185,26 @@ import SwiftEventBus ...@@ -185,6 +185,26 @@ import SwiftEventBus
185 self.present(alert, animated: true, completion: nil) 185 self.present(alert, animated: true, completion: nil)
186 } 186 }
187 187
188 + func showDialogWithBack(_ alertTitle: String, _ alertSubTitle: String) -> Void {
189 +
190 + let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
191 + alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
192 + switch action.style{
193 + case .default:
194 + self.navigationController?.popViewController(animated: true)
195 + self.dismiss(animated: true, completion: {})
196 +
197 + case .cancel:
198 + print("cancel")
199 +
200 + case .destructive:
201 + print("destructive")
202 +
203 + }
204 + }))
205 + self.present(alert, animated: true, completion: nil)
206 + }
207 +
188 func showSuccessDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void { 208 func showSuccessDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
189 209
190 let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert) 210 let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
...@@ -273,7 +293,7 @@ import SwiftEventBus ...@@ -273,7 +293,7 @@ import SwiftEventBus
273 extension ShareViewController: NumbersPopupDelegate { 293 extension ShareViewController: NumbersPopupDelegate {
274 @objc func numbersPopupTapped(_ sender: Any) { 294 @objc func numbersPopupTapped(_ sender: Any) {
275 if (self.numbersList.count == 0) { 295 if (self.numbersList.count == 0) {
276 - self.showDialog("Κάνε δώρο","Για την αποστολή του δώρου σου χρειάζεται να έχεις κινητό COSMOTE.") 296 + self.showDialogWithBack("Κάνε δώρο","Για την αποστολή του δώρου σου χρειάζεται να έχεις κινητό COSMOTE.")
277 } else { 297 } else {
278 let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self)) 298 let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
279 // self.storyboard? 299 // self.storyboard?
......