Manos Chorianopoulos

update ProfileModel

......@@ -49,7 +49,7 @@ import UIKit
couponImage.load(link: couponSetData?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
nameLabel.text = couponSetData?.name ?? ""
dicountLabel.text = (coupon.discount ?? "")
dicountLabel.text = (coupon.discount ?? "") + "€"
discriptionLabel.text = couponSetData?.short_description ?? ""
expirationLabel.text = "Ισχύει έως "+(coupon.expiration ?? "")
}
......
......@@ -190,3 +190,19 @@ extension UIView {
self.layer.insertSublayer(gradient, at: 0)
}
}
extension UIViewController
{
func setupToHideKeyboardOnTapOnView()
{
let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(UIViewController.dismissKeyboard))
tap.cancelsTouchesInView = false
view.addGestureRecognizer(tap)
}
@objc func dismissKeyboard()
{
view.endEditing(true)
}
}
......
......@@ -1091,6 +1091,7 @@ public class swiftApi {
// profile_metadata
public let badge: String?
public let msisdnList: Array<String>?
public init() {
......@@ -1131,6 +1132,7 @@ public class swiftApi {
// profile_metadata
self.badge = ""
self.msisdnList = []
}
public init(dictionary: [String: Any]) {
......@@ -1180,14 +1182,17 @@ public class swiftApi {
profile_metadata_parsed = jsonArray;
self.profile_metadata = profile_metadata_parsed as? [String: Any]? ?? [String: Any]()
self.badge = profile_metadata_parsed["badge"] as? String? ?? ""
self.msisdnList = profile_metadata_parsed["msisdnList"] as? Array<String>? ?? []
} else {
self.profile_metadata = [String: Any]()
self.badge = ""
self.msisdnList = []
print("bad json")
}
} catch let error as NSError {
self.profile_metadata = [String: Any]()
self.badge = ""
self.msisdnList = []
print(error)
}
......