Manos Chorianopoulos

refactor MarketLoyaltyAnalysisViewController to show only redemed coupons history

......@@ -7,7 +7,7 @@
<key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
</dict>
......
......@@ -7,7 +7,7 @@
<key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
</dict>
</dict>
......
......@@ -1315,6 +1315,7 @@
</view>
<connections>
<outlet property="contentView" destination="x9j-kU-Q25" id="h6a-qK-bop"/>
<outlet property="contentViewHeight" destination="7Xg-3a-EH0" id="vn0-rT-6Ca"/>
<outlet property="leftButton" destination="FP3-6W-wCc" id="Oq4-zv-dv4"/>
<outlet property="leftLineView" destination="xCo-hd-ld3" id="d06-NR-FqZ"/>
<outlet property="rightButton" destination="YkY-Mb-Lq3" id="7nv-za-4NO"/>
......
......@@ -15,6 +15,7 @@ import SwiftEventBus
@IBOutlet weak var leftLineView: UIView!
@IBOutlet weak var rightLineView: UIView!
@IBOutlet weak var contentView: UIView!
@IBOutlet weak var contentViewHeight: NSLayoutConstraint!
var pageController: UIPageViewController!
var tabSelected = 0
......@@ -31,6 +32,9 @@ import SwiftEventBus
setBackButton()
setNavigationTitle("Ανάλυση")
// TODO: DELETE if tabs needed again
contentViewHeight.constant = 0
// tab
leftButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
leftButton.setTitle("Εξαργυρωμένα", for:.normal)
......@@ -48,18 +52,44 @@ import SwiftEventBus
leftLineView.isHidden = false
rightLineView.isHidden = true
// TODO: UNCOMMENT if tabs needed again
// pages
pageController = UIPageViewController(transitionStyle:.scroll, navigationOrientation:.horizontal)
pageController.dataSource = self;
pageController.delegate = self;
pageController.view.frame = contentView.bounds;
addChild(pageController)
contentView.addSubview(pageController.view)
pageController .didMove(toParent: self)
// pageController = UIPageViewController(transitionStyle:.scroll, navigationOrientation:.horizontal)
// pageController.dataSource = self;
// pageController.delegate = self;
//
// pageController.view.frame = contentView.bounds;
// addChild(pageController)
// contentView.addSubview(pageController.view)
// pageController .didMove(toParent: self)
//
// let analysisVC = self.viewControllerAt(0)
// pageController.setViewControllers([analysisVC!], direction:.forward, animated:false)
// <==
let analysisVC = self.viewControllerAt(0)
pageController.setViewControllers([analysisVC!], direction:.forward, animated:false)
// TODO: DELETE if tabs needed again ==>
// Instantiate the child view controller
let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
let childVC = storyboard.instantiateViewController(withIdentifier:"MarketHistoryViewController") as! SwiftWarplyFramework.MarketHistoryViewController
// Add the child view controller
addChild(childVC)
// Add the child view controller's view to the container
contentView.addSubview(childVC.view)
// Set up constraints for the child view to match the container view
childVC.view.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
childVC.view.topAnchor.constraint(equalTo: contentView.topAnchor),
childVC.view.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),
childVC.view.leadingAnchor.constraint(equalTo: contentView.leadingAnchor),
childVC.view.trailingAnchor.constraint(equalTo: contentView.trailingAnchor),
])
// Notify the child view controller that it has been moved to the parent
childVC.didMove(toParent: self)
// <==
}
public override func viewWillAppear(_ animated: Bool) {
......