From 12e08aa7facc62f763ae9695542d21fe8dc257dc Mon Sep 17 00:00:00 2001 From: BilalKhanWDI Date: Thu, 8 Aug 2024 19:50:19 +0530 Subject: [PATCH] completed mylistviewall added api --- .../Base.lproj/AuthenticationSB.storyboard | 28 ++++----- WOKA/Home/Controller/MyListVC.swift | 10 ++++ WOKA/Home/Controller/MyListViewAllVC.swift | 58 ++++++++++++++++--- WOKA/Home/Home.storyboard | 52 +++++++++++------ WOKA/Home/View/MyListViewAllCell.swift | 1 + WOKA/Home/View/MyListViewAllCell.xib | 2 +- WOKA/Home/ViewModel/MyListViewAllVM.swift | 28 ++++++++- 7 files changed, 136 insertions(+), 43 deletions(-) diff --git a/WOKA/Authentication/Base.lproj/AuthenticationSB.storyboard b/WOKA/Authentication/Base.lproj/AuthenticationSB.storyboard index 7f3f033..f153f91 100644 --- a/WOKA/Authentication/Base.lproj/AuthenticationSB.storyboard +++ b/WOKA/Authentication/Base.lproj/AuthenticationSB.storyboard @@ -1329,17 +1329,17 @@ Sent to Your Parent’s Email - + - + - + - + - - + @@ -1040,7 +1057,7 @@ - + @@ -1055,7 +1072,7 @@ - + @@ -1071,7 +1088,7 @@ - + @@ -1086,7 +1103,7 @@ - + @@ -1102,7 +1119,7 @@ - + @@ -1159,7 +1176,7 @@ - + @@ -1190,7 +1207,7 @@ - + @@ -1348,6 +1365,7 @@ + @@ -1454,10 +1472,10 @@ - + - + diff --git a/WOKA/Home/View/MyListViewAllCell.swift b/WOKA/Home/View/MyListViewAllCell.swift index bf9c02a..3bad436 100644 --- a/WOKA/Home/View/MyListViewAllCell.swift +++ b/WOKA/Home/View/MyListViewAllCell.swift @@ -20,6 +20,7 @@ class MyListViewAllCell: UITableViewCell { override func awakeFromNib() { super.awakeFromNib() + self.backgroundColor = .clear // Initialization code } diff --git a/WOKA/Home/View/MyListViewAllCell.xib b/WOKA/Home/View/MyListViewAllCell.xib index ee9cd22..66aabc5 100644 --- a/WOKA/Home/View/MyListViewAllCell.xib +++ b/WOKA/Home/View/MyListViewAllCell.xib @@ -16,7 +16,7 @@ - + diff --git a/WOKA/Home/ViewModel/MyListViewAllVM.swift b/WOKA/Home/ViewModel/MyListViewAllVM.swift index 1774310..f922ac2 100644 --- a/WOKA/Home/ViewModel/MyListViewAllVM.swift +++ b/WOKA/Home/ViewModel/MyListViewAllVM.swift @@ -11,7 +11,7 @@ import Alamofire class MyListViewAllVM{ weak var vc : MyListViewAllVC! - var moduleType = Int() +// var moduleType = Int() var postType = Int() var pageNo = 0 @@ -19,13 +19,20 @@ class MyListViewAllVM{ var webSeriesHindi = [FavouriteListingDM.ResultData.ShowDatum]() func initView(){ + setupCell() getFavouriteListing() } + func setupCell(){ + vc.tableView.register(UINib(nibName: K.CellIdentifier.Home.myListViewAllCell, bundle: nil), forCellReuseIdentifier: K.CellIdentifier.Home.myListViewAllCell) + vc.tableView.delegate = vc.self + vc.tableView.dataSource = vc.self + } + // MARK: - Get Favourite Listing func getFavouriteListing(){ - + Utilities.startProgressHUD() let headers : HTTPHeaders = ["Accept-Language" : AuthFunc.shareInstance.languageSelected == .english ? "English" : "Hindi", "access-token": AuthFunc.shareInstance.getAccessToken()] @@ -45,7 +52,7 @@ class MyListViewAllVM{ case 1: Utilities.dismissProgressHUD() guard let data = data.data?.result else{return} - + self.favListingData = data if var hindiData = favListingData?.showData{ /* @@ -95,6 +102,8 @@ class MyListViewAllVM{ return modifiedItem } } + self.vc.tableView.reloadData() + default: break } @@ -105,4 +114,17 @@ class MyListViewAllVM{ } } } + + func updateData(){ +// non mandatory (values: 1=series, 2=season, 3=episode, 4=video, 5=paint, 6=game, 7=audio, 8=kareoke video, 9=shop product, 10=parental video, 11=article) + + switch postType{ + case 1: // webSeries + self.vc.title = "WEB SERIES" + case 8: //KAraoke + self.vc.title = "KARAOKE" + default: + break + } + } }