Showing
3 changed files
with
22 additions
and
1 deletions
... | @@ -49,7 +49,7 @@ import UIKit | ... | @@ -49,7 +49,7 @@ import UIKit |
49 | 49 | ||
50 | couponImage.load(link: couponSetData?.img_preview ?? "", placeholder: UIImage(), cache: URLCache()) | 50 | couponImage.load(link: couponSetData?.img_preview ?? "", placeholder: UIImage(), cache: URLCache()) |
51 | nameLabel.text = couponSetData?.name ?? "" | 51 | nameLabel.text = couponSetData?.name ?? "" |
52 | - dicountLabel.text = (coupon.discount ?? "") | 52 | + dicountLabel.text = (coupon.discount ?? "") + "€" |
53 | discriptionLabel.text = couponSetData?.short_description ?? "" | 53 | discriptionLabel.text = couponSetData?.short_description ?? "" |
54 | expirationLabel.text = "Ισχύει έως "+(coupon.expiration ?? "") | 54 | expirationLabel.text = "Ισχύει έως "+(coupon.expiration ?? "") |
55 | } | 55 | } | ... | ... |
... | @@ -190,3 +190,19 @@ extension UIView { | ... | @@ -190,3 +190,19 @@ extension UIView { |
190 | self.layer.insertSublayer(gradient, at: 0) | 190 | self.layer.insertSublayer(gradient, at: 0) |
191 | } | 191 | } |
192 | } | 192 | } |
193 | + | ||
194 | +extension UIViewController | ||
195 | +{ | ||
196 | + func setupToHideKeyboardOnTapOnView() | ||
197 | + { | ||
198 | + let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(UIViewController.dismissKeyboard)) | ||
199 | + | ||
200 | + tap.cancelsTouchesInView = false | ||
201 | + view.addGestureRecognizer(tap) | ||
202 | + } | ||
203 | + | ||
204 | + @objc func dismissKeyboard() | ||
205 | + { | ||
206 | + view.endEditing(true) | ||
207 | + } | ||
208 | +} | ... | ... |
... | @@ -1091,6 +1091,7 @@ public class swiftApi { | ... | @@ -1091,6 +1091,7 @@ public class swiftApi { |
1091 | 1091 | ||
1092 | // profile_metadata | 1092 | // profile_metadata |
1093 | public let badge: String? | 1093 | public let badge: String? |
1094 | + public let msisdnList: Array<String>? | ||
1094 | 1095 | ||
1095 | 1096 | ||
1096 | public init() { | 1097 | public init() { |
... | @@ -1131,6 +1132,7 @@ public class swiftApi { | ... | @@ -1131,6 +1132,7 @@ public class swiftApi { |
1131 | 1132 | ||
1132 | // profile_metadata | 1133 | // profile_metadata |
1133 | self.badge = "" | 1134 | self.badge = "" |
1135 | + self.msisdnList = [] | ||
1134 | } | 1136 | } |
1135 | 1137 | ||
1136 | public init(dictionary: [String: Any]) { | 1138 | public init(dictionary: [String: Any]) { |
... | @@ -1180,14 +1182,17 @@ public class swiftApi { | ... | @@ -1180,14 +1182,17 @@ public class swiftApi { |
1180 | profile_metadata_parsed = jsonArray; | 1182 | profile_metadata_parsed = jsonArray; |
1181 | self.profile_metadata = profile_metadata_parsed as? [String: Any]? ?? [String: Any]() | 1183 | self.profile_metadata = profile_metadata_parsed as? [String: Any]? ?? [String: Any]() |
1182 | self.badge = profile_metadata_parsed["badge"] as? String? ?? "" | 1184 | self.badge = profile_metadata_parsed["badge"] as? String? ?? "" |
1185 | + self.msisdnList = profile_metadata_parsed["msisdnList"] as? Array<String>? ?? [] | ||
1183 | } else { | 1186 | } else { |
1184 | self.profile_metadata = [String: Any]() | 1187 | self.profile_metadata = [String: Any]() |
1185 | self.badge = "" | 1188 | self.badge = "" |
1189 | + self.msisdnList = [] | ||
1186 | print("bad json") | 1190 | print("bad json") |
1187 | } | 1191 | } |
1188 | } catch let error as NSError { | 1192 | } catch let error as NSError { |
1189 | self.profile_metadata = [String: Any]() | 1193 | self.profile_metadata = [String: Any]() |
1190 | self.badge = "" | 1194 | self.badge = "" |
1195 | + self.msisdnList = [] | ||
1191 | print(error) | 1196 | print(error) |
1192 | } | 1197 | } |
1193 | 1198 | ... | ... |
-
Please register or login to post a comment