83 lines
2.6 KiB
Swift
83 lines
2.6 KiB
Swift
//
|
|
// MyListViewAllVC.swift
|
|
// WOKA
|
|
//
|
|
// Created by MacBook Pro on 08/08/24.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
class MyListViewAllVC: UIViewController {
|
|
|
|
@IBOutlet weak var tableView: UITableView!
|
|
|
|
var vm = MyListViewAllVM()
|
|
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
vm.vc = self
|
|
vm.initView()
|
|
// let color1 = #colorLiteral(red: 0, green: 0.4784313725, blue: 0.7529411765, alpha: 1)
|
|
// let color2 = #colorLiteral(red: 0, green: 0.7529411765, blue: 0.7529411765, alpha: 1)
|
|
// self.view.applyGradient(colors: [color1,color2], startPoint: .Point.left.point , endPoint: .Point.right.point)
|
|
|
|
navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
|
|
navigationController?.navigationBar.shadowImage = UIImage()
|
|
}
|
|
|
|
override func viewWillAppear(_ animated: Bool) {
|
|
super.viewWillAppear(animated)
|
|
navigationController?.setNavigationBarHidden(false, animated: animated)
|
|
self.navigationController?.setColor(color: .black)
|
|
}
|
|
|
|
override func viewWillDisappear(_ animated: Bool) {
|
|
super.viewWillDisappear(animated)
|
|
self.navigationController?.setNavigationBarHidden(true, animated: animated)
|
|
}
|
|
|
|
override func viewDidDisappear(_ animated: Bool) {
|
|
super.viewDidDisappear(animated)
|
|
self.navigationController?.navigationBar.removeGradientBackground()
|
|
|
|
// Customize the navigation bar's appearance
|
|
self.navigationController?.setColor(color: .black)
|
|
}
|
|
|
|
}
|
|
|
|
// MARK: - TableView DataSource , Delegates
|
|
|
|
extension MyListViewAllVC : TableViewSRC{
|
|
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
|
switch vm.postType{
|
|
case 1: // webSeries
|
|
return 0
|
|
case 8: //KAraoke
|
|
return vm.favListingData?.singKaraokeData?.count ?? 0
|
|
default:
|
|
return 0
|
|
}
|
|
}
|
|
|
|
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
|
|
return 220
|
|
}
|
|
|
|
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
|
let cell = tableView.dequeueReusableCell(withIdentifier: K.CellIdentifier.Home.myListViewAllCell) as! MyListViewAllCell
|
|
switch vm.postType{
|
|
case 1: // Webseries
|
|
break
|
|
case 8: // Karaoke
|
|
if let karaokeData = vm.favListingData?.singKaraokeData?[indexPath.row] {
|
|
cell.setKaraokeData(data: karaokeData)
|
|
}
|
|
default:
|
|
break
|
|
}
|
|
return cell
|
|
}
|
|
}
|
|
|