Showing
2 changed files
with
18 additions
and
22 deletions
This diff is collapsed. Click to expand it.
... | @@ -8,6 +8,7 @@ | ... | @@ -8,6 +8,7 @@ |
8 | import UIKit | 8 | import UIKit |
9 | 9 | ||
10 | class PopupInfoViewController: UIViewController { | 10 | class PopupInfoViewController: UIViewController { |
11 | + @IBOutlet weak var containerView: UIView! | ||
11 | @IBOutlet weak var popupView: UIView! | 12 | @IBOutlet weak var popupView: UIView! |
12 | @IBOutlet weak var headerLabel: UILabel! | 13 | @IBOutlet weak var headerLabel: UILabel! |
13 | @IBOutlet weak var headerCloseButton: UIButton! | 14 | @IBOutlet weak var headerCloseButton: UIButton! |
... | @@ -18,29 +19,33 @@ class PopupInfoViewController: UIViewController { | ... | @@ -18,29 +19,33 @@ class PopupInfoViewController: UIViewController { |
18 | super.viewDidLoad() | 19 | super.viewDidLoad() |
19 | 20 | ||
20 | // Add arrow programmatically | 21 | // Add arrow programmatically |
21 | - let arrowSize = CGSize(width: 30, height: 15) // Width and height of the arrow | 22 | + let arrowSize = CGSize(width: 15, height: 7.5) // Width and height of the arrow |
22 | - let arrowView = ArrowView(frame: CGRect(x: (self.view.frame.width - arrowSize.width) / 2, | 23 | + let arrowView = ArrowView(frame: CGRect( |
23 | - y: popupView.frame.minY - arrowSize.height, | 24 | + x: (popupView.frame.width - arrowSize.width - 35), |
24 | - width: arrowSize.width, | 25 | + y: popupView.frame.minY - arrowSize.height, |
25 | - height: arrowSize.height)) | 26 | + width: arrowSize.width, |
27 | + height: arrowSize.height)) | ||
26 | 28 | ||
27 | - self.view.addSubview(arrowView) | 29 | + containerView.addSubview(arrowView) |
28 | - self.view.bringSubviewToFront(popupView) | 30 | +// containerView.bringSubviewToFront(popupView) |
31 | + | ||
32 | + // Add shadow | ||
33 | + containerView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.57).cgColor | ||
34 | + containerView.layer.shadowOffset = CGSize(width: 0.0, height: 3.0) | ||
35 | + containerView.layer.shadowOpacity = 1.0 | ||
36 | + containerView.layer.shadowRadius = 20.0 | ||
37 | + containerView.layer.masksToBounds = false | ||
38 | + containerView.backgroundColor = .clear | ||
29 | 39 | ||
30 | popupView.backgroundColor = UIColor(rgb: 0xE6E6E6) | 40 | popupView.backgroundColor = UIColor(rgb: 0xE6E6E6) |
31 | popupView.layer.cornerRadius = 14 | 41 | popupView.layer.cornerRadius = 14 |
32 | - // Add shadow | ||
33 | - popupView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.57).cgColor | ||
34 | - popupView.layer.shadowOffset = CGSize(width: 0.0, height: 3.0) | ||
35 | - popupView.layer.shadowOpacity = 1.0 | ||
36 | - popupView.layer.shadowRadius = 20.0 | ||
37 | 42 | ||
38 | headerLabel.font = UIFont(name: "BTCosmo-Bold", size: 17) | 43 | headerLabel.font = UIFont(name: "BTCosmo-Bold", size: 17) |
39 | headerLabel.textColor = UIColor(rgb: 0x212121) | 44 | headerLabel.textColor = UIColor(rgb: 0x212121) |
40 | headerLabel.text = "SUPERMARKET DEALS" | 45 | headerLabel.text = "SUPERMARKET DEALS" |
41 | 46 | ||
42 | headerCloseButton.setImage(UIImage(named: "ic_close_3.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal) | 47 | headerCloseButton.setImage(UIImage(named: "ic_close_3.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal) |
43 | - headerCloseButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5) | 48 | + headerCloseButton.imageView?.layer.transform = CATransform3DMakeScale(1.3, 1.3, 1.3) |
44 | 49 | ||
45 | infoLabel.font = UIFont(name: "PeridotPE-Regular", size: 16.0) | 50 | infoLabel.font = UIFont(name: "PeridotPE-Regular", size: 16.0) |
46 | infoLabel.textColor = UIColor(rgb: 0x212121) | 51 | infoLabel.textColor = UIColor(rgb: 0x212121) |
... | @@ -52,15 +57,6 @@ class PopupInfoViewController: UIViewController { | ... | @@ -52,15 +57,6 @@ class PopupInfoViewController: UIViewController { |
52 | submitButton.frame.size.width = submitButton.intrinsicContentSize.width | 57 | submitButton.frame.size.width = submitButton.intrinsicContentSize.width |
53 | } | 58 | } |
54 | 59 | ||
55 | - func adaptivePresentationStyle(for controller: UIPresentationController) -> UIModalPresentationStyle { | ||
56 | - return UIModalPresentationStyle.none | ||
57 | - } | ||
58 | - | ||
59 | - func adaptivePresentationStyle(for controller: UIPresentationController, traitCollection: UITraitCollection) -> UIModalPresentationStyle { | ||
60 | - // return UIModalPresentationStyle.FullScreen | ||
61 | - return UIModalPresentationStyle.none | ||
62 | - } | ||
63 | - | ||
64 | // MARK: - Actions | 60 | // MARK: - Actions |
65 | @IBAction func headerCloseButtonAction(_ sender: Any) { | 61 | @IBAction func headerCloseButtonAction(_ sender: Any) { |
66 | self.dismiss(animated: true, completion: {}) | 62 | self.dismiss(animated: true, completion: {}) | ... | ... |
-
Please register or login to post a comment