- Added likes and fav
- Completed audio details
This commit is contained in:
@@ -138,6 +138,10 @@
|
||||
52C8B0712BDA7512003B51D0 /* PassingCloud.json in Resources */ = {isa = PBXBuildFile; fileRef = 52C8B0702BDA7512003B51D0 /* PassingCloud.json */; };
|
||||
52C8B0742BDA7626003B51D0 /* OnBoardVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52C8B0732BDA7626003B51D0 /* OnBoardVC.swift */; };
|
||||
52C8D8D42C2D9F3400CA72A6 /* LikeFavCommonFunc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52C8D8D32C2D9F3400CA72A6 /* LikeFavCommonFunc.swift */; };
|
||||
52C8EC7A2C353653002DC35C /* ContinueAudioListDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52C8EC792C353653002DC35C /* ContinueAudioListDM.swift */; };
|
||||
52C8EC7D2C3536E5002DC35C /* ContinueAudioCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52C8EC7B2C3536E5002DC35C /* ContinueAudioCell.swift */; };
|
||||
52C8EC7E2C3536E5002DC35C /* ContinueAudioCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 52C8EC7C2C3536E5002DC35C /* ContinueAudioCell.xib */; };
|
||||
52C8EC802C358E75002DC35C /* AudioBookDetailsVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52C8EC7F2C358E75002DC35C /* AudioBookDetailsVC.swift */; };
|
||||
52CA28FA2BE119F500708B49 /* UserIntrestVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52CA28F92BE119F500708B49 /* UserIntrestVC.swift */; };
|
||||
52CA28FC2BE11A0400708B49 /* UserIntrestVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52CA28FB2BE11A0400708B49 /* UserIntrestVM.swift */; };
|
||||
52CC38C32BDF812F00B74C3E /* LocalisedElements.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52CC38C22BDF812F00B74C3E /* LocalisedElements.swift */; };
|
||||
@@ -400,6 +404,10 @@
|
||||
52C8B0702BDA7512003B51D0 /* PassingCloud.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = PassingCloud.json; sourceTree = "<group>"; };
|
||||
52C8B0732BDA7626003B51D0 /* OnBoardVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnBoardVC.swift; sourceTree = "<group>"; };
|
||||
52C8D8D32C2D9F3400CA72A6 /* LikeFavCommonFunc.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LikeFavCommonFunc.swift; sourceTree = "<group>"; };
|
||||
52C8EC792C353653002DC35C /* ContinueAudioListDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContinueAudioListDM.swift; sourceTree = "<group>"; };
|
||||
52C8EC7B2C3536E5002DC35C /* ContinueAudioCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContinueAudioCell.swift; sourceTree = "<group>"; };
|
||||
52C8EC7C2C3536E5002DC35C /* ContinueAudioCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ContinueAudioCell.xib; sourceTree = "<group>"; };
|
||||
52C8EC7F2C358E75002DC35C /* AudioBookDetailsVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioBookDetailsVC.swift; sourceTree = "<group>"; };
|
||||
52CA28F92BE119F500708B49 /* UserIntrestVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserIntrestVC.swift; sourceTree = "<group>"; };
|
||||
52CA28FB2BE11A0400708B49 /* UserIntrestVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserIntrestVM.swift; sourceTree = "<group>"; };
|
||||
52CC38C22BDF812F00B74C3E /* LocalisedElements.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalisedElements.swift; sourceTree = "<group>"; };
|
||||
@@ -893,6 +901,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
52BFB5322C33DAD700BAAE15 /* AudioBookHomeVC.swift */,
|
||||
52C8EC7F2C358E75002DC35C /* AudioBookDetailsVC.swift */,
|
||||
);
|
||||
name = Controller;
|
||||
sourceTree = "<group>";
|
||||
@@ -908,6 +917,8 @@
|
||||
52BFB5302C33DAB100BAAE15 /* View */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
52C8EC7B2C3536E5002DC35C /* ContinueAudioCell.swift */,
|
||||
52C8EC7C2C3536E5002DC35C /* ContinueAudioCell.xib */,
|
||||
);
|
||||
name = View;
|
||||
sourceTree = "<group>";
|
||||
@@ -916,6 +927,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
52BFB5342C33DF8A00BAAE15 /* ListenAudioListingDM.swift */,
|
||||
52C8EC792C353653002DC35C /* ContinueAudioListDM.swift */,
|
||||
);
|
||||
name = Model;
|
||||
sourceTree = "<group>";
|
||||
@@ -1477,6 +1489,7 @@
|
||||
523ED2652BDA2BC700CFED02 /* Base in Resources */,
|
||||
52D6A2572C22C1E300145908 /* WebSeriesShowListingCell.xib in Resources */,
|
||||
52BC3BE62C0E0326002FACA6 /* FaqCell.xib in Resources */,
|
||||
52C8EC7E2C3536E5002DC35C /* ContinueAudioCell.xib in Resources */,
|
||||
52C6E01C2BE383C000E22D59 /* YourIntrestCell.xib in Resources */,
|
||||
9C834ED32C1C1F9200B29A9C /* Exo2-SemiBold.ttf in Resources */,
|
||||
9C834ED42C1C1F9200B29A9C /* Exo2-Medium.ttf in Resources */,
|
||||
@@ -1581,6 +1594,7 @@
|
||||
5259545C2BEBB80400191286 /* AvatarDM.swift in Sources */,
|
||||
52C8B06C2BDA6E87003B51D0 /* LocalizedString.swift in Sources */,
|
||||
525953D42BE8B2DF00191286 /* UIApplication.swift in Sources */,
|
||||
52C8EC802C358E75002DC35C /* AudioBookDetailsVC.swift in Sources */,
|
||||
52CC38C32BDF812F00B74C3E /* LocalisedElements.swift in Sources */,
|
||||
5259545E2BEBBA1A00191286 /* LoadingIndicatorImageView.swift in Sources */,
|
||||
52B8D4DC2C04A25E00ED65F3 /* Delegate.swift in Sources */,
|
||||
@@ -1591,6 +1605,7 @@
|
||||
52D6A24C2C21B43300145908 /* WebSeriesCell.swift in Sources */,
|
||||
5242FE5B2C24317A0086A86D /* WebSeriesSeasonVM.swift in Sources */,
|
||||
524C422B2C04781B0016A11C /* ThemeTwoVM.swift in Sources */,
|
||||
52C8EC7A2C353653002DC35C /* ContinueAudioListDM.swift in Sources */,
|
||||
52B8D4DF2C04A25E00ED65F3 /* StatusBar.swift in Sources */,
|
||||
5259541D2BE8D94400191286 /* QueueHelper.swift in Sources */,
|
||||
525954232BE8F00400191286 /* BaseResponseModel.swift in Sources */,
|
||||
@@ -1672,6 +1687,7 @@
|
||||
522D655E2C1ACCF40021E505 /* UserNotificationDM.swift in Sources */,
|
||||
9C1C69FC2C106C240035B2C7 /* ContactSupportVM.swift in Sources */,
|
||||
52A3F6AF2BECC0690000BB0B /* LinkedChildVM.swift in Sources */,
|
||||
52C8EC7D2C3536E5002DC35C /* ContinueAudioCell.swift in Sources */,
|
||||
525954252BE8F01600191286 /* ValueWrapper.swift in Sources */,
|
||||
52A3F6A82BECBF2A0000BB0B /* LinkedChildCell.swift in Sources */,
|
||||
52BC3BEE2C16FBDB002FACA6 /* MoreVC.swift in Sources */,
|
||||
|
||||
79
WOKA/Audio Books/AudioBookDetailsVC.swift
Normal file
79
WOKA/Audio Books/AudioBookDetailsVC.swift
Normal file
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// AudioBookDetailsVC.swift
|
||||
// WOKA
|
||||
//
|
||||
// Created by MacBook Pro on 03/07/24.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class AudioBookDetailsVC : UIViewController{
|
||||
|
||||
@IBOutlet weak var watchingImage: UIImageView!
|
||||
@IBOutlet weak var watchingTitle: UILabel!
|
||||
@IBOutlet weak var watchingDesc: UITextView!
|
||||
|
||||
// Completion block to be executed when the alert is dismissed
|
||||
var onDoneBlock: (() -> Void)?
|
||||
|
||||
var audioData : ListenAudioListingDM.AudioDatum?
|
||||
|
||||
var continueAudioData : ContinueAudioListDM.ResultData?
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
if let audioData{
|
||||
if let url = audioData.thumbnailPath{
|
||||
watchingImage.imageURL(url, color: .white)
|
||||
}
|
||||
|
||||
if AuthFunc.shareInstance.getDefaultLanguage() == .english{
|
||||
if let englishData = audioData.contentMoreDetails?.filter({$0.languageMasterID == 1}).first{
|
||||
watchingTitle.text = englishData.title
|
||||
if let desc = englishData.description?.replacingOccurrences(of: "<br>", with: "").htmlToAttributedString{
|
||||
let sizeText = NSMutableAttributedString(attributedString: desc)
|
||||
sizeText.setFontFace(font: FontCustom.shareInstance.customFont(fontName: .Exo2_Regular, size: 15),color: UIColor.appColor(.TextDarkBlue)!)
|
||||
self.watchingDesc.attributedText = sizeText
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if let hindiData = audioData.contentMoreDetails?.filter({$0.languageMasterID == 2}).first{
|
||||
watchingTitle.text = hindiData.title
|
||||
if let desc = hindiData.description?.replacingOccurrences(of: "<br>", with: "").htmlToAttributedString{
|
||||
let sizeText = NSMutableAttributedString(attributedString: desc)
|
||||
sizeText.setFontFace(font: FontCustom.shareInstance.customFont(fontName: .Exo2_Regular, size: 15),color: UIColor.appColor(.TextDarkBlue)!)
|
||||
self.watchingDesc.attributedText = sizeText
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let continueAudioData{
|
||||
if let url = continueAudioData.thumbnailPath{
|
||||
watchingImage.imageURL(url, color: .white)
|
||||
}
|
||||
|
||||
if AuthFunc.shareInstance.getDefaultLanguage() == .english{
|
||||
if let englishData = continueAudioData.contentMoreDetails?.filter({$0.languageMasterID == 1}).first{
|
||||
watchingTitle.text = englishData.title
|
||||
}
|
||||
}else{
|
||||
if let hindiData = continueAudioData.contentMoreDetails?.filter({$0.languageMasterID == 2}).first{
|
||||
watchingTitle.text = hindiData.title
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@IBAction func watchBtnTapped(_ sender: LocalisedElementsButton) {
|
||||
|
||||
}
|
||||
|
||||
@IBAction func closeBtnTapped(_ sender: LocalisedElementsButton) {
|
||||
self.dismiss(animated: true) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,8 +30,8 @@ class AudioBookHomeVC: UIViewController {
|
||||
self.title = "AUDIO BOOKS"
|
||||
vm.initView()
|
||||
scrollView.delegate = self
|
||||
let color1 = #colorLiteral(red: 0, green: 0.7529411765, blue: 0.7529411765, alpha: 1)
|
||||
let color2 = #colorLiteral(red: 0, green: 0.4784313725, blue: 0.7529411765, alpha: 1)
|
||||
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.navigationController?.navigationBar.setGradientBackground(colors: [color1, color2], startPoint: .left, endPoint: .right)
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ extension AudioBookHomeVC : TableViewSRC{
|
||||
}
|
||||
|
||||
cell.btnTapped = { [self] (type) -> Void in
|
||||
updateFavLikes(type: type, index: indexPath.row)
|
||||
vm.updateFavLikes(type: type, index: indexPath.row, id: vm.audioListData[indexPath.row].id ?? 0)
|
||||
}
|
||||
|
||||
return cell
|
||||
@@ -140,6 +140,20 @@ extension AudioBookHomeVC : TableViewSRC{
|
||||
}
|
||||
|
||||
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
/*
|
||||
Updated the top header data
|
||||
*/
|
||||
vm.indexToLoad = indexPath.row
|
||||
vm.setInitialData()
|
||||
|
||||
let data = vm.audioListData[indexPath.row]
|
||||
|
||||
let sb = UIStoryboard(name: K.StoryBoard.audioBooks, bundle: nil)
|
||||
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.AudioBooks.audioBookDetailsVC) as! AudioBookDetailsVC
|
||||
vcPush.modalPresentationStyle = .overCurrentContext
|
||||
vcPush.modalTransitionStyle = .crossDissolve
|
||||
vcPush.audioData = data
|
||||
self.present(vcPush, animated: true)
|
||||
// if vm.showData.count == 0 {return}
|
||||
// let showData = vm.showData[indexPath.row]
|
||||
//
|
||||
@@ -165,13 +179,25 @@ extension AudioBookHomeVC : CollectionViewSRC{
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: K.CellIdentifier.WebSeries.webSeriesCell, for: indexPath) as! WebSeriesCell
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: K.CellIdentifier.AudioBooks.continueAudioCell, for: indexPath) as! ContinueAudioCell
|
||||
let data = vm.continueWatchingData[indexPath.row]
|
||||
cell.setData(data: data)
|
||||
cell.setAudioData(data: data)
|
||||
|
||||
cell.btnTapped = { [self] (type) -> Void in
|
||||
vm.updateFavLikes(type: type, index: indexPath.row, id: vm.continueWatchingData[indexPath.row].id ?? 0)
|
||||
}
|
||||
return cell
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
||||
let data = vm.continueWatchingData[indexPath.row]
|
||||
|
||||
let sb = UIStoryboard(name: K.StoryBoard.audioBooks, bundle: nil)
|
||||
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.AudioBooks.audioBookDetailsVC) as! AudioBookDetailsVC
|
||||
vcPush.modalPresentationStyle = .overCurrentContext
|
||||
vcPush.modalTransitionStyle = .crossDissolve
|
||||
vcPush.continueAudioData = data
|
||||
self.present(vcPush, animated: true)
|
||||
// let data = vm.continueWatchingData[indexPath.row]
|
||||
//
|
||||
// let sb = UIStoryboard(name: K.StoryBoard.webSeries, bundle: nil)
|
||||
|
||||
@@ -11,7 +11,7 @@ import Alamofire
|
||||
class AudioBookHomeVM{
|
||||
|
||||
weak var vc : AudioBookHomeVC!
|
||||
var continueWatchingData = [ContinueWatchingDM.ResultData]()
|
||||
var continueWatchingData = [ContinueAudioListDM.ResultData]()
|
||||
var audioListData = [ListenAudioListingDM.AudioDatum]()
|
||||
var indexToLoad = 0
|
||||
|
||||
@@ -53,22 +53,22 @@ class AudioBookHomeVM{
|
||||
}
|
||||
|
||||
func setupCell(){
|
||||
vc.continueWatchingCV.register(UINib(nibName: K.CellIdentifier.WebSeries.webSeriesCell, bundle: nil), forCellWithReuseIdentifier: K.CellIdentifier.WebSeries.webSeriesCell)
|
||||
vc.continueWatchingCV.register(UINib(nibName: K.CellIdentifier.AudioBooks.continueAudioCell, bundle: nil), forCellWithReuseIdentifier: K.CellIdentifier.AudioBooks.continueAudioCell)
|
||||
vc.continueWatchingCV.delegate = vc.self
|
||||
vc.continueWatchingCV.dataSource = vc.self
|
||||
|
||||
|
||||
vc.audioListingTableView.register(UINib(nibName: K.CellIdentifier.WebSeries.webSeriesShowListingCell, bundle: nil), forCellReuseIdentifier: K.CellIdentifier.WebSeries.webSeriesShowListingCell)
|
||||
vc.audioListingTableView.delegate = vc.self
|
||||
vc.audioListingTableView.dataSource = vc.self
|
||||
}
|
||||
|
||||
// MARK: - Api Calls
|
||||
|
||||
|
||||
func getContinueWatching(){
|
||||
// Utilities.startProgressHUD()
|
||||
// Utilities.startProgressHUD()
|
||||
let headers : HTTPHeaders = ["access-token" : AuthFunc.shareInstance.getAccessToken()]
|
||||
let params : Parameters = ["post_type" : 7] // 3- audio
|
||||
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.WebSeries.continue_watching, method: .post,parameters: params,headers : headers) { [weak self](result : Result<BaseResponseModel<ContinueWatchingDM>, NetworkManager.APIError>) in
|
||||
let params : Parameters = ["post_type" : 7] // 7 - audio
|
||||
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.WebSeries.continue_watching, method: .post,parameters: params,headers : headers) { [weak self](result : Result<BaseResponseModel<ContinueAudioListDM>, NetworkManager.APIError>) in
|
||||
switch result{
|
||||
case .success(let data):
|
||||
guard let self else{
|
||||
@@ -81,7 +81,7 @@ class AudioBookHomeVM{
|
||||
Error
|
||||
*/
|
||||
Utilities.dismissProgressHUD()
|
||||
// vc.toast(msg: data.message ?? "Unrecognised error" , time: 2)
|
||||
// vc.toast(msg: data.message ?? "Unrecognised error" , time: 2)
|
||||
self.vc.continueWatchingStack.isHidden = true
|
||||
case 1:
|
||||
Utilities.dismissProgressHUD()
|
||||
@@ -109,7 +109,7 @@ class AudioBookHomeVM{
|
||||
}
|
||||
|
||||
func getShowListing(){
|
||||
// Utilities.startProgressHUD()
|
||||
// Utilities.startProgressHUD()
|
||||
let headers : HTTPHeaders = ["access-token" : AuthFunc.shareInstance.getAccessToken()]
|
||||
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.AudioBooks.listen_audio_listing, method: .post,headers: headers) { [weak self](result : Result<BaseResponseModel<ListenAudioListingDM>, NetworkManager.APIError>) in
|
||||
switch result{
|
||||
@@ -154,7 +154,90 @@ class AudioBookHomeVM{
|
||||
func stopShimmer(){
|
||||
self.vc.headerView.stopShimmer()
|
||||
vc.listenView.stopShimmer()
|
||||
// self.vc.masilaTrailerView.stopShimmer()
|
||||
// self.vc.videoLanguageView.stopShimmer()
|
||||
// self.vc.masilaTrailerView.stopShimmer()
|
||||
// self.vc.videoLanguageView.stopShimmer()
|
||||
}
|
||||
|
||||
// MARK: - Update Fav Likes
|
||||
|
||||
func updateFavLikes(type : FavCellCLick, index : Int, id : Int){
|
||||
guard let data = audioListData.filter({$0.id == id}).first, let audioListIndex = audioListData.firstIndex(where: {$0.id == id}) else{return}
|
||||
switch type {
|
||||
case .favourite:
|
||||
guard let isFav = data.markAsFavourite ,let postID = data.id,let postType = data.contentMoreDetails?.first?.postType else{return}
|
||||
if isFav == true {
|
||||
LikeFavCommonFunc.shareInstance.removeFavourite(postID: postID, postType: postType, categoryID: 0, vc: self.vc) { [unowned self] isDone in
|
||||
if isDone{
|
||||
audioListData[audioListIndex].markAsFavourite = false
|
||||
vc.audioListingTableView.reloadRows(at: [IndexPath(row: audioListIndex, section: 0)],with: .none)
|
||||
K.GVar.reloadMyList = true
|
||||
|
||||
/*
|
||||
Check if the data is in continue watching
|
||||
*/
|
||||
if let continueWatchingIndex = continueWatchingData.firstIndex(where: { $0.id == id }){
|
||||
continueWatchingData[continueWatchingIndex].markAsFavourite = false
|
||||
vc.continueWatchingCV.reloadItems(at: [IndexPath(row: continueWatchingIndex, section: 0)])
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
LikeFavCommonFunc.shareInstance.addFavourite(postID: postID, postType: postType, categoryID: 0, vc: self.vc) { [unowned self] isDone in
|
||||
if isDone{
|
||||
audioListData[audioListIndex].markAsFavourite = true
|
||||
vc.audioListingTableView.reloadRows(at: [IndexPath(row: audioListIndex, section: 0)],with: .none)
|
||||
K.GVar.reloadMyList = true
|
||||
|
||||
/*
|
||||
Check if the data is in continue watching
|
||||
*/
|
||||
if let continueWatchingIndex = continueWatchingData.firstIndex(where: { $0.id == id }){
|
||||
continueWatchingData[continueWatchingIndex].markAsFavourite = true
|
||||
vc.continueWatchingCV.reloadItems(at: [IndexPath(row: continueWatchingIndex, section: 0)])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
case .liked:
|
||||
guard let isLiked = data.isLiked ,let postID = data.id,let postType = data.contentMoreDetails?.first?.postType else{return}
|
||||
if isLiked{
|
||||
LikeFavCommonFunc.shareInstance.unlikePost(postID: postID, postType: postType, vc: self.vc) { [unowned self] isDone in
|
||||
if isDone{
|
||||
audioListData[audioListIndex].isLiked = false
|
||||
audioListData[audioListIndex].likesCount! -= 1
|
||||
vc.audioListingTableView.reloadRows(at: [IndexPath(row: audioListIndex, section: 0)],with: .none)
|
||||
K.GVar.reloadMyList = true
|
||||
|
||||
/*
|
||||
Check if the data is in continue watching
|
||||
*/
|
||||
if let continueWatchingIndex = continueWatchingData.firstIndex(where: { $0.id == id }){
|
||||
continueWatchingData[continueWatchingIndex].isLiked = false
|
||||
continueWatchingData[continueWatchingIndex].likesCount! -= 1
|
||||
vc.continueWatchingCV.reloadItems(at: [IndexPath(row: continueWatchingIndex, section: 0)])
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
LikeFavCommonFunc.shareInstance.likePost(postID: postID, postType: postType, vc: self.vc){ [unowned self] isDone in
|
||||
if isDone{
|
||||
audioListData[audioListIndex].isLiked = true
|
||||
audioListData[audioListIndex].likesCount! += 1
|
||||
vc.audioListingTableView.reloadRows(at: [IndexPath(row: audioListIndex, section: 0)],with: .none)
|
||||
K.GVar.reloadMyList = true
|
||||
|
||||
/*
|
||||
Check if the data is in continue watching
|
||||
*/
|
||||
if let continueWatchingIndex = continueWatchingData.firstIndex(where: { $0.id == id }){
|
||||
continueWatchingData[continueWatchingIndex].isLiked = true
|
||||
continueWatchingData[continueWatchingIndex].likesCount! += 1
|
||||
vc.continueWatchingCV.reloadItems(at: [IndexPath(row: continueWatchingIndex, section: 0)])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
|
||||
<capability name="Named colors" minToolsVersion="9.0"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<customFonts key="customFonts">
|
||||
@@ -190,5 +192,193 @@
|
||||
</objects>
|
||||
<point key="canvasLocation" x="139" y="-2"/>
|
||||
</scene>
|
||||
<!--Audio Book DetailsVC-->
|
||||
<scene sceneID="rVh-Jp-9gM">
|
||||
<objects>
|
||||
<viewController storyboardIdentifier="AudioBookDetailsVC" id="ICQ-u9-dRh" customClass="AudioBookDetailsVC" customModule="WOKA" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="5Ca-Na-zhv">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view alpha="0.60000002384185791" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Jeb-h3-DAu">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="83Y-DW-IDx">
|
||||
<rect key="frame" x="0.0" y="147.66666666666669" width="393" height="581.66666666666652"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="WebSeriesSeasonsBackground" translatesAutoresizingMaskIntoConstraints="NO" id="ML4-cM-jTe">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="581.66666666666663"/>
|
||||
</imageView>
|
||||
<stackView opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="TPF-xi-nz2">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="566.66666666666663"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ugr-ut-19z">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="50"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Fx3-QP-hRI">
|
||||
<rect key="frame" x="348" y="10" width="40" height="40"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" secondItem="Fx3-QP-hRI" secondAttribute="height" multiplier="1:1" id="lpv-Fh-ldN"/>
|
||||
</constraints>
|
||||
<color key="tintColor" red="0.1058823529" green="0.050980392159999999" blue="0.60392156860000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" image="CloseIconEmpty"/>
|
||||
<connections>
|
||||
<action selector="closeBtnTapped:" destination="ICQ-u9-dRh" eventType="touchUpInside" id="mmq-Ta-fhz"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="Fx3-QP-hRI" secondAttribute="bottom" id="dvR-CY-X4g"/>
|
||||
<constraint firstItem="Fx3-QP-hRI" firstAttribute="top" secondItem="Ugr-ut-19z" secondAttribute="top" constant="10" id="rvO-f1-ksH"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Fx3-QP-hRI" secondAttribute="trailing" constant="5" id="xLu-iz-4Kx"/>
|
||||
<constraint firstAttribute="height" constant="50" id="zs2-sM-j7I"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="Xu5-dZ-yjI" userLabel="MainStack">
|
||||
<rect key="frame" x="0.0" y="50" width="393" height="516.66666666666663"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1EF-Rl-6ok" customClass="ShadowView" customModule="WOKA" customModuleProvider="target">
|
||||
<rect key="frame" x="13" y="5" width="367" height="200"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="ftG-0h-VUV">
|
||||
<rect key="frame" x="8" y="8" width="351" height="184"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<integer key="value" value="10"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="ftG-0h-VUV" secondAttribute="trailing" constant="8" id="LqS-Lq-d60"/>
|
||||
<constraint firstItem="ftG-0h-VUV" firstAttribute="leading" secondItem="1EF-Rl-6ok" secondAttribute="leading" constant="8" id="OQB-Pb-WNv"/>
|
||||
<constraint firstAttribute="height" constant="200" id="Ozp-8R-LC1"/>
|
||||
<constraint firstAttribute="bottom" secondItem="ftG-0h-VUV" secondAttribute="bottom" constant="8" id="WoK-7Q-Vns"/>
|
||||
<constraint firstItem="ftG-0h-VUV" firstAttribute="top" secondItem="1EF-Rl-6ok" secondAttribute="top" constant="8" id="p73-Ew-lQp"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<integer key="value" value="10"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="DwM-gS-hYv">
|
||||
<rect key="frame" x="13" y="215.00000000000003" width="367" height="21.666666666666657"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="dasdasdas" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wpV-6L-2b1">
|
||||
<rect key="frame" x="0.0" y="0.0" width="367" height="21.666666666666668"/>
|
||||
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
|
||||
<color key="textColor" name="TextDarkBlue"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
</stackView>
|
||||
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="45x-AZ-MpL">
|
||||
<rect key="frame" x="13" y="246.66666666666663" width="367" height="180"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="180" id="h7P-FG-65x"/>
|
||||
</constraints>
|
||||
<string key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.</string>
|
||||
<color key="textColor" systemColor="labelColor"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
|
||||
</textView>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="top" translatesAutoresizingMaskIntoConstraints="NO" id="6CI-TN-uVE">
|
||||
<rect key="frame" x="13" y="436.66666666666674" width="367" height="50"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="tailTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pUm-hG-y9f" customClass="LocalisedElementsButton" customModule="WOKA" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="125" height="50"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.47843137250000001" blue="0.75294117650000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="125" id="rfD-lM-uVx"/>
|
||||
<constraint firstAttribute="height" constant="50" id="s4q-DL-nH4"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
|
||||
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<inset key="titleEdgeInsets" minX="5" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
<inset key="imageEdgeInsets" minX="-10" minY="0.0" maxX="10" maxY="0.0"/>
|
||||
<state key="normal" title="WATCH" image="PlayButtonSmall">
|
||||
<preferredSymbolConfiguration key="preferredSymbolConfiguration" scale="small"/>
|
||||
</state>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<integer key="value" value="25"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="watchBtnTapped:" destination="ICQ-u9-dRh" eventType="touchUpInside" id="DEQ-Yu-mPB"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="50" id="U9c-Kh-sHB"/>
|
||||
</constraints>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<edgeInsets key="layoutMargins" top="5" left="13" bottom="30" right="13"/>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<integer key="value" value="10"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="TPF-xi-nz2" secondAttribute="bottom" constant="15" id="07o-QV-QfS"/>
|
||||
<constraint firstAttribute="trailing" secondItem="ML4-cM-jTe" secondAttribute="trailing" id="6FZ-oG-kNJ"/>
|
||||
<constraint firstAttribute="trailing" secondItem="TPF-xi-nz2" secondAttribute="trailing" id="B11-vx-Syz"/>
|
||||
<constraint firstItem="ML4-cM-jTe" firstAttribute="top" secondItem="83Y-DW-IDx" secondAttribute="top" id="Iyk-5b-c9n"/>
|
||||
<constraint firstItem="TPF-xi-nz2" firstAttribute="top" secondItem="83Y-DW-IDx" secondAttribute="top" id="kTq-fR-zbT"/>
|
||||
<constraint firstItem="ML4-cM-jTe" firstAttribute="leading" secondItem="83Y-DW-IDx" secondAttribute="leading" id="oiy-dT-Hhb"/>
|
||||
<constraint firstItem="TPF-xi-nz2" firstAttribute="leading" secondItem="83Y-DW-IDx" secondAttribute="leading" id="qBD-Xv-1Lr"/>
|
||||
<constraint firstAttribute="bottom" secondItem="ML4-cM-jTe" secondAttribute="bottom" id="uzo-Jb-cUv"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="l4Z-VU-L8e"/>
|
||||
<constraints>
|
||||
<constraint firstItem="l4Z-VU-L8e" firstAttribute="trailing" secondItem="83Y-DW-IDx" secondAttribute="trailing" id="30x-LY-GKF"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Jeb-h3-DAu" secondAttribute="bottom" id="CVV-8I-3aW"/>
|
||||
<constraint firstItem="Jeb-h3-DAu" firstAttribute="top" secondItem="5Ca-Na-zhv" secondAttribute="top" id="Edy-QO-gFr"/>
|
||||
<constraint firstItem="83Y-DW-IDx" firstAttribute="centerY" secondItem="l4Z-VU-L8e" secondAttribute="centerY" id="Ydj-c9-1uX"/>
|
||||
<constraint firstItem="Jeb-h3-DAu" firstAttribute="leading" secondItem="l4Z-VU-L8e" secondAttribute="leading" id="dGA-MI-WrS"/>
|
||||
<constraint firstItem="Jeb-h3-DAu" firstAttribute="trailing" secondItem="l4Z-VU-L8e" secondAttribute="trailing" id="ouQ-Vm-xff"/>
|
||||
<constraint firstItem="83Y-DW-IDx" firstAttribute="leading" secondItem="l4Z-VU-L8e" secondAttribute="leading" id="yXe-aN-HLa"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="watchingDesc" destination="45x-AZ-MpL" id="HFF-fb-klz"/>
|
||||
<outlet property="watchingImage" destination="ftG-0h-VUV" id="vdu-Rx-0sc"/>
|
||||
<outlet property="watchingTitle" destination="wpV-6L-2b1" id="yb9-BK-g6K"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="aoA-IR-3Hc" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="923" y="-2"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="CloseIconEmpty" width="30" height="30"/>
|
||||
<image name="PlayButtonSmall" width="28.333333969116211" height="28.333333969116211"/>
|
||||
<image name="WebSeriesSeasonsBackground" width="142.66667175292969" height="187.33332824707031"/>
|
||||
<namedColor name="TextDarkBlue">
|
||||
<color red="0.10599999874830246" green="0.050999999046325684" blue="0.60399997234344482" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</namedColor>
|
||||
<systemColor name="labelColor">
|
||||
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</systemColor>
|
||||
<systemColor name="systemBackgroundColor">
|
||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</systemColor>
|
||||
</resources>
|
||||
</document>
|
||||
|
||||
80
WOKA/Audio Books/ContinueAudioCell.swift
Normal file
80
WOKA/Audio Books/ContinueAudioCell.swift
Normal file
@@ -0,0 +1,80 @@
|
||||
//
|
||||
// ContinueAudioCell.swift
|
||||
// WOKA
|
||||
//
|
||||
// Created by MacBook Pro on 03/07/24.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class ContinueAudioCell: UICollectionViewCell {
|
||||
|
||||
@IBOutlet weak var audioBookThumbnail: UIImageView!
|
||||
@IBOutlet weak var audioBookTitle: UILabel!
|
||||
@IBOutlet weak var totalLikes: UILabel!
|
||||
@IBOutlet weak var likeBtn: UIButton!
|
||||
@IBOutlet weak var favBtn: UIButton!
|
||||
@IBOutlet weak var shimmerView: ShimmerEffectView!
|
||||
|
||||
typealias btnTappedBlock = ( _ from : FavCellCLick) -> Void // 0 - plus 1 - minus
|
||||
var btnTapped : btnTappedBlock!
|
||||
|
||||
override func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
func showShimmer(){
|
||||
shimmerView.startShimmer()
|
||||
}
|
||||
|
||||
func stopShimmer(){
|
||||
shimmerView.stopShimmer()
|
||||
}
|
||||
|
||||
func setAudioData(data: ContinueAudioListDM.ResultData){
|
||||
//heart.fill , heart , hand.thumbsup.fill , hand.thumbsup
|
||||
if AuthFunc.shareInstance.getDefaultLanguage() == .english{
|
||||
audioBookTitle.text = data.contentMoreDetails?.filter({$0.languageMasterID == 1}).first?.title
|
||||
}else{
|
||||
audioBookTitle.text = data.contentMoreDetails?.filter({$0.languageMasterID == 2}).first?.title
|
||||
}
|
||||
totalLikes.text = data.likesCount?.toString() ?? "0"
|
||||
|
||||
if let url = data.thumbnailPath{
|
||||
audioBookThumbnail.imageURL(url)
|
||||
}
|
||||
|
||||
if let like = data.isLiked{
|
||||
switch like{
|
||||
case true:
|
||||
likeBtn.setImage(UIImage(named: "LikeAdd"), for: .normal)
|
||||
case false:
|
||||
likeBtn.setImage(UIImage(named: "LikeRemove"), for: .normal)
|
||||
}
|
||||
}
|
||||
|
||||
if let favourite = data.markAsFavourite{
|
||||
if favourite == true{
|
||||
favBtn.setImage(UIImage(named: "FavouriteAdd"), for: .normal)
|
||||
}else{
|
||||
favBtn.setImage(UIImage(named: "FavouriteRemove"), for: .normal)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction func btnTapped(_ sender: UIButton) {
|
||||
switch sender{
|
||||
case likeBtn:
|
||||
if btnTapped != nil {
|
||||
btnTapped( .liked)
|
||||
}
|
||||
case favBtn:
|
||||
if btnTapped != nil {
|
||||
btnTapped( .favourite)
|
||||
}
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
147
WOKA/Audio Books/ContinueAudioCell.xib
Normal file
147
WOKA/Audio Books/ContinueAudioCell.xib
Normal file
@@ -0,0 +1,147 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
|
||||
<capability name="Named colors" minToolsVersion="9.0"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<customFonts key="customFonts">
|
||||
<array key="Exo2-Bold.ttf">
|
||||
<string>Exo2-Bold</string>
|
||||
</array>
|
||||
</customFonts>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="ContinueAudioCell" customModule="WOKA" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="245"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="245"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Yg4-v6-bSz" customClass="ShimmerEffectView" customModule="WOKA" customModuleProvider="target">
|
||||
<rect key="frame" x="5" y="5" width="365" height="235"/>
|
||||
<subviews>
|
||||
<stackView opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" axis="vertical" spacing="3" translatesAutoresizingMaskIntoConstraints="NO" id="WyM-Hq-jMX">
|
||||
<rect key="frame" x="0.0" y="0.0" width="365" height="235"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="uLp-jK-t8S">
|
||||
<rect key="frame" x="10" y="64" width="345" height="98.999999999999972"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<integer key="value" value="5"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</imageView>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" distribution="equalSpacing" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="iZA-rX-eSc" userLabel="TitleLikeFav">
|
||||
<rect key="frame" x="10" y="166" width="345" height="35"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tuK-jV-nee">
|
||||
<rect key="frame" x="0.0" y="7.9999999999999982" width="41.666666666666664" height="19.333333333333329"/>
|
||||
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="16"/>
|
||||
<color key="textColor" name="ImageDarkBlue"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" spacing="4" translatesAutoresizingMaskIntoConstraints="NO" id="KgU-Gz-jLc">
|
||||
<rect key="frame" x="264" y="0.0" width="81" height="35"/>
|
||||
<subviews>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ewL-vm-Zuj">
|
||||
<rect key="frame" x="0.0" y="0.0" width="42" height="35"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jbW-4o-QTH">
|
||||
<rect key="frame" x="0.0" y="0.0" width="35" height="35"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" secondItem="jbW-4o-QTH" secondAttribute="height" multiplier="1:1" id="FUC-25-FW3"/>
|
||||
</constraints>
|
||||
<color key="tintColor" name="ImageDarkBlue"/>
|
||||
<inset key="imageEdgeInsets" minX="5" minY="5" maxX="5" maxY="5"/>
|
||||
<state key="normal" image="LikeRemove"/>
|
||||
<connections>
|
||||
<action selector="btnTapped:" destination="gTV-IL-0wX" eventType="touchUpInside" id="doy-sW-YXM"/>
|
||||
</connections>
|
||||
</button>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1TM-ln-NlS">
|
||||
<rect key="frame" x="35" y="0.0" width="7" height="35"/>
|
||||
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="16"/>
|
||||
<color key="textColor" name="ImageDarkBlue"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
</stackView>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qxM-qE-KNp">
|
||||
<rect key="frame" x="46" y="0.0" width="35" height="35"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" secondItem="qxM-qE-KNp" secondAttribute="height" multiplier="1:1" id="W2A-yZ-Fxg"/>
|
||||
</constraints>
|
||||
<color key="tintColor" name="ImageDarkBlue"/>
|
||||
<inset key="imageEdgeInsets" minX="5" minY="5" maxX="5" maxY="5"/>
|
||||
<state key="normal" image="FavouriteRemove">
|
||||
<preferredSymbolConfiguration key="preferredSymbolConfiguration" scale="large"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="btnTapped:" destination="gTV-IL-0wX" eventType="touchUpInside" id="d5h-OI-2Rb"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="35" id="5FE-5M-L5v"/>
|
||||
</constraints>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<edgeInsets key="layoutMargins" top="10" left="10" bottom="5" right="10"/>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="WyM-Hq-jMX" firstAttribute="leading" secondItem="Yg4-v6-bSz" secondAttribute="leading" id="BcY-Ab-es0"/>
|
||||
<constraint firstAttribute="trailing" secondItem="WyM-Hq-jMX" secondAttribute="trailing" id="CoI-sj-b7M"/>
|
||||
<constraint firstItem="WyM-Hq-jMX" firstAttribute="top" secondItem="Yg4-v6-bSz" secondAttribute="top" id="aOO-2M-233"/>
|
||||
<constraint firstAttribute="bottom" secondItem="WyM-Hq-jMX" secondAttribute="bottom" id="daU-Lq-7t8"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<integer key="value" value="5"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
</subviews>
|
||||
</view>
|
||||
<viewLayoutGuide key="safeArea" id="ZTg-uK-7eu"/>
|
||||
<constraints>
|
||||
<constraint firstItem="Yg4-v6-bSz" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="5" id="4wJ-3H-Z18"/>
|
||||
<constraint firstItem="Yg4-v6-bSz" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="5" id="8ie-hf-VTt"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Yg4-v6-bSz" secondAttribute="trailing" constant="5" id="F0T-RB-CDK"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Yg4-v6-bSz" secondAttribute="bottom" constant="5" id="QcW-C4-zTt"/>
|
||||
</constraints>
|
||||
<size key="customSize" width="375" height="214"/>
|
||||
<connections>
|
||||
<outlet property="audioBookThumbnail" destination="uLp-jK-t8S" id="V21-ma-Mzu"/>
|
||||
<outlet property="audioBookTitle" destination="tuK-jV-nee" id="hNZ-Ya-F6I"/>
|
||||
<outlet property="favBtn" destination="qxM-qE-KNp" id="nSs-ax-Kgk"/>
|
||||
<outlet property="likeBtn" destination="jbW-4o-QTH" id="uY2-kT-epc"/>
|
||||
<outlet property="shimmerView" destination="Yg4-v6-bSz" id="tci-bW-u5q"/>
|
||||
<outlet property="totalLikes" destination="1TM-ln-NlS" id="zJb-V7-iCC"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="387.02290076335879" y="77.112676056338032"/>
|
||||
</collectionViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="FavouriteRemove" width="42.666667938232422" height="42.666667938232422"/>
|
||||
<image name="LikeRemove" width="42.666667938232422" height="42.666667938232422"/>
|
||||
<namedColor name="ImageDarkBlue">
|
||||
<color red="0.035000000149011612" green="0.0" blue="0.36500000953674316" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</namedColor>
|
||||
<systemColor name="systemBackgroundColor">
|
||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</systemColor>
|
||||
</resources>
|
||||
</document>
|
||||
92
WOKA/Audio Books/ContinueAudioListDM.swift
Normal file
92
WOKA/Audio Books/ContinueAudioListDM.swift
Normal file
@@ -0,0 +1,92 @@
|
||||
//
|
||||
// File.swift
|
||||
// WOKA
|
||||
//
|
||||
// Created by MacBook Pro on 03/07/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
// MARK: - ContinueAudioListDM
|
||||
struct ContinueAudioListDM: Codable {
|
||||
let result: [ResultData]?
|
||||
let totalRecords: Int?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case result
|
||||
case totalRecords = "total_records"
|
||||
}
|
||||
|
||||
// MARK: - ResultData
|
||||
struct ResultData: Codable {
|
||||
let id: Int?
|
||||
let title, description: String?
|
||||
let thumbnailPath: String?
|
||||
let audioURL: String?
|
||||
let categoryMasterID, ageRangeMasterID, tagsKeyword, releaseDate: String?
|
||||
let languageMasterID: Int?
|
||||
let genderMasterID, audioDuration, mediaID: String?
|
||||
let contentMoreDetails: [ContentMoreDetail]?
|
||||
let userVideoView: [UserVideoView]?
|
||||
let showDataCount: Int?
|
||||
var markAsFavourite, isLiked: Bool?
|
||||
var viewsCount, likesCount, bookmarkCount: Int?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case id, title, description
|
||||
case thumbnailPath = "thumbnail_path"
|
||||
case audioURL = "audio_url"
|
||||
case categoryMasterID = "category_master_id"
|
||||
case ageRangeMasterID = "age_range_master_id"
|
||||
case tagsKeyword = "tags_keyword"
|
||||
case releaseDate = "release_date"
|
||||
case languageMasterID = "language_master_id"
|
||||
case genderMasterID = "gender_master_id"
|
||||
case audioDuration = "audio_duration"
|
||||
case mediaID = "media_id"
|
||||
case contentMoreDetails = "content_more_details"
|
||||
case userVideoView = "user_video_view"
|
||||
case showDataCount = "show_data_count"
|
||||
case markAsFavourite = "mark_as_favourite"
|
||||
case isLiked = "is_liked"
|
||||
case viewsCount = "views_count"
|
||||
case likesCount = "likes_count"
|
||||
case bookmarkCount = "bookmark_count"
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - ContentMoreDetail
|
||||
struct ContentMoreDetail: Codable {
|
||||
let id, contentID, postType, languageMasterID: Int?
|
||||
let title, description: String?
|
||||
let url: String?
|
||||
let tagsKeywords: String?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case id
|
||||
case contentID = "content_id"
|
||||
case postType = "post_type"
|
||||
case languageMasterID = "language_master_id"
|
||||
case title, description, url
|
||||
case tagsKeywords = "tags_keywords"
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - UserVideoView
|
||||
struct UserVideoView: Codable {
|
||||
let id, userID, postID, postType: Int?
|
||||
let totalWatchedDuration, lastWatchedLeft: String?
|
||||
let categoryID: Int?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case id
|
||||
case userID = "user_id"
|
||||
case postID = "post_id"
|
||||
case postType = "post_type"
|
||||
case totalWatchedDuration = "total_watched_duration"
|
||||
case lastWatchedLeft = "last_watched_left"
|
||||
case categoryID = "category_id"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,8 +31,8 @@ struct ListenAudioListingDM: Codable {
|
||||
// let userVideoView: [JSONAny]?
|
||||
let categoryData: [CategoryDatum]?
|
||||
// let ageRangeData, genderData: [JSONAny]?
|
||||
let markAsFavourite, isLiked: Bool?
|
||||
let viewsCount, likesCount, bookmarkCount: Int?
|
||||
var markAsFavourite, isLiked: Bool?
|
||||
var viewsCount, likesCount, bookmarkCount: Int?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case id, title, description
|
||||
|
||||
@@ -44,5 +44,9 @@ extension K{
|
||||
static let seasonCategoryCell = "SeasonCategoryCell"
|
||||
static let webSeriesEpisodeCell = "WebSeriesEpisodeCell"
|
||||
}
|
||||
|
||||
struct AudioBooks{
|
||||
static let continueAudioCell = "ContinueAudioCell"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ extension K{
|
||||
|
||||
struct AudioBooks{
|
||||
static let audioBookHomeVC = "AudioBookHomeVC"
|
||||
static let audioBookDetailsVC = "AudioBookDetailsVC"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -237,6 +237,5 @@ class WebSeriesVM{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user