- Started ui fr audio books

- Completed audio listing with api and model
This commit is contained in:
2024-07-02 19:51:14 +05:30
parent 5761df292f
commit 16d9a91863
12 changed files with 926 additions and 28 deletions

View File

@@ -111,6 +111,10 @@
52BC3BEE2C16FBDB002FACA6 /* MoreVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52BC3BED2C16FBDB002FACA6 /* MoreVC.swift */; };
52BC3BF02C1701F8002FACA6 /* BlogDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52BC3BEF2C1701F8002FACA6 /* BlogDM.swift */; };
52BC3BF22C170264002FACA6 /* MoreVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52BC3BF12C170264002FACA6 /* MoreVM.swift */; };
52BFB52D2C33DAA500BAAE15 /* AudioBooks.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 52BFB52C2C33DAA500BAAE15 /* AudioBooks.storyboard */; };
52BFB5332C33DAD700BAAE15 /* AudioBookHomeVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52BFB5322C33DAD700BAAE15 /* AudioBookHomeVC.swift */; };
52BFB5352C33DF8A00BAAE15 /* ListenAudioListingDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52BFB5342C33DF8A00BAAE15 /* ListenAudioListingDM.swift */; };
52BFB5372C33E0C500BAAE15 /* AudioBookHomeVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52BFB5362C33E0C500BAAE15 /* AudioBookHomeVM.swift */; };
52C1A4E12C05B69F007BAA50 /* UIApplicationSwitchRoot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52C1A4E02C05B69F007BAA50 /* UIApplicationSwitchRoot.swift */; };
52C1A4E52C05BC86007BAA50 /* MainNavController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52C1A4E42C05BC86007BAA50 /* MainNavController.swift */; };
52C1A4E82C05C95D007BAA50 /* Theme.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 52C1A4E72C05C95D007BAA50 /* Theme.storyboard */; };
@@ -368,6 +372,10 @@
52BC3BED2C16FBDB002FACA6 /* MoreVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoreVC.swift; sourceTree = "<group>"; };
52BC3BEF2C1701F8002FACA6 /* BlogDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlogDM.swift; sourceTree = "<group>"; };
52BC3BF12C170264002FACA6 /* MoreVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoreVM.swift; sourceTree = "<group>"; };
52BFB52C2C33DAA500BAAE15 /* AudioBooks.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = AudioBooks.storyboard; sourceTree = "<group>"; };
52BFB5322C33DAD700BAAE15 /* AudioBookHomeVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioBookHomeVC.swift; sourceTree = "<group>"; };
52BFB5342C33DF8A00BAAE15 /* ListenAudioListingDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListenAudioListingDM.swift; sourceTree = "<group>"; };
52BFB5362C33E0C500BAAE15 /* AudioBookHomeVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioBookHomeVM.swift; sourceTree = "<group>"; };
52C1A4E02C05B69F007BAA50 /* UIApplicationSwitchRoot.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIApplicationSwitchRoot.swift; sourceTree = "<group>"; };
52C1A4E42C05BC86007BAA50 /* MainNavController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainNavController.swift; sourceTree = "<group>"; };
52C1A4E62C05C95D007BAA50 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Theme.storyboard; sourceTree = "<group>"; };
@@ -630,6 +638,7 @@
523ED25C2BDA2BC700CFED02 /* WOKA */ = {
isa = PBXGroup;
children = (
52BFB52B2C33DA9700BAAE15 /* Audio Books */,
52DAC6462C21761700E2F85B /* WebSeries */,
9C834ED92C1C20EC00B29A9C /* WOKA.entitlements */,
523ED26B2BDA2BC900CFED02 /* Info.plist */,
@@ -868,6 +877,49 @@
path = Timer;
sourceTree = "<group>";
};
52BFB52B2C33DA9700BAAE15 /* Audio Books */ = {
isa = PBXGroup;
children = (
52BFB5312C33DAB400BAAE15 /* Model */,
52BFB5302C33DAB100BAAE15 /* View */,
52BFB52F2C33DAAE00BAAE15 /* ViewModel */,
52BFB52E2C33DAA900BAAE15 /* Controller */,
52BFB52C2C33DAA500BAAE15 /* AudioBooks.storyboard */,
);
path = "Audio Books";
sourceTree = "<group>";
};
52BFB52E2C33DAA900BAAE15 /* Controller */ = {
isa = PBXGroup;
children = (
52BFB5322C33DAD700BAAE15 /* AudioBookHomeVC.swift */,
);
name = Controller;
sourceTree = "<group>";
};
52BFB52F2C33DAAE00BAAE15 /* ViewModel */ = {
isa = PBXGroup;
children = (
52BFB5362C33E0C500BAAE15 /* AudioBookHomeVM.swift */,
);
name = ViewModel;
sourceTree = "<group>";
};
52BFB5302C33DAB100BAAE15 /* View */ = {
isa = PBXGroup;
children = (
);
name = View;
sourceTree = "<group>";
};
52BFB5312C33DAB400BAAE15 /* Model */ = {
isa = PBXGroup;
children = (
52BFB5342C33DF8A00BAAE15 /* ListenAudioListingDM.swift */,
);
name = Model;
sourceTree = "<group>";
};
52C1A4DF2C05B670007BAA50 /* Delegate */ = {
isa = PBXGroup;
children = (
@@ -1428,6 +1480,7 @@
52C6E01C2BE383C000E22D59 /* YourIntrestCell.xib in Resources */,
9C834ED32C1C1F9200B29A9C /* Exo2-SemiBold.ttf in Resources */,
9C834ED42C1C1F9200B29A9C /* Exo2-Medium.ttf in Resources */,
52BFB52D2C33DAA500BAAE15 /* AudioBooks.storyboard in Resources */,
9C834ED52C1C1F9200B29A9C /* Exo2-Bold.ttf in Resources */,
9C834ED62C1C1F9200B29A9C /* Exo2-ExtraBold.ttf in Resources */,
9C834ED72C1C1F9200B29A9C /* Exo2-Regular.ttf in Resources */,
@@ -1550,6 +1603,7 @@
522242662BFC74380085C632 /* MyListVC.swift in Sources */,
52DAC64E2C21775300E2F85B /* WebSeriesVC.swift in Sources */,
5259542B2BEA292800191286 /* UserRegPostModel.swift in Sources */,
52BFB5352C33DF8A00BAAE15 /* ListenAudioListingDM.swift in Sources */,
52C8B0572BDA57DB003B51D0 /* Constant.swift in Sources */,
52CCD7B02C1AF0F80078BD65 /* RadioVC.swift in Sources */,
52AECA802C08BCB6004A7579 /* PlayerVC.swift in Sources */,
@@ -1628,10 +1682,12 @@
52C8B0742BDA7626003B51D0 /* OnBoardVC.swift in Sources */,
5219C2C22C086D9C00A1DF4D /* DataTypeConversion.swift in Sources */,
525953CF2BE8B28F00191286 /* Utilities.swift in Sources */,
52BFB5332C33DAD700BAAE15 /* AudioBookHomeVC.swift in Sources */,
52D6A2462C21A29800145908 /* ContinueWatchingDM.swift in Sources */,
9CBCB2A12BE4E50A007D7934 /* TextFieldPassword.swift in Sources */,
52BC3BEC2C16DF9F002FACA6 /* MyOrdersVC.swift in Sources */,
9C56E8482BDBEFAB00E4CA14 /* AssetColor.swift in Sources */,
52BFB5372C33E0C500BAAE15 /* AudioBookHomeVM.swift in Sources */,
9C0A85432BEE3EC90093783D /* NewPasswordVM.swift in Sources */,
522D65662C1ACE9C0021E505 /* UserNotificationCell.swift in Sources */,
524C42332C049D590016A11C /* CustomizableSegmentControl.swift in Sources */,

View File

@@ -0,0 +1,329 @@
//
// AudioBookHomeVC.swift
// WOKA
//
// Created by MacBook Pro on 02/07/24.
//
import UIKit
class AudioBookHomeVC: UIViewController {
var vm = AudioBookHomeVM()
@IBOutlet weak var scrollView: UIScrollView!
@IBOutlet weak var headerHeight: NSLayoutConstraint!
@IBOutlet weak var continueWatchingCV: UICollectionView!
@IBOutlet weak var audioListingTableView: UITableView!
@IBOutlet weak var tableHeight: NSLayoutConstraint!
@IBOutlet weak var topLabel: UILabel!
@IBOutlet weak var headerViewTopConstraint: NSLayoutConstraint!
@IBOutlet weak var continueWatchingStack: UIStackView!
@IBOutlet weak var headerView: ShimmerEffectView!
@IBOutlet weak var headerImage: UIImageView!
@IBOutlet weak var headerTitleLabel: UILabel!
@IBOutlet weak var listenView: ShimmerEffectView!
override func viewDidLoad() {
super.viewDidLoad()
vm.vc = self
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)
self.navigationController?.navigationBar.setGradientBackground(colors: [color1, color2], startPoint: .left, endPoint: .right)
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: .white)
}
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)
}
override func viewDidLayoutSubviews() {
vm.updateTableHeight()
}
}
// MARK: - TableView DataSource , Delegates
extension AudioBookHomeVC : TableViewSRC{
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return vm.audioListData.count == 0 ? 2 : vm.audioListData.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: K.CellIdentifier.WebSeries.webSeriesShowListingCell) as! WebSeriesShowListingCell
if vm.audioListData.count == 0{
cell.showShimmer()
}else{
let data = vm.audioListData[indexPath.row]
cell.setAudioData(data: data)
cell.stopShimmer()
}
cell.btnTapped = { [self] (type) -> Void in
updateFavLikes(type: type, index: indexPath.row)
}
return cell
}
func updateFavLikes(type : FavCellCLick, index : Int){
// let data = vm.audioListData[index]
// switch type {
// case .favourite:
// guard let isFav = data.markAsFavourite ,let postID = data.id,let postType = data.contentMoreDetails?.first?.postType else{return}
// if let categoryIds = data.favouriteCategoryIDS?.rawValue {
// let components = categoryIds.components(separatedBy: ",")
// if isFav == true && (components.first == categoryID.toString() || components.last == categoryID.toString()){
// LikeFavCommonFunc.shareInstance.removeFavourite(postID: postID, postType: postType, categoryID: categoryID, vc: self) { [unowned self] isDone in
// if isDone{
// vm.showData[index].markAsFavourite = false
// vm.showData[index].favouriteCategoryIDS = ValueWrapper.stringValue("")
// showListingTableView.reloadRows(at: [IndexPath(row: index, section: 0)],with: .none)
// K.GVar.reloadMyList = true
// }
// }
// }else{
// LikeFavCommonFunc.shareInstance.addFavourite(postID: postID, postType: postType, categoryID: categoryID, vc: self) { [unowned self] isDone in
// if isDone{
// vm.showData[index].markAsFavourite = true
// vm.showData[index].favouriteCategoryIDS = ValueWrapper.stringValue(categoryID.toString())
// showListingTableView.reloadRows(at: [IndexPath(row: index, section: 0)],with: .none)
// K.GVar.reloadMyList = true
// }
// }
// }
// 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) { [unowned self] isDone in
// if isDone{
// vm.showData[index].isLiked = false
// vm.showData[index].likesCount! -= 1
// showListingTableView.reloadRows(at: [IndexPath(row: index, section: 0)],with: .none)
// }
// }
// }else{
// LikeFavCommonFunc.shareInstance.likePost(postID: postID, postType: postType, vc: self){ [unowned self] isDone in
// if isDone{
// vm.showData[index].isLiked = true
// vm.showData[index].likesCount! += 1
// showListingTableView.reloadRows(at: [IndexPath(row: index, section: 0)],with: .none)
// }
// }
// }
// }
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
// if vm.showData.count == 0 {return}
// let showData = vm.showData[indexPath.row]
//
// let sb = UIStoryboard(name: K.StoryBoard.webSeries, bundle: nil)
// let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.WebSeries.webSeriesSeasonVC) as! WebSeriesSeasonVC
// vcPush.vm.showData = showData
// vcPush.vm.indexSelected = indexPath.row
// vcPush.likeFavDelegate = self
// if let selectedIndex = vm.dropDownModule.indexForSelectedRow{
// let categoryID = vm.categoryListingData[selectedIndex]
// vcPush.vm.categoryID = categoryID.id
// }
// self.navigationController?.pushViewController(vcPush, animated: true)
}
}
// MARK: - CollectionView Delegate and Data Source
extension AudioBookHomeVC : CollectionViewSRC{
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return vm.continueWatchingData.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: K.CellIdentifier.WebSeries.webSeriesCell, for: indexPath) as! WebSeriesCell
let data = vm.continueWatchingData[indexPath.row]
cell.setData(data: data)
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
// let data = vm.continueWatchingData[indexPath.row]
//
// let sb = UIStoryboard(name: K.StoryBoard.webSeries, bundle: nil)
// let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.WebSeries.continueWatchingVC) as! ContinueWatchingVC
// vcPush.modalPresentationStyle = .overCurrentContext
// vcPush.modalTransitionStyle = .crossDissolve
// vcPush.watchData = data
// if let selectedIndex = vm.dropDownModule.indexForSelectedRow{
// let categoryID = vm.categoryListingData[selectedIndex]
// vcPush.categoryID = categoryID.id
// }
// self.present(vcPush, animated: true)
}
}
// MARK: - Collection Flow Layout
extension AudioBookHomeVC : UICollectionViewDelegateFlowLayout{
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
return 5
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
let inset: CGFloat = 10
return UIEdgeInsets(top: 0, left: inset, bottom: 0, right: inset)
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
return 0 // Space between cells
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let widthPerItem = collectionView.frame.width - 30 // Adjust to your desired width
return CGSize(width: widthPerItem, height: 230)
}
}
// MARK: - Animating scrollView
extension AudioBookHomeVC: UIScrollViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
// Get the current vertical offset of the scroll view
let y = scrollView.contentOffset.y
// Define the height range for the header view
let minHeaderHeight: CGFloat = 0.0 // Height at which the header becomes invisible
let maxHeaderHeight: CGFloat = 200.0 // Maximum height when fully visible
// Calculate the new height for the header view based on the scroll position
let newHeaderHeight: CGFloat
if y < 0 {
// When scrolling up beyond the top, ensure the header view is fully expanded
newHeaderHeight = maxHeaderHeight
} else {
// Calculate the new height for the header view, ensuring it doesn't go below the minimum height
newHeaderHeight = max(minHeaderHeight, maxHeaderHeight - y)
}
// Update the header view's height constraint with the new height
headerHeight.constant = newHeaderHeight
// Animate the layout changes to smoothly transition the header height
UIView.animate(withDuration: 0.3) {
self.view.layoutIfNeeded()
}
}
}
class UINavigationBarGradientView: UIView {
enum Point {
case topRight, topLeft
case bottomRight, bottomLeft
case left , right
case custom(point: CGPoint)
var point: CGPoint {
switch self {
case .topRight: return CGPoint(x: 1, y: 0)
case .topLeft: return CGPoint(x: 0, y: 0)
case .bottomRight: return CGPoint(x: 1, y: 1)
case .bottomLeft: return CGPoint(x: 0, y: 1)
case .left : return CGPoint(x: 0, y: 0)
case .right : return CGPoint(x: 0.8, y: 0)
case .custom(let point): return point
}
}
}
private weak var gradientLayer: CAGradientLayer!
convenience init(colors: [UIColor], startPoint: Point = .topLeft,
endPoint: Point = .bottomLeft, locations: [NSNumber] = [0, 1]) {
self.init(frame: .zero)
let gradientLayer = CAGradientLayer()
gradientLayer.frame = frame
layer.addSublayer(gradientLayer)
self.gradientLayer = gradientLayer
set(colors: colors, startPoint: startPoint, endPoint: endPoint, locations: locations)
backgroundColor = .clear
}
func set(colors: [UIColor], startPoint: Point = .topLeft,
endPoint: Point = .bottomLeft, locations: [NSNumber] = [0, 1]) {
gradientLayer.colors = colors.map { $0.cgColor }
gradientLayer.startPoint = startPoint.point
gradientLayer.endPoint = endPoint.point
gradientLayer.locations = locations
}
func setupConstraints() {
guard let parentView = superview else { return }
translatesAutoresizingMaskIntoConstraints = false
topAnchor.constraint(equalTo: parentView.topAnchor).isActive = true
leftAnchor.constraint(equalTo: parentView.leftAnchor).isActive = true
parentView.bottomAnchor.constraint(equalTo: bottomAnchor).isActive = true
parentView.rightAnchor.constraint(equalTo: rightAnchor).isActive = true
}
override func layoutSubviews() {
super.layoutSubviews()
guard let gradientLayer = gradientLayer else { return }
gradientLayer.frame = frame
superview?.addSubview(self)
}
}
extension UINavigationBar {
func setGradientBackground(colors: [UIColor],
startPoint: UINavigationBarGradientView.Point = .topLeft,
endPoint: UINavigationBarGradientView.Point = .bottomLeft,
locations: [NSNumber] = [0, 1]) {
guard let backgroundView = value(forKey: "backgroundView") as? UIView else { return }
guard let gradientView = backgroundView.subviews.first(where: { $0 is UINavigationBarGradientView }) as? UINavigationBarGradientView else {
let gradientView = UINavigationBarGradientView(colors: colors, startPoint: startPoint,
endPoint: endPoint, locations: locations)
backgroundView.addSubview(gradientView)
gradientView.setupConstraints()
return
}
gradientView.set(colors: colors, startPoint: startPoint, endPoint: endPoint, locations: locations)
}
func removeGradientBackground() {
guard let backgroundView = value(forKey: "backgroundView") as? UIView else { return }
if let gradientView = backgroundView.subviews.first(where: { $0 is UINavigationBarGradientView }) {
gradientView.removeFromSuperview()
}
}
}

View File

@@ -0,0 +1,160 @@
//
// AudioBookHomeVM.swift
// WOKA
//
// Created by MacBook Pro on 02/07/24.
//
import Foundation
import Alamofire
class AudioBookHomeVM{
weak var vc : AudioBookHomeVC!
var continueWatchingData = [ContinueWatchingDM.ResultData]()
var audioListData = [ListenAudioListingDM.AudioDatum]()
var indexToLoad = 0
func initView(){
startShimmer()
setupCell()
getContinueWatching()
getShowListing()
}
func startShimmer(){
vc.headerView.startShimmer()
vc.listenView.startShimmer()
}
func updateTableHeight(){
self.vc.tableHeight.constant = self.vc.audioListingTableView.contentSize.height + 100
self.vc.audioListingTableView.layoutIfNeeded()
self.vc.tableHeight.constant = self.vc.audioListingTableView.contentSize.height
}
func setInitialData(){
if indexToLoad > continueWatchingData.count {
return
}
let data = audioListData[indexToLoad]
if let url = data.thumbnailPath{
self.vc.headerImage.imageURL(url, color: .white)
}
if AuthFunc.shareInstance.getDefaultLanguage() == .english{
let englishData = data.contentMoreDetails?.filter({$0.languageMasterID == 1}).first
vc.headerTitleLabel.text = englishData?.title
}else{
let hindiData = data.contentMoreDetails?.filter({$0.languageMasterID == 2}).first
vc.headerTitleLabel.text = hindiData?.title
}
}
func setupCell(){
vc.continueWatchingCV.register(UINib(nibName: K.CellIdentifier.WebSeries.webSeriesCell, bundle: nil), forCellWithReuseIdentifier: K.CellIdentifier.WebSeries.webSeriesCell)
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()
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
switch result{
case .success(let data):
guard let self else{
Utilities.dismissProgressHUD()
return
}
switch data.success{
case 0:
/*
Error
*/
Utilities.dismissProgressHUD()
// vc.toast(msg: data.message ?? "Unrecognised error" , time: 2)
self.vc.continueWatchingStack.isHidden = true
case 1:
Utilities.dismissProgressHUD()
guard let data = data.data?.result else{return}
if data.count == 0{
self.vc.continueWatchingStack.isHidden = true
}else{
self.vc.continueWatchingStack.isHidden = false
}
self.continueWatchingData = data.reversed()
self.vc.continueWatchingCV.reloadData()
default:
break
}
case .failure(let error):
guard let self else{
Utilities.dismissProgressHUD()
return
}
Utilities.dismissProgressHUD()
self.vc.continueWatchingStack.isHidden = true
vc.toast(msg: error.localizedDescription , time: 2)
}
}
}
func getShowListing(){
// 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{
case .success(let data):
guard let self else{
Utilities.dismissProgressHUD()
return
}
switch data.success{
case 0:
/*
Error
*/
Utilities.dismissProgressHUD()
vc.toast(msg: data.message ?? "Unrecognised error" , time: 2)
case 1:
Utilities.dismissProgressHUD()
guard let data = data.data?.audioData else{return}
self.audioListData.removeAll()
self.audioListData = data
self.vc.audioListingTableView.reloadData()
self.vc.tableHeight.constant = self.vc.audioListingTableView.contentSize.height + 100
self.vc.audioListingTableView.layoutIfNeeded()
self.vc.tableHeight.constant = self.vc.audioListingTableView.contentSize.height
self.indexToLoad = 0
self.setInitialData()
self.stopShimmer()
default:
break
}
case .failure(let error):
guard let self else{
Utilities.dismissProgressHUD()
return
}
Utilities.dismissProgressHUD()
vc.toast(msg: error.localizedDescription , time: 2)
}
}
}
func stopShimmer(){
self.vc.headerView.stopShimmer()
vc.listenView.stopShimmer()
// self.vc.masilaTrailerView.stopShimmer()
// self.vc.videoLanguageView.stopShimmer()
}
}

View File

@@ -0,0 +1,194 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.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="Safe area layout guides" minToolsVersion="9.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>
<scenes>
<!--Audio Book HomeVC-->
<scene sceneID="s0d-6b-0kx">
<objects>
<viewController storyboardIdentifier="AudioBookHomeVC" id="Y6W-OH-hqX" customClass="AudioBookHomeVC" customModule="WOKA" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Y14-44-gYV" customClass="ShimmerEffectView" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="59" width="393" height="200"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="upA-oa-YmU">
<rect key="frame" x="0.0" y="0.0" width="393" height="200"/>
</imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="upA-oa-YmU" firstAttribute="top" secondItem="Y14-44-gYV" secondAttribute="top" id="1nk-Sb-8DA"/>
<constraint firstAttribute="trailing" secondItem="upA-oa-YmU" secondAttribute="trailing" id="9Zb-S7-yYN"/>
<constraint firstItem="upA-oa-YmU" firstAttribute="leading" secondItem="Y14-44-gYV" secondAttribute="leading" id="FpO-BI-Rfk"/>
<constraint firstAttribute="height" constant="200" id="bLW-xt-Ji5"/>
<constraint firstAttribute="bottom" secondItem="upA-oa-YmU" secondAttribute="bottom" id="ciJ-nx-qaz"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isSkeletonable" value="YES"/>
</userDefinedRuntimeAttributes>
</view>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="eex-XU-cbl">
<rect key="frame" x="0.0" y="259" width="393" height="593"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="U8f-iQ-dPK" customClass="ShimmerEffectView" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="393" height="108"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="NL8-ju-WMD">
<rect key="frame" x="0.0" y="0.0" width="393" height="108"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="LOADING..." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gVU-VB-fhU">
<rect key="frame" x="132.33333333333337" y="0.0" width="128.66666666666663" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="vuS-va-hGV"/>
</constraints>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="26"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="X2b-oH-h8S" customClass="LocalisedElementsButton" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="136.66666666666666" y="58" width="119.99999999999997" height="50"/>
<color key="backgroundColor" red="0.0" green="0.47843137254901957" blue="0.75294117647058822" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="5UF-I1-9tf"/>
<constraint firstAttribute="width" constant="120" id="zpN-e2-S5y"/>
</constraints>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="14"/>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="LISTEN"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="25"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</button>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="NL8-ju-WMD" firstAttribute="top" secondItem="U8f-iQ-dPK" secondAttribute="top" id="70D-wu-SVV"/>
<constraint firstAttribute="trailing" secondItem="NL8-ju-WMD" secondAttribute="trailing" id="KZW-qd-jiw"/>
<constraint firstItem="NL8-ju-WMD" firstAttribute="leading" secondItem="U8f-iQ-dPK" secondAttribute="leading" id="PuO-gQ-Yc1"/>
<constraint firstAttribute="bottom" secondItem="NL8-ju-WMD" secondAttribute="bottom" id="vWb-2V-bIi"/>
</constraints>
</view>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QFQ-dJ-08w">
<rect key="frame" x="0.0" y="116" width="393" height="477"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="15" translatesAutoresizingMaskIntoConstraints="NO" id="LRD-os-sag">
<rect key="frame" x="0.0" y="0.0" width="393" height="40"/>
<subviews>
<stackView hidden="YES" opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="wjN-Eq-Uv8">
<rect key="frame" x="10" y="0.0" width="373" height="270"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="CONTINUE WATCHING" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ovn-Ul-XkS" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="373" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="cCE-6Z-kw0"/>
</constraints>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="GjK-nD-NIP">
<rect key="frame" x="0.0" y="40" width="373" height="230"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="230" id="Nsi-O1-oCF"/>
</constraints>
<collectionViewFlowLayout key="collectionViewLayout" scrollDirection="horizontal" minimumLineSpacing="10" minimumInteritemSpacing="10" id="AdF-7D-2B9">
<size key="itemSize" width="128" height="128"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
<cells/>
</collectionView>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="CMa-8F-ibL">
<rect key="frame" x="10" y="0.0" width="373" height="40"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="LISTEN &amp; ENJOY" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RnV-l3-dK1" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="373" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="RV1-jN-fAk"/>
</constraints>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="244" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="2hg-bQ-s8S">
<rect key="frame" x="0.0" y="40" width="373" height="0.0"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" id="B9K-xl-IPt"/>
</constraints>
</tableView>
</subviews>
</stackView>
</subviews>
<edgeInsets key="layoutMargins" top="0.0" left="10" bottom="0.0" right="10"/>
</stackView>
</subviews>
<constraints>
<constraint firstItem="Fet-oe-Ekx" firstAttribute="trailing" secondItem="LRD-os-sag" secondAttribute="trailing" id="OKo-6X-T0T"/>
<constraint firstItem="LRD-os-sag" firstAttribute="leading" secondItem="Fet-oe-Ekx" secondAttribute="leading" id="Yt6-3x-e1M"/>
<constraint firstItem="LRD-os-sag" firstAttribute="top" secondItem="QFQ-dJ-08w" secondAttribute="top" id="ccf-fA-moP"/>
<constraint firstAttribute="bottom" secondItem="LRD-os-sag" secondAttribute="bottom" id="dEp-OV-mPg"/>
<constraint firstItem="LRD-os-sag" firstAttribute="width" secondItem="sZx-d4-Ghr" secondAttribute="width" id="g8w-DR-7WX"/>
</constraints>
<viewLayoutGuide key="contentLayoutGuide" id="sZx-d4-Ghr"/>
<viewLayoutGuide key="frameLayoutGuide" id="Fet-oe-Ekx"/>
</scrollView>
</subviews>
<color key="backgroundColor" red="0.019607843140000001" green="0.0" blue="0.21960784310000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</stackView>
</subviews>
<viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
<color key="backgroundColor" red="0.019607843140000001" green="0.0" blue="0.21960784310000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="eex-XU-cbl" firstAttribute="leading" secondItem="5EZ-qb-Rvc" secondAttribute="leading" id="2ga-A4-vd5"/>
<constraint firstItem="Y14-44-gYV" firstAttribute="top" secondItem="vDu-zF-Fre" secondAttribute="top" id="5sV-10-GLu"/>
<constraint firstItem="Y14-44-gYV" firstAttribute="leading" secondItem="5EZ-qb-Rvc" secondAttribute="leading" id="Kpt-XT-bJJ"/>
<constraint firstAttribute="bottom" secondItem="eex-XU-cbl" secondAttribute="bottom" id="XjZ-zL-h5N"/>
<constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="eex-XU-cbl" secondAttribute="trailing" id="jin-5o-F7U"/>
<constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="Y14-44-gYV" secondAttribute="trailing" id="kq0-mc-gp5"/>
<constraint firstItem="eex-XU-cbl" firstAttribute="top" secondItem="Y14-44-gYV" secondAttribute="bottom" id="xbq-QO-Gff"/>
</constraints>
</view>
<connections>
<outlet property="audioListingTableView" destination="2hg-bQ-s8S" id="zNi-4V-7ZX"/>
<outlet property="continueWatchingCV" destination="GjK-nD-NIP" id="noB-jL-jX9"/>
<outlet property="continueWatchingStack" destination="wjN-Eq-Uv8" id="K3b-KD-IhI"/>
<outlet property="headerHeight" destination="bLW-xt-Ji5" id="ifD-sE-vZI"/>
<outlet property="headerImage" destination="upA-oa-YmU" id="5nk-X3-Ik1"/>
<outlet property="headerTitleLabel" destination="gVU-VB-fhU" id="IdJ-vA-fbU"/>
<outlet property="headerView" destination="Y14-44-gYV" id="iEI-3T-DaP"/>
<outlet property="headerViewTopConstraint" destination="1nk-Sb-8DA" id="0WC-Ao-ddY"/>
<outlet property="listenView" destination="U8f-iQ-dPK" id="viY-Sn-3SO"/>
<outlet property="scrollView" destination="QFQ-dJ-08w" id="iQT-YH-vSA"/>
<outlet property="tableHeight" destination="B9K-xl-IPt" id="DoT-oS-DrI"/>
<outlet property="topLabel" destination="gVU-VB-fhU" id="z72-4N-T9u"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="139" y="-2"/>
</scene>
</scenes>
</document>

View File

@@ -0,0 +1,95 @@
//
// ListenAudioListingDM.swift
// WOKA
//
// Created by MacBook Pro on 02/07/24.
//
import Foundation
// MARK: - ListenAudioListingDM
struct ListenAudioListingDM: Codable {
let audioData: [AudioDatum]?
let totalRecords: Int?
enum CodingKeys: String, CodingKey {
case audioData = "audio_data"
case totalRecords = "total_records"
}
// MARK: - AudioDatum
struct AudioDatum: Codable {
let id: Int?
let title, description: String?
let thumbnailPath: String?
let audioURL: String?
let categoryMasterID, ageRangeMasterID, tagsKeyword: String?
let releaseDate: String?
let languageMasterID: Int?
let genderMasterID, audioDuration, mediaID: String?
let contentMoreDetails: [ContentMoreDetail]?
// let userVideoView: [JSONAny]?
let categoryData: [CategoryDatum]?
// let ageRangeData, genderData: [JSONAny]?
let markAsFavourite, isLiked: Bool?
let 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 ageRangeData = "age_range_data"
// case genderData = "gender_data"
case categoryData = "category_data"
case markAsFavourite = "mark_as_favourite"
case isLiked = "is_liked"
case viewsCount = "views_count"
case likesCount = "likes_count"
case bookmarkCount = "bookmark_count"
}
}
// MARK: - CategoryDatum
struct CategoryDatum: Codable {
let id: Int?
let categoryName: CategoryName?
enum CodingKeys: String, CodingKey {
case id
case categoryName = "category_name"
}
}
enum CategoryName: String, Codable {
case audio = "Audio"
}
// 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"
}
}
}

View File

@@ -17,5 +17,6 @@ extension K{
static let theme = "Theme"
static let sideBarNav = "SideBarNav"
static let webSeries = "WebSeries"
static let audioBooks = "AudioBooks"
}
}

View File

@@ -65,5 +65,12 @@ extension K{
static let episodeDetailsVC = "EpisodeDetailsVC"
static let continueWatchingVC = "ContinueWatchingVC"
}
// MARK: - AudioBooks
struct AudioBooks{
static let audioBookHomeVC = "AudioBookHomeVC"
}
}
}

View File

@@ -90,6 +90,10 @@ struct APIEndPoints {
static let teaser_listing = makeURL(path: "teaser_listing")
}
struct AudioBooks{
static let listen_audio_listing = makeURL(path: "listen_audio_listing")
}
// Other endpoint categories...
struct Links {
static let privacyPolicy = "https://www.wokaland.com/privacy-policy/"

View File

@@ -304,34 +304,14 @@
<constraint firstAttribute="width" secondItem="r88-JP-phS" secondAttribute="height" multiplier="1:1" id="Ylk-SV-7uT"/>
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillProportionally" spacing="1" translatesAutoresizingMaskIntoConstraints="NO" id="JHO-R6-WGZ" userLabel="Audio Books">
<rect key="frame" x="169.33333333333334" y="202.33333333333331" width="114.33333333333334" height="95.333333333333314"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="AudioBooks" translatesAutoresizingMaskIntoConstraints="NO" id="za2-oW-KjU">
<rect key="frame" x="0.0" y="0.0" width="114.33333333333333" height="79.333333333333329"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="AUDIO BOOKS" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="11" translatesAutoresizingMaskIntoConstraints="NO" id="Y9F-E4-lgm" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="80.333333333333371" width="114.33333333333333" height="15"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="978-3e-GXx"/>
</constraints>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="13"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="width" secondItem="JHO-R6-WGZ" secondAttribute="height" multiplier="1.2:1" id="hqY-S6-6P7"/>
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillProportionally" spacing="1" translatesAutoresizingMaskIntoConstraints="NO" id="9fz-vc-Ufb" userLabel="Karaoke">
<rect key="frame" x="14.333333333333336" y="192.33333333333331" width="95" height="95.333333333333314"/>
<rect key="frame" x="10" y="192.33333333333331" width="95" height="95"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Karaoke" translatesAutoresizingMaskIntoConstraints="NO" id="DWF-Lu-F24">
<rect key="frame" x="0.0" y="0.0" width="95" height="79.333333333333329"/>
<rect key="frame" x="0.0" y="0.0" width="95" height="79"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="KARAOKE" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Yyo-6X-Jk4" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="80.333333333333371" width="95" height="15"/>
<rect key="frame" x="0.0" y="80" width="95" height="15"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="Z4M-G5-Rob"/>
</constraints>
@@ -344,26 +324,55 @@
<constraint firstAttribute="width" secondItem="9fz-vc-Ufb" secondAttribute="height" multiplier="1:1" id="91B-pD-rvh"/>
</constraints>
</stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ugr-Tf-Y1l">
<rect key="frame" x="165" y="202.33333333333331" width="95" height="95"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillProportionally" spacing="1" translatesAutoresizingMaskIntoConstraints="NO" id="JHO-R6-WGZ" userLabel="Audio Books">
<rect key="frame" x="0.0" y="0.0" width="95" height="95"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="AudioBooks" translatesAutoresizingMaskIntoConstraints="NO" id="za2-oW-KjU">
<rect key="frame" x="0.0" y="0.0" width="95" height="79"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="AUDIO BOOKS" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="11" translatesAutoresizingMaskIntoConstraints="NO" id="Y9F-E4-lgm" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="80" width="95" height="15"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="978-3e-GXx"/>
</constraints>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="13"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="JHO-R6-WGZ" firstAttribute="leading" secondItem="ugr-Tf-Y1l" secondAttribute="leading" id="CxL-hh-9Cp"/>
<constraint firstAttribute="bottom" secondItem="JHO-R6-WGZ" secondAttribute="bottom" id="Kpf-Pk-LWC"/>
<constraint firstItem="JHO-R6-WGZ" firstAttribute="top" secondItem="ugr-Tf-Y1l" secondAttribute="top" id="PwG-gU-u4t"/>
<constraint firstAttribute="width" secondItem="ugr-Tf-Y1l" secondAttribute="height" multiplier="1:1" id="k07-vU-BI2"/>
<constraint firstAttribute="trailing" secondItem="JHO-R6-WGZ" secondAttribute="trailing" id="wrd-vn-ogp"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="r88-JP-phS" firstAttribute="height" secondItem="ppi-HI-rj1" secondAttribute="height" multiplier="0.208333" id="0sg-36-CK8"/>
<constraint firstItem="Ehe-Th-asW" firstAttribute="baseline" secondItem="lRy-nX-Xia" secondAttribute="firstBaseline" constant="40" id="6HI-BQ-pxx"/>
<constraint firstItem="r88-JP-phS" firstAttribute="top" secondItem="Ehe-Th-asW" secondAttribute="bottom" constant="40" id="6wM-Ss-Lui"/>
<constraint firstItem="9fz-vc-Ufb" firstAttribute="centerX" secondItem="GGC-rX-Pyw" secondAttribute="centerX" id="7c7-bD-KbL"/>
<constraint firstItem="GGC-rX-Pyw" firstAttribute="leading" secondItem="ppi-HI-rj1" secondAttribute="leading" constant="10" id="Go0-Ui-etR"/>
<constraint firstItem="JHO-R6-WGZ" firstAttribute="centerX" secondItem="lRy-nX-Xia" secondAttribute="centerX" constant="30" id="KjY-SZ-e5Z"/>
<constraint firstItem="r88-JP-phS" firstAttribute="baseline" secondItem="ugr-Tf-Y1l" secondAttribute="firstBaseline" constant="25" id="KVM-oa-G0P"/>
<constraint firstItem="r88-JP-phS" firstAttribute="centerX" secondItem="Ehe-Th-asW" secondAttribute="centerX" constant="10" id="M0G-TU-M2T"/>
<constraint firstItem="GGC-rX-Pyw" firstAttribute="centerY" secondItem="lRy-nX-Xia" secondAttribute="centerY" constant="25" id="NmB-T5-Lvq"/>
<constraint firstItem="9fz-vc-Ufb" firstAttribute="height" secondItem="ppi-HI-rj1" secondAttribute="height" multiplier="0.208333" id="RjE-7v-VJf"/>
<constraint firstItem="lRy-nX-Xia" firstAttribute="height" secondItem="ppi-HI-rj1" secondAttribute="height" multiplier="0.208333" id="Slx-Jj-1Nl"/>
<constraint firstItem="lRy-nX-Xia" firstAttribute="centerX" secondItem="ppi-HI-rj1" secondAttribute="centerX" id="ZMq-Za-1eg"/>
<constraint firstItem="Ehe-Th-asW" firstAttribute="height" secondItem="ppi-HI-rj1" secondAttribute="height" multiplier="0.208333" id="bYM-Cl-mWm"/>
<constraint firstItem="ugr-Tf-Y1l" firstAttribute="leading" secondItem="9fz-vc-Ufb" secondAttribute="trailing" constant="60" id="d6T-jS-Fvp"/>
<constraint firstAttribute="trailing" secondItem="Ehe-Th-asW" secondAttribute="trailing" constant="10" id="h6R-gj-t8n"/>
<constraint firstItem="Ehe-Th-asW" firstAttribute="top" secondItem="ppi-HI-rj1" secondAttribute="top" id="rPo-rh-Nry"/>
<constraint firstItem="JHO-R6-WGZ" firstAttribute="firstBaseline" secondItem="r88-JP-phS" secondAttribute="baseline" constant="-25" id="snK-f5-Dqo"/>
<constraint firstItem="9fz-vc-Ufb" firstAttribute="centerY" secondItem="JHO-R6-WGZ" secondAttribute="centerY" constant="-10" id="tXZ-qB-fYT"/>
<constraint firstItem="JHO-R6-WGZ" firstAttribute="leading" secondItem="9fz-vc-Ufb" secondAttribute="trailing" constant="60" id="vgo-2s-64l"/>
<constraint firstItem="JHO-R6-WGZ" firstAttribute="height" secondItem="ppi-HI-rj1" secondAttribute="height" multiplier="0.208333" id="z24-hh-k41"/>
<constraint firstItem="9fz-vc-Ufb" firstAttribute="top" secondItem="GGC-rX-Pyw" secondAttribute="bottom" constant="20" id="v9C-zO-CMS"/>
</constraints>
</view>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="-2" translatesAutoresizingMaskIntoConstraints="NO" id="LYo-Uy-0nM" userLabel="More">
@@ -423,6 +432,7 @@
<constraint firstItem="vdl-cu-G32" firstAttribute="bottom" secondItem="LYo-Uy-0nM" secondAttribute="bottom" constant="15" id="qYM-va-cyv"/>
<constraint firstItem="kzE-UE-7KK" firstAttribute="height" secondItem="UEh-jl-IQp" secondAttribute="height" multiplier="0.212054" id="s5Y-TI-1sZ"/>
<constraint firstItem="ppi-HI-rj1" firstAttribute="height" secondItem="UEh-jl-IQp" secondAttribute="height" multiplier="0.535714" id="sLx-ty-T4s"/>
<constraint firstItem="ugr-Tf-Y1l" firstAttribute="height" secondItem="UEh-jl-IQp" secondAttribute="height" multiplier="0.111502" id="sYx-j0-ShZ"/>
<constraint firstItem="sf9-me-n7i" firstAttribute="centerX" secondItem="vdl-cu-G32" secondAttribute="centerX" id="vZE-xF-UKh"/>
<constraint firstItem="GGC-rX-Pyw" firstAttribute="height" secondItem="UEh-jl-IQp" secondAttribute="height" multiplier="0.111502" id="wVS-AA-kvz"/>
</constraints>
@@ -430,6 +440,7 @@
<tabBarItem key="tabBarItem" title="HOME" image="HomeIcon" selectedImage="HomeIcon" id="4Hm-tg-Heb"/>
<connections>
<outlet property="HelloLabel" destination="YmK-3m-WeD" id="H6O-kI-Xc3"/>
<outlet property="audioBooksView" destination="ugr-Tf-Y1l" id="O1d-Jo-Roc"/>
<outlet property="avatarImage" destination="o2x-QJ-V9A" id="rgu-lT-WaZ"/>
<outlet property="bottomArrow" destination="rdd-P1-Vk7" id="K5z-Hv-wdR"/>
<outlet property="cloud1" destination="hnb-h6-Rgs" id="yq6-eE-20d"/>

View File

@@ -23,6 +23,7 @@ class ThemeOneVC: UIViewController {
@IBOutlet weak var avatarImage: UIImageView!
@IBOutlet weak var webSeriesView: UIView!
@IBOutlet weak var audioBooksView: UIView!
@IBOutlet var star: [UIImageView]!
@IBOutlet weak var moonImage: UIImageView!
@IBOutlet weak var moreStack: UIStackView!

View File

@@ -126,6 +126,15 @@ class ThemeOneVM{
vc.navigationController?.pushViewController(vcPush, animated: true)
}
}
vc.audioBooksView.addTapGesture {
ViewButtonAnimation.sharedInstance.btnTapped(in: self.vc, view: self.vc.audioBooksView) { [weak self] in
guard let self else{return}
let sb = UIStoryboard(name: K.StoryBoard.audioBooks, bundle: nil)
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.AudioBooks.audioBookHomeVC) as! AudioBookHomeVC
vc.navigationController?.pushViewController(vcPush, animated: true)
}
}
}
// MARK: - Animate Clouds and LiveTV

View File

@@ -80,6 +80,37 @@ class WebSeriesShowListingCell: UITableViewCell {
}
}
func setAudioData(data: ListenAudioListingDM.AudioDatum){
//heart.fill , heart , hand.thumbsup.fill , hand.thumbsup
if AuthFunc.shareInstance.getDefaultLanguage() == .english{
showTitle.text = data.contentMoreDetails?.filter({$0.languageMasterID == 1}).first?.title
}else{
showTitle.text = data.contentMoreDetails?.filter({$0.languageMasterID == 2}).first?.title
}
totalLikes.text = data.likesCount?.toString() ?? "0"
if let url = data.thumbnailPath{
showThumbnail.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: