Showing
3 changed files
with
32 additions
and
18 deletions
| ... | @@ -64,10 +64,11 @@ import UIKit | ... | @@ -64,10 +64,11 @@ import UIKit |
| 64 | func showConfirmDialog() -> Void { | 64 | func showConfirmDialog() -> Void { |
| 65 | 65 | ||
| 66 | let alert = UIAlertController(title: "Ενεργοποίηση υπηρεσίας", message: "Θέλετε να γίνει ενεργοποίηση στο Κινητό μου;", preferredStyle: .alert) | 66 | let alert = UIAlertController(title: "Ενεργοποίηση υπηρεσίας", message: "Θέλετε να γίνει ενεργοποίηση στο Κινητό μου;", preferredStyle: .alert) |
| 67 | - alert.addAction(UIAlertAction(title: "Ενεργοποίηση", style: .default, handler: { action in | 67 | + |
| 68 | + let cancelButton = UIAlertAction(title: "Άκυρο", style: .default, handler: { action in | ||
| 68 | switch action.style{ | 69 | switch action.style{ |
| 69 | case .default: | 70 | case .default: |
| 70 | - self.submitOrderRequest() | 71 | + print("default") |
| 71 | 72 | ||
| 72 | case .cancel: | 73 | case .cancel: |
| 73 | print("cancel") | 74 | print("cancel") |
| ... | @@ -76,11 +77,14 @@ import UIKit | ... | @@ -76,11 +77,14 @@ import UIKit |
| 76 | print("destructive") | 77 | print("destructive") |
| 77 | 78 | ||
| 78 | } | 79 | } |
| 79 | - })) | 80 | + }) |
| 80 | - alert.addAction(UIAlertAction(title: "Άκυρο", style: .default, handler: { action in | 81 | + cancelButton.setValue(UIColor(rgb: 0xFC5757), forKey: "titleTextColor") |
| 82 | + alert.addAction(cancelButton) | ||
| 83 | + | ||
| 84 | + alert.addAction(UIAlertAction(title: "Ενεργοποίηση", style: .default, handler: { action in | ||
| 81 | switch action.style{ | 85 | switch action.style{ |
| 82 | case .default: | 86 | case .default: |
| 83 | - print("default") | 87 | + self.submitOrderRequest() |
| 84 | 88 | ||
| 85 | case .cancel: | 89 | case .cancel: |
| 86 | print("cancel") | 90 | print("cancel") |
| ... | @@ -90,6 +94,7 @@ import UIKit | ... | @@ -90,6 +94,7 @@ import UIKit |
| 90 | 94 | ||
| 91 | } | 95 | } |
| 92 | })) | 96 | })) |
| 97 | + | ||
| 93 | self.present(alert, animated: true, completion: nil) | 98 | self.present(alert, animated: true, completion: nil) |
| 94 | } | 99 | } |
| 95 | 100 | ... | ... |
| ... | @@ -120,10 +120,11 @@ import UIKit | ... | @@ -120,10 +120,11 @@ import UIKit |
| 120 | func showConfirmDialog() -> Void { | 120 | func showConfirmDialog() -> Void { |
| 121 | 121 | ||
| 122 | let alert = UIAlertController(title: "Ενεργοποίηση υπηρεσίας", message: "Θέλετε να γίνει ενεργοποίηση στο Κινητό μου;", preferredStyle: .alert) | 122 | let alert = UIAlertController(title: "Ενεργοποίηση υπηρεσίας", message: "Θέλετε να γίνει ενεργοποίηση στο Κινητό μου;", preferredStyle: .alert) |
| 123 | - alert.addAction(UIAlertAction(title: "Ενεργοποίηση", style: .default, handler: { action in | 123 | + |
| 124 | + let cancelButton = UIAlertAction(title: "Άκυρο", style: .default, handler: { action in | ||
| 124 | switch action.style{ | 125 | switch action.style{ |
| 125 | case .default: | 126 | case .default: |
| 126 | - self.submitOrderRequest() | 127 | + print("default") |
| 127 | 128 | ||
| 128 | case .cancel: | 129 | case .cancel: |
| 129 | print("cancel") | 130 | print("cancel") |
| ... | @@ -132,11 +133,14 @@ import UIKit | ... | @@ -132,11 +133,14 @@ import UIKit |
| 132 | print("destructive") | 133 | print("destructive") |
| 133 | 134 | ||
| 134 | } | 135 | } |
| 135 | - })) | 136 | + }) |
| 136 | - alert.addAction(UIAlertAction(title: "Άκυρο", style: .default, handler: { action in | 137 | + cancelButton.setValue(UIColor(rgb: 0xFC5757), forKey: "titleTextColor") |
| 138 | + alert.addAction(cancelButton) | ||
| 139 | + | ||
| 140 | + alert.addAction(UIAlertAction(title: "Ενεργοποίηση", style: .default, handler: { action in | ||
| 137 | switch action.style{ | 141 | switch action.style{ |
| 138 | case .default: | 142 | case .default: |
| 139 | - print("default") | 143 | + self.submitOrderRequest() |
| 140 | 144 | ||
| 141 | case .cancel: | 145 | case .cancel: |
| 142 | print("cancel") | 146 | print("cancel") | ... | ... |
| ... | @@ -3047,23 +3047,27 @@ public class swiftApi { | ... | @@ -3047,23 +3047,27 @@ public class swiftApi { |
| 3047 | func rejectSharingDialog(_ controller: UIViewController, _ sharingId: String) -> Void { | 3047 | func rejectSharingDialog(_ controller: UIViewController, _ sharingId: String) -> Void { |
| 3048 | 3048 | ||
| 3049 | let alert = UIAlertController(title: "Είσαι σίγουρος;", message: "Είσαι σίγουρος ότι θέλεις να απορρίψεις το δώρο που μόλις έλαβες;", preferredStyle: .alert) | 3049 | let alert = UIAlertController(title: "Είσαι σίγουρος;", message: "Είσαι σίγουρος ότι θέλεις να απορρίψεις το δώρο που μόλις έλαβες;", preferredStyle: .alert) |
| 3050 | - alert.addAction(UIAlertAction(title: "Απόρριψη", style: .default, handler: { action in | 3050 | + |
| 3051 | + let cancelButton = UIAlertAction(title: "Άκυρο", style: .default, handler: { action in | ||
| 3051 | switch action.style{ | 3052 | switch action.style{ |
| 3052 | case .default: | 3053 | case .default: |
| 3053 | - self.cosmoteRetrieveSharingAsync(sharingId: sharingId, accept: false, retrieveSharingCallback) | 3054 | + print("default") |
| 3054 | - | 3055 | + |
| 3055 | case .cancel: | 3056 | case .cancel: |
| 3056 | print("cancel") | 3057 | print("cancel") |
| 3057 | - | 3058 | + |
| 3058 | case .destructive: | 3059 | case .destructive: |
| 3059 | print("destructive") | 3060 | print("destructive") |
| 3060 | - | 3061 | + |
| 3061 | } | 3062 | } |
| 3062 | - })) | 3063 | + }) |
| 3063 | - alert.addAction(UIAlertAction(title: "Άκυρο", style: .default, handler: { action in | 3064 | + cancelButton.setValue(UIColor(rgb: 0xFC5757), forKey: "titleTextColor") |
| 3065 | + alert.addAction(cancelButton) | ||
| 3066 | + | ||
| 3067 | + alert.addAction(UIAlertAction(title: "Απόρριψη", style: .default, handler: { action in | ||
| 3064 | switch action.style{ | 3068 | switch action.style{ |
| 3065 | case .default: | 3069 | case .default: |
| 3066 | - print("default") | 3070 | + self.cosmoteRetrieveSharingAsync(sharingId: sharingId, accept: false, retrieveSharingCallback) |
| 3067 | 3071 | ||
| 3068 | case .cancel: | 3072 | case .cancel: |
| 3069 | print("cancel") | 3073 | print("cancel") |
| ... | @@ -3073,6 +3077,7 @@ public class swiftApi { | ... | @@ -3073,6 +3077,7 @@ public class swiftApi { |
| 3073 | 3077 | ||
| 3074 | } | 3078 | } |
| 3075 | })) | 3079 | })) |
| 3080 | + | ||
| 3076 | controller.present(alert, animated: true, completion: nil) | 3081 | controller.present(alert, animated: true, completion: nil) |
| 3077 | 3082 | ||
| 3078 | 3083 | ... | ... |
-
Please register or login to post a comment