Manos Chorianopoulos

refactor MarketLoyaltyAnalysisViewController to show only redemed coupons history

...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key> 7 <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
8 <dict> 8 <dict>
9 <key>orderHint</key> 9 <key>orderHint</key>
10 - <integer>0</integer> 10 + <integer>1</integer>
11 </dict> 11 </dict>
12 </dict> 12 </dict>
13 </dict> 13 </dict>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key> 7 <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
8 <dict> 8 <dict>
9 <key>orderHint</key> 9 <key>orderHint</key>
10 - <integer>1</integer> 10 + <integer>0</integer>
11 </dict> 11 </dict>
12 </dict> 12 </dict>
13 </dict> 13 </dict>
......
...@@ -1315,6 +1315,7 @@ ...@@ -1315,6 +1315,7 @@
1315 </view> 1315 </view>
1316 <connections> 1316 <connections>
1317 <outlet property="contentView" destination="x9j-kU-Q25" id="h6a-qK-bop"/> 1317 <outlet property="contentView" destination="x9j-kU-Q25" id="h6a-qK-bop"/>
1318 + <outlet property="contentViewHeight" destination="7Xg-3a-EH0" id="vn0-rT-6Ca"/>
1318 <outlet property="leftButton" destination="FP3-6W-wCc" id="Oq4-zv-dv4"/> 1319 <outlet property="leftButton" destination="FP3-6W-wCc" id="Oq4-zv-dv4"/>
1319 <outlet property="leftLineView" destination="xCo-hd-ld3" id="d06-NR-FqZ"/> 1320 <outlet property="leftLineView" destination="xCo-hd-ld3" id="d06-NR-FqZ"/>
1320 <outlet property="rightButton" destination="YkY-Mb-Lq3" id="7nv-za-4NO"/> 1321 <outlet property="rightButton" destination="YkY-Mb-Lq3" id="7nv-za-4NO"/>
......
...@@ -15,6 +15,7 @@ import SwiftEventBus ...@@ -15,6 +15,7 @@ import SwiftEventBus
15 @IBOutlet weak var leftLineView: UIView! 15 @IBOutlet weak var leftLineView: UIView!
16 @IBOutlet weak var rightLineView: UIView! 16 @IBOutlet weak var rightLineView: UIView!
17 @IBOutlet weak var contentView: UIView! 17 @IBOutlet weak var contentView: UIView!
18 + @IBOutlet weak var contentViewHeight: NSLayoutConstraint!
18 19
19 var pageController: UIPageViewController! 20 var pageController: UIPageViewController!
20 var tabSelected = 0 21 var tabSelected = 0
...@@ -31,6 +32,9 @@ import SwiftEventBus ...@@ -31,6 +32,9 @@ import SwiftEventBus
31 setBackButton() 32 setBackButton()
32 setNavigationTitle("Ανάλυση") 33 setNavigationTitle("Ανάλυση")
33 34
35 + // TODO: DELETE if tabs needed again
36 + contentViewHeight.constant = 0
37 +
34 // tab 38 // tab
35 leftButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15) 39 leftButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
36 leftButton.setTitle("Εξαργυρωμένα", for:.normal) 40 leftButton.setTitle("Εξαργυρωμένα", for:.normal)
...@@ -48,18 +52,44 @@ import SwiftEventBus ...@@ -48,18 +52,44 @@ import SwiftEventBus
48 leftLineView.isHidden = false 52 leftLineView.isHidden = false
49 rightLineView.isHidden = true 53 rightLineView.isHidden = true
50 54
55 + // TODO: UNCOMMENT if tabs needed again
51 // pages 56 // pages
52 - pageController = UIPageViewController(transitionStyle:.scroll, navigationOrientation:.horizontal) 57 +// pageController = UIPageViewController(transitionStyle:.scroll, navigationOrientation:.horizontal)
53 - pageController.dataSource = self; 58 +// pageController.dataSource = self;
54 - pageController.delegate = self; 59 +// pageController.delegate = self;
55 - 60 +//
56 - pageController.view.frame = contentView.bounds; 61 +// pageController.view.frame = contentView.bounds;
57 - addChild(pageController) 62 +// addChild(pageController)
58 - contentView.addSubview(pageController.view) 63 +// contentView.addSubview(pageController.view)
59 - pageController .didMove(toParent: self) 64 +// pageController .didMove(toParent: self)
65 +//
66 +// let analysisVC = self.viewControllerAt(0)
67 +// pageController.setViewControllers([analysisVC!], direction:.forward, animated:false)
68 + // <==
60 69
61 - let analysisVC = self.viewControllerAt(0) 70 + // TODO: DELETE if tabs needed again ==>
62 - pageController.setViewControllers([analysisVC!], direction:.forward, animated:false) 71 + // Instantiate the child view controller
72 + let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
73 + let childVC = storyboard.instantiateViewController(withIdentifier:"MarketHistoryViewController") as! SwiftWarplyFramework.MarketHistoryViewController
74 +
75 + // Add the child view controller
76 + addChild(childVC)
77 +
78 + // Add the child view controller's view to the container
79 + contentView.addSubview(childVC.view)
80 +
81 + // Set up constraints for the child view to match the container view
82 + childVC.view.translatesAutoresizingMaskIntoConstraints = false
83 + NSLayoutConstraint.activate([
84 + childVC.view.topAnchor.constraint(equalTo: contentView.topAnchor),
85 + childVC.view.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),
86 + childVC.view.leadingAnchor.constraint(equalTo: contentView.leadingAnchor),
87 + childVC.view.trailingAnchor.constraint(equalTo: contentView.trailingAnchor),
88 + ])
89 +
90 + // Notify the child view controller that it has been moved to the parent
91 + childVC.didMove(toParent: self)
92 + // <==
63 } 93 }
64 94
65 public override func viewWillAppear(_ animated: Bool) { 95 public override func viewWillAppear(_ animated: Bool) {
......