2024-06-13 19:54:44 +05:30
|
|
|
//
|
|
|
|
|
// UserNotificationVC.swift
|
|
|
|
|
// WOKA
|
|
|
|
|
//
|
|
|
|
|
// Created by MacBook Pro on 13/06/24.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
|
|
|
|
|
class UserNotificationVC: UIViewController {
|
|
|
|
|
|
|
|
|
|
@IBOutlet weak var tableView: UITableView!
|
2024-08-05 17:37:06 +05:30
|
|
|
@IBOutlet weak var noDataStack: UIStackView!
|
|
|
|
|
|
|
|
|
|
|
2024-06-13 19:54:44 +05:30
|
|
|
|
2024-08-05 17:37:06 +05:30
|
|
|
var vm = UserNotificationVM()
|
|
|
|
|
|
2024-06-13 19:54:44 +05:30
|
|
|
override func viewDidLoad() {
|
|
|
|
|
super.viewDidLoad()
|
2024-08-05 17:37:06 +05:30
|
|
|
vm.vc = self
|
|
|
|
|
vm.initView()
|
2024-06-13 19:54:44 +05:30
|
|
|
|
|
|
|
|
navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
|
|
|
|
|
navigationController?.navigationBar.shadowImage = UIImage()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override func viewWillAppear(_ animated: Bool) {
|
|
|
|
|
super.viewWillAppear(animated)
|
|
|
|
|
navigationController?.setNavigationBarHidden(false, animated: animated)
|
2024-06-19 20:07:47 +05:30
|
|
|
self.navigationController?.setColor(color: .white)
|
2024-06-13 19:54:44 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override func viewWillDisappear(_ animated: Bool) {
|
|
|
|
|
super.viewWillDisappear(animated)
|
2024-06-19 20:07:47 +05:30
|
|
|
|
|
|
|
|
self.navigationController?.setNavigationBarHidden(true, animated: animated)
|
|
|
|
|
|
|
|
|
|
// Customize the navigation bar's appearance
|
2024-06-13 19:54:44 +05:30
|
|
|
self.navigationController?.setColor(color: .black)
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-05 17:37:06 +05:30
|
|
|
@IBAction func retryBtnTapped(_ sender: UIButton) {
|
2024-06-13 19:54:44 +05:30
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-05 17:37:06 +05:30
|
|
|
|
2024-06-13 19:54:44 +05:30
|
|
|
// MARK: - TableView DataSource , Delegates
|
|
|
|
|
|
|
|
|
|
extension UserNotificationVC : TableViewSRC{
|
|
|
|
|
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
2024-08-05 17:37:06 +05:30
|
|
|
return vm.userNotification.count
|
2024-06-13 19:54:44 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
|
|
|
|
let cell = tableView.dequeueReusableCell(withIdentifier: K.CellIdentifier.Home.userNotificationCell) as! UserNotificationCell
|
2024-08-05 17:37:06 +05:30
|
|
|
let data = vm.userNotification[indexPath.row]
|
2024-06-13 19:54:44 +05:30
|
|
|
cell.setData(data: data)
|
|
|
|
|
return cell
|
|
|
|
|
}
|
2024-08-05 17:37:06 +05:30
|
|
|
|
|
|
|
|
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
|
|
|
|
if let type = vm.userNotification[indexPath.row].postType{
|
|
|
|
|
switch type{
|
|
|
|
|
case 1,2,3,4:
|
|
|
|
|
let sb = UIStoryboard(name: K.StoryBoard.webSeries, bundle: nil)
|
|
|
|
|
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.WebSeries.webSeriesVC) as! WebSeriesVC
|
|
|
|
|
self.navigationController?.pushViewController(vcPush, animated: true)
|
|
|
|
|
case 6:
|
|
|
|
|
let sb = UIStoryboard(name: K.StoryBoard.Games, bundle: nil)
|
|
|
|
|
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Games.gamesListVC) as! GamesListVC
|
|
|
|
|
self.navigationController?.pushViewController(vcPush, animated: true)
|
|
|
|
|
case 7:
|
|
|
|
|
let sb = UIStoryboard(name: K.StoryBoard.audioBooks, bundle: nil)
|
|
|
|
|
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.AudioBooks.audioBookHomeVC) as! AudioBookHomeVC
|
|
|
|
|
self.navigationController?.pushViewController(vcPush, animated: true)
|
|
|
|
|
case 8:
|
|
|
|
|
let sb = UIStoryboard(name: K.StoryBoard.Karaoke, bundle: nil)
|
|
|
|
|
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Karaoke.karaokeListingVC) as! KaraokeListingVC
|
|
|
|
|
self.navigationController?.pushViewController(vcPush, animated: true)
|
|
|
|
|
case 9:
|
|
|
|
|
let sb = UIStoryboard(name: K.StoryBoard.shop, bundle: nil)
|
|
|
|
|
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Shop.shopListingVC) as! ShopListingVC
|
|
|
|
|
self.navigationController?.pushViewController(vcPush, animated: true)
|
|
|
|
|
default:
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-13 19:54:44 +05:30
|
|
|
}
|