From 41e770f9917504886fbc3e25d093d32c9ace756a Mon Sep 17 00:00:00 2001 From: BilalKhanWDI Date: Thu, 4 Jul 2024 19:48:15 +0530 Subject: [PATCH] - Completed lingual file - Completed the default top header set as per the selcection on user, first load will select 0th index - Completed player for audio books - Handled error response for audio listing - AudioBook Details View added like fav - Fixed the nav bar color issue. - Finished games module --- WOKA.xcodeproj/project.pbxproj | 64 ++ WOKA/Audio Books/AudioBookDetailsVC.swift | 211 ++++++- WOKA/Audio Books/AudioBookHomeVC.swift | 160 ++--- WOKA/Audio Books/AudioBookHomeVM.swift | 13 +- WOKA/Audio Books/AudioBooks.storyboard | 171 +++++- WOKA/Constants K/StoryBoard.swift | 1 + WOKA/Constants K/StoryBoardID.swift | 8 + WOKA/Games/Controller/GamesDetailVC.swift | 163 +++++ WOKA/Games/Controller/GamesListVC.swift | 165 ++++++ WOKA/Games/Controller/GamesWebViewVC.swift | 83 +++ WOKA/Games/Games.storyboard | 558 ++++++++++++++++++ WOKA/Games/Model/GamesListDM.swift | 78 +++ WOKA/Games/ViewModel/GamesListVM.swift | 160 +++++ .../hi.lproj/Localizable.strings | 11 + WOKA/Network Adapter/APIEndPoints.swift | 5 + WOKA/Theme/Base.lproj/Theme.storyboard | 63 +- WOKA/Theme/Controller/PlayerVC.swift | 10 +- WOKA/Theme/Controller/ThemeOneVC.swift | 1 + WOKA/Theme/ViewModel/ThemeOneVM.swift | 9 + .../Controller/WebSeriesSeasonVC.swift | 5 +- WOKA/WebSeries/Controller/WebSeriesVC.swift | 3 +- WOKA/WebSeries/JWPlayerManager.swift | 4 +- .../View/WebSeriesShowListingCell.swift | 38 +- .../ViewModel/WebSeriesSeasonVM.swift | 9 +- WOKA/WebSeries/WebSeries.storyboard | 6 +- 25 files changed, 1858 insertions(+), 141 deletions(-) create mode 100644 WOKA/Games/Controller/GamesDetailVC.swift create mode 100644 WOKA/Games/Controller/GamesListVC.swift create mode 100644 WOKA/Games/Controller/GamesWebViewVC.swift create mode 100644 WOKA/Games/Games.storyboard create mode 100644 WOKA/Games/Model/GamesListDM.swift create mode 100644 WOKA/Games/ViewModel/GamesListVM.swift diff --git a/WOKA.xcodeproj/project.pbxproj b/WOKA.xcodeproj/project.pbxproj index 8b2c3c3..4665eb2 100644 --- a/WOKA.xcodeproj/project.pbxproj +++ b/WOKA.xcodeproj/project.pbxproj @@ -66,6 +66,8 @@ 52663FF72BDFACF60001D8CE /* ShadowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52663FF62BDFACF60001D8CE /* ShadowView.swift */; }; 52663FF92BDFAF110001D8CE /* EmailVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52663FF82BDFAF110001D8CE /* EmailVM.swift */; }; 52663FFB2BDFB1700001D8CE /* TextFieldShadow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52663FFA2BDFB1700001D8CE /* TextFieldShadow.swift */; }; + 526A436F2C36A97400AE148F /* Games.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 526A436E2C36A97400AE148F /* Games.storyboard */; }; + 526A43752C36AA4A00AE148F /* GamesListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526A43742C36AA4A00AE148F /* GamesListVC.swift */; }; 5272FCE32BDFDB05000ECB1D /* UserDetailsRegisterVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5272FCE22BDFDB05000ECB1D /* UserDetailsRegisterVC.swift */; }; 5272FCE52BDFDC8C000ECB1D /* UserDetailsRegisterVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5272FCE42BDFDC8C000ECB1D /* UserDetailsRegisterVM.swift */; }; 527AC6F72C171C8F00434FB7 /* BlogsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 527AC6F52C171C8F00434FB7 /* BlogsCell.swift */; }; @@ -93,6 +95,10 @@ 52AC2D252C295A7900337473 /* TeaserDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52AC2D242C295A7900337473 /* TeaserDM.swift */; }; 52AC2D272C29791500337473 /* JWPlayerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52AC2D262C29791500337473 /* JWPlayerManager.swift */; }; 52AECA802C08BCB6004A7579 /* PlayerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52AECA7F2C08BCB6004A7579 /* PlayerVC.swift */; }; + 52AF71EE2C36AD3100BC5972 /* GamesListVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52AF71ED2C36AD3100BC5972 /* GamesListVM.swift */; }; + 52AF71F02C36B29A00BC5972 /* GamesListDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52AF71EF2C36B29A00BC5972 /* GamesListDM.swift */; }; + 52AF71F22C36B77B00BC5972 /* GamesDetailVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52AF71F12C36B77B00BC5972 /* GamesDetailVC.swift */; }; + 52AF71F42C36C40B00BC5972 /* GamesWebViewVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52AF71F32C36C40B00BC5972 /* GamesWebViewVC.swift */; }; 52B8D4D92C04A25E00ED65F3 /* UIViewController+Container.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B8D4CE2C04A25D00ED65F3 /* UIViewController+Container.swift */; }; 52B8D4DA2C04A25E00ED65F3 /* Preferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B8D4CF2C04A25D00ED65F3 /* Preferences.swift */; }; 52B8D4DB2C04A25E00ED65F3 /* TransitionContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B8D4D02C04A25D00ED65F3 /* TransitionContext.swift */; }; @@ -330,6 +336,8 @@ 52663FF62BDFACF60001D8CE /* ShadowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShadowView.swift; sourceTree = ""; }; 52663FF82BDFAF110001D8CE /* EmailVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmailVM.swift; sourceTree = ""; }; 52663FFA2BDFB1700001D8CE /* TextFieldShadow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextFieldShadow.swift; sourceTree = ""; }; + 526A436E2C36A97400AE148F /* Games.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Games.storyboard; sourceTree = ""; }; + 526A43742C36AA4A00AE148F /* GamesListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GamesListVC.swift; sourceTree = ""; }; 5272FCE22BDFDB05000ECB1D /* UserDetailsRegisterVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDetailsRegisterVC.swift; sourceTree = ""; }; 5272FCE42BDFDC8C000ECB1D /* UserDetailsRegisterVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDetailsRegisterVM.swift; sourceTree = ""; }; 527AC6F52C171C8F00434FB7 /* BlogsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlogsCell.swift; sourceTree = ""; }; @@ -357,6 +365,10 @@ 52AC2D242C295A7900337473 /* TeaserDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeaserDM.swift; sourceTree = ""; }; 52AC2D262C29791500337473 /* JWPlayerManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JWPlayerManager.swift; sourceTree = ""; }; 52AECA7F2C08BCB6004A7579 /* PlayerVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerVC.swift; sourceTree = ""; }; + 52AF71ED2C36AD3100BC5972 /* GamesListVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GamesListVM.swift; sourceTree = ""; }; + 52AF71EF2C36B29A00BC5972 /* GamesListDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GamesListDM.swift; sourceTree = ""; }; + 52AF71F12C36B77B00BC5972 /* GamesDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GamesDetailVC.swift; sourceTree = ""; }; + 52AF71F32C36C40B00BC5972 /* GamesWebViewVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GamesWebViewVC.swift; sourceTree = ""; }; 52B8D4CE2C04A25D00ED65F3 /* UIViewController+Container.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+Container.swift"; sourceTree = ""; }; 52B8D4CF2C04A25D00ED65F3 /* Preferences.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Preferences.swift; sourceTree = ""; }; 52B8D4D02C04A25D00ED65F3 /* TransitionContext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransitionContext.swift; sourceTree = ""; }; @@ -646,6 +658,7 @@ 523ED25C2BDA2BC700CFED02 /* WOKA */ = { isa = PBXGroup; children = ( + 526A436D2C36A96A00AE148F /* Games */, 52BFB52B2C33DA9700BAAE15 /* Audio Books */, 52DAC6462C21761700E2F85B /* WebSeries */, 9C834ED92C1C20EC00B29A9C /* WOKA.entitlements */, @@ -877,6 +890,51 @@ path = Alerts; sourceTree = ""; }; + 526A436D2C36A96A00AE148F /* Games */ = { + isa = PBXGroup; + children = ( + 526A43732C36A98000AE148F /* Model */, + 526A43722C36A97E00AE148F /* View */, + 526A43712C36A97B00AE148F /* ViewModel */, + 526A43702C36A97800AE148F /* Controller */, + 526A436E2C36A97400AE148F /* Games.storyboard */, + ); + path = Games; + sourceTree = ""; + }; + 526A43702C36A97800AE148F /* Controller */ = { + isa = PBXGroup; + children = ( + 526A43742C36AA4A00AE148F /* GamesListVC.swift */, + 52AF71F12C36B77B00BC5972 /* GamesDetailVC.swift */, + 52AF71F32C36C40B00BC5972 /* GamesWebViewVC.swift */, + ); + path = Controller; + sourceTree = ""; + }; + 526A43712C36A97B00AE148F /* ViewModel */ = { + isa = PBXGroup; + children = ( + 52AF71ED2C36AD3100BC5972 /* GamesListVM.swift */, + ); + path = ViewModel; + sourceTree = ""; + }; + 526A43722C36A97E00AE148F /* View */ = { + isa = PBXGroup; + children = ( + ); + path = View; + sourceTree = ""; + }; + 526A43732C36A98000AE148F /* Model */ = { + isa = PBXGroup; + children = ( + 52AF71EF2C36B29A00BC5972 /* GamesListDM.swift */, + ); + path = Model; + sourceTree = ""; + }; 527AC6FF2C182D1700434FB7 /* Timer */ = { isa = PBXGroup; children = ( @@ -1482,6 +1540,7 @@ 527AC6F82C171C8F00434FB7 /* BlogsCell.xib in Resources */, 52A981D82C1B0E27000E0BEC /* FavouriteCell.xib in Resources */, 52C1A4E82C05C95D007BAA50 /* Theme.storyboard in Resources */, + 526A436F2C36A97400AE148F /* Games.storyboard in Resources */, 522D65652C1ACE9C0021E505 /* UserNotificationCell.xib in Resources */, 9C535DC52C00BF2400DA6DCD /* HomeExploreCell.xib in Resources */, 9CBE1B422C0F37B300CA6E61 /* DropDownCell.xib in Resources */, @@ -1625,9 +1684,11 @@ 5202AB012BDFA7900043B7BD /* EmailValidation.swift in Sources */, 52D6A24E2C22B3AB00145908 /* WebSeriesShowListDM.swift in Sources */, 52B8D4E12C04A25E00ED65F3 /* BasicTransitionAnimator.swift in Sources */, + 52AF71F02C36B29A00BC5972 /* GamesListDM.swift in Sources */, 52BC3BF02C1701F8002FACA6 /* BlogDM.swift in Sources */, 525954192BE8CC3400191286 /* ConstantString.swift in Sources */, 52D774EB2BDFC0BF001D87DE /* OTPVC.swift in Sources */, + 52AF71F42C36C40B00BC5972 /* GamesWebViewVC.swift in Sources */, 9C007F202C255DF200F798C2 /* SeasonEpisodeListingDM.swift in Sources */, 52D2F3D82C24043D009E52FF /* ShimmerEffectView.swift in Sources */, 9C27E16F2BDB866500EC1DA9 /* CellIdentifier.swift in Sources */, @@ -1675,6 +1736,7 @@ 9CBCB2AA2BE51A52007D7934 /* ThemeOneVC.swift in Sources */, 52D774E92BDFBDA4001D87DE /* AuthenticationStringConstant.swift in Sources */, 5259541B2BE8D6F900191286 /* NetworkReachibility.swift in Sources */, + 52AF71EE2C36AD3100BC5972 /* GamesListVM.swift in Sources */, 52A981CE2C1AFE66000E0BEC /* FavouriteListingDM.swift in Sources */, 527AC6FD2C173A5100434FB7 /* SongListCell.swift in Sources */, 52D6A2542C22B93F00145908 /* CategoryListingDM.swift in Sources */, @@ -1686,6 +1748,7 @@ 525954292BEA079500191286 /* UserEmailVerifyDM.swift in Sources */, 522D655E2C1ACCF40021E505 /* UserNotificationDM.swift in Sources */, 9C1C69FC2C106C240035B2C7 /* ContactSupportVM.swift in Sources */, + 52AF71F22C36B77B00BC5972 /* GamesDetailVC.swift in Sources */, 52A3F6AF2BECC0690000BB0B /* LinkedChildVM.swift in Sources */, 52C8EC7D2C3536E5002DC35C /* ContinueAudioCell.swift in Sources */, 525954252BE8F01600191286 /* ValueWrapper.swift in Sources */, @@ -1705,6 +1768,7 @@ 9C56E8482BDBEFAB00E4CA14 /* AssetColor.swift in Sources */, 52BFB5372C33E0C500BAAE15 /* AudioBookHomeVM.swift in Sources */, 9C0A85432BEE3EC90093783D /* NewPasswordVM.swift in Sources */, + 526A43752C36AA4A00AE148F /* GamesListVC.swift in Sources */, 522D65662C1ACE9C0021E505 /* UserNotificationCell.swift in Sources */, 524C42332C049D590016A11C /* CustomizableSegmentControl.swift in Sources */, 9C535DB52C005A6D00DA6DCD /* KeyWindowFix.swift in Sources */, diff --git a/WOKA/Audio Books/AudioBookDetailsVC.swift b/WOKA/Audio Books/AudioBookDetailsVC.swift index 05d8231..352c2d8 100644 --- a/WOKA/Audio Books/AudioBookDetailsVC.swift +++ b/WOKA/Audio Books/AudioBookDetailsVC.swift @@ -7,14 +7,27 @@ import UIKit +protocol ReloadAudioBooksFavLike{ + func updateRows(id : Int, type : FavCellCLick, isFav : Bool? , isLike : Bool? ) +} + 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)? + @IBOutlet weak var addIcon: UIImageView! + @IBOutlet weak var addLabel: UILabel! + @IBOutlet weak var likeIcon: UIImageView! + @IBOutlet weak var likeLabel: UILabel! + @IBOutlet weak var totalLikes: UILabel! + + @IBOutlet weak var addView: UIView! + @IBOutlet weak var shareView: UIView! + @IBOutlet weak var likeView: UIView! + + var delegate : ReloadAudioBooksFavLike? var audioData : ListenAudioListingDM.AudioDatum? @@ -22,12 +35,139 @@ class AudioBookDetailsVC : UIViewController{ override func viewDidLoad() { super.viewDidLoad() + initView() + self.view.addTapGesture { + self.dismiss(animated: true) + } + + tapHandler() + } + + func tapHandler(){ + addView.addTapGesture { [weak self] in + guard let self else{return} + if let audioData{ + guard let showID = audioData.id, let isFav = audioData.markAsFavourite, let postType = audioData.contentMoreDetails?.first?.postType else{return} + + if isFav { + LikeFavCommonFunc.shareInstance.removeFavourite(postID: showID, postType: postType, categoryID: 0, vc: self) { isDone in + self.audioData?.markAsFavourite = false + K.GVar.reloadMyList = true + self.delegate?.updateRows(id: showID, type: .favourite, isFav: false, isLike: nil) + self.initView() + } + }else{ + LikeFavCommonFunc.shareInstance.addFavourite(postID: showID, postType: postType, categoryID: 0, vc: self) { isDone in + self.audioData?.markAsFavourite = true + K.GVar.reloadMyList = true + self.delegate?.updateRows(id: showID, type: .favourite, isFav: true, isLike: nil) + self.initView() + } + } + } + + if let continueAudioData{ + guard let showID = continueAudioData.id, let isFav = continueAudioData.markAsFavourite, let postType = continueAudioData.contentMoreDetails?.first?.postType else{return} + + if isFav { + LikeFavCommonFunc.shareInstance.removeFavourite(postID: showID, postType: postType, categoryID: 0, vc: self) { isDone in + self.continueAudioData?.markAsFavourite = false + K.GVar.reloadMyList = true + self.delegate?.updateRows(id: showID, type: .favourite, isFav: false, isLike: nil) + self.initView() + } + }else{ + LikeFavCommonFunc.shareInstance.addFavourite(postID: showID, postType: postType, categoryID: 0, vc: self) { isDone in + self.continueAudioData?.markAsFavourite = true + K.GVar.reloadMyList = true + self.delegate?.updateRows(id: showID, type: .favourite, isFav: true, isLike: nil) + self.initView() + } + } + } + + } + + likeView.addTapGesture { [weak self] in + + guard let self else{return} + + if let audioData{ + guard let showID = audioData.id, let isLiked = audioData.isLiked, let postType = audioData.contentMoreDetails?.first?.postType else{return} + + if isLiked{ + LikeFavCommonFunc.shareInstance.unlikePost(postID: showID, postType: postType, vc: self) { isDone in + self.audioData?.isLiked = false + K.GVar.reloadMyList = true + self.delegate?.updateRows(id: showID, type: .liked, isFav: nil, isLike: false) + self.initView() + } + }else{ + LikeFavCommonFunc.shareInstance.likePost(postID: showID, postType: postType, vc: self) { isDone in + self.audioData?.isLiked = true + K.GVar.reloadMyList = true + self.delegate?.updateRows(id: showID, type: .liked, isFav: nil, isLike: true) + self.initView() + } + } + } + + if let continueAudioData{ + guard let showID = continueAudioData.id, let isLiked = continueAudioData.isLiked, let postType = continueAudioData.contentMoreDetails?.first?.postType else{return} + + if isLiked{ + LikeFavCommonFunc.shareInstance.unlikePost(postID: showID, postType: postType, vc: self) { isDone in + self.continueAudioData?.isLiked = false + K.GVar.reloadMyList = true + self.delegate?.updateRows(id: showID, type: .liked, isFav: nil, isLike: false) + self.initView() + } + }else{ + LikeFavCommonFunc.shareInstance.likePost(postID: showID, postType: postType, vc: self) { isDone in + self.continueAudioData?.isLiked = true + K.GVar.reloadMyList = true + self.delegate?.updateRows(id: showID, type: .liked, isFav: nil, isLike: true) + self.initView() + } + } + } + + } + + shareView.addTapGesture { + print("share") + } + } + + func initView(){ if let audioData{ if let url = audioData.thumbnailPath{ watchingImage.imageURL(url, color: .white) } + totalLikes.text = audioData.likesCount?.toString() ?? "0" + if let like = audioData.isLiked{ + switch like{ + case true: + likeIcon.image = UIImage(systemName: "hand.thumbsup.fill") + likeLabel.text = "LIKED".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) + case false: + likeIcon.image = UIImage(systemName: "hand.thumbsup") + likeLabel.text = "LIKE".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) + } + } + + if let favourite = audioData.markAsFavourite{ + if favourite == true{ + addIcon.image = UIImage(systemName: "heart.fill") + addLabel.text = "ADDED".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) + }else{ + addIcon.image = UIImage(systemName: "heart") + addLabel.text = "ADD".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) + } + } + if AuthFunc.shareInstance.getDefaultLanguage() == .english{ if let englishData = audioData.contentMoreDetails?.filter({$0.languageMasterID == 1}).first{ watchingTitle.text = englishData.title @@ -54,26 +194,83 @@ class AudioBookDetailsVC : UIViewController{ watchingImage.imageURL(url, color: .white) } + totalLikes.text = continueAudioData.likesCount?.toString() ?? "0" + if let like = continueAudioData.isLiked{ + switch like{ + case true: + likeIcon.image = UIImage(systemName: "hand.thumbsup.fill") + likeLabel.text = "LIKED".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) + case false: + likeIcon.image = UIImage(systemName: "hand.thumbsup") + likeLabel.text = "LIKE".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) + } + } + + if let favourite = continueAudioData.markAsFavourite{ + if favourite == true{ + addIcon.image = UIImage(systemName: "heart.fill") + addLabel.text = "ADDED".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) + }else{ + addIcon.image = UIImage(systemName: "heart") + addLabel.text = "ADD".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) + } + } + if AuthFunc.shareInstance.getDefaultLanguage() == .english{ if let englishData = continueAudioData.contentMoreDetails?.filter({$0.languageMasterID == 1}).first{ watchingTitle.text = englishData.title + if let desc = englishData.description?.replacingOccurrences(of: "
", 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 = continueAudioData.contentMoreDetails?.filter({$0.languageMasterID == 2}).first{ watchingTitle.text = hindiData.title + if let desc = hindiData.description?.replacingOccurrences(of: "
", 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 + } + } + } + } + } + + @IBAction func watchBtnTapped(_ sender: LocalisedElementsButton) { + var playerItems = [JwPlayerItemCreate]() + + if let audioData{ + if AuthFunc.shareInstance.getDefaultLanguage() == .english{ + if let englishData = audioData.contentMoreDetails?.filter({$0.languageMasterID == 1}).first, let url = englishData.url{ + playerItems.append(JwPlayerItemCreate(url: url, poster: audioData.thumbnailPath, titles: englishData.title)) + } + }else{ + if let hindiData = audioData.contentMoreDetails?.filter({$0.languageMasterID == 2}).first, let url = hindiData.url{ + playerItems.append(JwPlayerItemCreate(url: url, poster: audioData.thumbnailPath, titles: hindiData.title)) } } } + if let continueAudioData{ + if AuthFunc.shareInstance.getDefaultLanguage() == .english{ + if let englishData = continueAudioData.contentMoreDetails?.filter({$0.languageMasterID == 1}).first, let url = englishData.url{ + playerItems.append(JwPlayerItemCreate(url: url, poster: continueAudioData.thumbnailPath, titles: englishData.title)) + } + }else{ + if let hindiData = continueAudioData.contentMoreDetails?.filter({$0.languageMasterID == 2}).first, let url = hindiData.url{ + playerItems.append(JwPlayerItemCreate(url: url, poster: continueAudioData.thumbnailPath, titles: hindiData.title)) + } + } + } + JWPlayerManager.shared.presentPlayer(from: self, playerItems: playerItems, startIndex: 0, contentType: .audioBooks) } - @IBAction func watchBtnTapped(_ sender: LocalisedElementsButton) { - - } - - @IBAction func closeBtnTapped(_ sender: LocalisedElementsButton) { + @IBAction func closeBtnTapped(_ sender: UIButton) { self.dismiss(animated: true) { } } + } diff --git a/WOKA/Audio Books/AudioBookHomeVC.swift b/WOKA/Audio Books/AudioBookHomeVC.swift index db71526..77a1239 100644 --- a/WOKA/Audio Books/AudioBookHomeVC.swift +++ b/WOKA/Audio Books/AudioBookHomeVC.swift @@ -27,18 +27,18 @@ class AudioBookHomeVC: UIViewController { override func viewDidLoad() { super.viewDidLoad() vm.vc = self - self.title = "AUDIO BOOKS" + self.title = "AUDIO BOOKS".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) vm.initView() scrollView.delegate = self + 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) - + self.view.applyGradient(colors: [color1,color2], startPoint: .Point.left.point , endPoint: .Point.right.point) navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default) navigationController?.navigationBar.shadowImage = UIImage() } - + override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) navigationController?.setNavigationBarHidden(false, animated: animated) @@ -61,6 +61,54 @@ class AudioBookHomeVC: UIViewController { override func viewDidLayoutSubviews() { vm.updateTableHeight() } + + @IBAction func listenAudioBtnTapped(_ sender: LocalisedElementsButton) { + let data = vm.audioListData[vm.indexToLoad] + var playerItems = [JwPlayerItemCreate]() + if AuthFunc.shareInstance.getDefaultLanguage() == .english{ + if let englishData = data.contentMoreDetails?.filter({$0.languageMasterID == 1}).first, let url = englishData.url{ + playerItems.append(JwPlayerItemCreate(url: url, poster: data.thumbnailPath, titles: englishData.title)) + } + }else{ + if let hindiData = data.contentMoreDetails?.filter({$0.languageMasterID == 2}).first, let url = hindiData.url{ + playerItems.append(JwPlayerItemCreate(url: url, poster: data.thumbnailPath, titles: hindiData.title)) + } + } + JWPlayerManager.shared.presentPlayer(from: self, playerItems: playerItems, startIndex: 0, contentType: .audioBooks) + } +} + +// MARK: - Delegate for reload + +extension AudioBookHomeVC : ReloadAudioBooksFavLike{ + + func updateRows(id: Int, type: FavCellCLick, isFav: Bool?, isLike: Bool?) { + if let isFav{ + if let continueDataIndex = vm.continueWatchingData.firstIndex(where:{$0.id == id}) { + vm.continueWatchingData[continueDataIndex].markAsFavourite = isFav + continueWatchingCV.reloadItems(at: [IndexPath(row: continueDataIndex, section: 0)]) + } + + if let audioListDataIndex = vm.audioListData.firstIndex(where:{$0.id == id}) { + vm.audioListData[audioListDataIndex].markAsFavourite = isFav + audioListingTableView.reloadRows(at: [IndexPath(row: audioListDataIndex, section: 0)],with: .none) + K.GVar.reloadMyList = true + } + } + + if let isLike{ + if let continueDataIndex = vm.continueWatchingData.firstIndex(where:{$0.id == id}) { + vm.continueWatchingData[continueDataIndex].isLiked = isLike + continueWatchingCV.reloadItems(at: [IndexPath(row: continueDataIndex, section: 0)]) + } + + if let audioListDataIndex = vm.audioListData.firstIndex(where:{$0.id == id}) { + vm.audioListData[audioListDataIndex].isLiked = isLike + audioListingTableView.reloadRows(at: [IndexPath(row: audioListDataIndex, section: 0)],with: .none) + K.GVar.reloadMyList = true + } + } + } } // MARK: - TableView DataSource , Delegates @@ -89,56 +137,6 @@ extension AudioBookHomeVC : TableViewSRC{ 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) { /* Updated the top header data @@ -153,20 +151,8 @@ extension AudioBookHomeVC : TableViewSRC{ vcPush.modalPresentationStyle = .overCurrentContext vcPush.modalTransitionStyle = .crossDissolve vcPush.audioData = data + vcPush.delegate = self self.present(vcPush, animated: true) -// 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) } } @@ -192,24 +178,18 @@ extension AudioBookHomeVC : CollectionViewSRC{ func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let data = vm.continueWatchingData[indexPath.row] + if let audioListIndex = vm.audioListData.firstIndex(where:{$0.id == data.id}){ + vm.indexToLoad = audioListIndex + vm.setInitialData() + } + 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 + vcPush.delegate = self self.present(vcPush, animated: true) -// 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) } @@ -353,3 +333,25 @@ extension UINavigationBar { } } } + +extension CGPoint{ + + 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 + } + } + } +} diff --git a/WOKA/Audio Books/AudioBookHomeVM.swift b/WOKA/Audio Books/AudioBookHomeVM.swift index e43ec22..b5e27d4 100644 --- a/WOKA/Audio Books/AudioBookHomeVM.swift +++ b/WOKA/Audio Books/AudioBookHomeVM.swift @@ -34,9 +34,9 @@ class AudioBookHomeVM{ } func setInitialData(){ - if indexToLoad > continueWatchingData.count { - return - } +// if indexToLoad > continueWatchingData.count { +// return +// } let data = audioListData[indexToLoad] if let url = data.thumbnailPath{ @@ -146,7 +146,12 @@ class AudioBookHomeVM{ return } Utilities.dismissProgressHUD() - vc.toast(msg: error.localizedDescription , time: 2) + Utilities.alertWithBtnCompletion(title: "Error", msgBody: error.localizedDescription, okBtnStr: "Retry?", vc: self.vc) { isDone in + if isDone{ + self.getShowListing() + } + } +// vc.toast(msg: error.localizedDescription , time: 2) } } } diff --git a/WOKA/Audio Books/AudioBooks.storyboard b/WOKA/Audio Books/AudioBooks.storyboard index 7562d4d..e546a97 100644 --- a/WOKA/Audio Books/AudioBooks.storyboard +++ b/WOKA/Audio Books/AudioBooks.storyboard @@ -13,6 +13,9 @@ Exo2-Bold + + Exo2-Regular + @@ -76,6 +79,9 @@ + + + @@ -225,7 +231,7 @@ - + @@ -266,18 +272,33 @@ - + + + + + + + + + + + - + @@ -288,7 +309,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -357,6 +501,14 @@ + + + + + + + + @@ -370,7 +522,14 @@ + + + + + + + diff --git a/WOKA/Constants K/StoryBoard.swift b/WOKA/Constants K/StoryBoard.swift index aef5e49..abe7fdd 100644 --- a/WOKA/Constants K/StoryBoard.swift +++ b/WOKA/Constants K/StoryBoard.swift @@ -18,5 +18,6 @@ extension K{ static let sideBarNav = "SideBarNav" static let webSeries = "WebSeries" static let audioBooks = "AudioBooks" + static let Games = "Games" } } diff --git a/WOKA/Constants K/StoryBoardID.swift b/WOKA/Constants K/StoryBoardID.swift index 3976422..1b0e65c 100644 --- a/WOKA/Constants K/StoryBoardID.swift +++ b/WOKA/Constants K/StoryBoardID.swift @@ -73,5 +73,13 @@ extension K{ static let audioBookDetailsVC = "AudioBookDetailsVC" } + // MARK: - Games + + struct Games{ + static let gamesListVC = "GamesListVC" + static let gamesDetailVC = "GamesDetailVC" + static let gamesWebViewVC = "GamesWebViewVC" + } + } } diff --git a/WOKA/Games/Controller/GamesDetailVC.swift b/WOKA/Games/Controller/GamesDetailVC.swift new file mode 100644 index 0000000..9f02bef --- /dev/null +++ b/WOKA/Games/Controller/GamesDetailVC.swift @@ -0,0 +1,163 @@ +// +// GamesDetailVC.swift +// WOKA +// +// Created by MacBook Pro on 04/07/24. +// + +import UIKit + +class GamesDetailVC: UIViewController { + + @IBOutlet weak var watchingImage: UIImageView! + @IBOutlet weak var watchingTitle: UILabel! + @IBOutlet weak var watchingDesc: UITextView! + + @IBOutlet weak var addIcon: UIImageView! + @IBOutlet weak var addLabel: UILabel! + @IBOutlet weak var likeIcon: UIImageView! + @IBOutlet weak var likeLabel: UILabel! + @IBOutlet weak var totalLikes: UILabel! + + @IBOutlet weak var addView: UIView! + @IBOutlet weak var shareView: UIView! + @IBOutlet weak var likeView: UIView! + + var gameData : GamesListDM.GameDatum? + var delegate : ReloadSeriesFavLike? + var gameIndex = 0 + + override func viewDidLoad() { + super.viewDidLoad() + initView() + tapHandler() + } + + func initView(){ + if let gameData{ + if let url = gameData.thumbnailPath{ + watchingImage.imageURL(url, color: .white) + } + + totalLikes.text = gameData.likesCount?.toString() ?? "0" + if let like = gameData.isLiked{ + switch like{ + case true: + likeIcon.image = UIImage(systemName: "hand.thumbsup.fill") + likeLabel.text = "LIKED".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) + case false: + likeIcon.image = UIImage(systemName: "hand.thumbsup") + likeLabel.text = "LIKE".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) + } + } + + if let favourite = gameData.markAsFavourite{ + if favourite == true{ + addIcon.image = UIImage(systemName: "heart.fill") + addLabel.text = "ADDED".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) + }else{ + addIcon.image = UIImage(systemName: "heart") + addLabel.text = "ADD".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) + } + } + + if AuthFunc.shareInstance.getDefaultLanguage() == .english{ + if let englishData = gameData.contentMoreDetails?.filter({$0.languageMasterID == 1}).first{ + watchingTitle.text = englishData.title + if let desc = englishData.description?.replacingOccurrences(of: "
", 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 = gameData.contentMoreDetails?.filter({$0.languageMasterID == 2}).first{ + watchingTitle.text = hindiData.title + if let desc = hindiData.description?.replacingOccurrences(of: "
", 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 + } + } + } + } + } + + func tapHandler(){ + + self.view.addTapGesture { + self.dismiss(animated: true) + } + + addView.addTapGesture { [weak self] in + guard let self else{return} + + if let gameData{ + guard let showID = gameData.id, let isFav = gameData.markAsFavourite, let postType = gameData.contentMoreDetails?.first?.postType else{return} + + if isFav { + LikeFavCommonFunc.shareInstance.removeFavourite(postID: showID, postType: postType, categoryID: 0, vc: self) { isDone in + self.gameData?.markAsFavourite = false + K.GVar.reloadMyList = true + self.delegate?.updateRows(index: self.gameIndex, type: .favourite, isFav: false, isLike: nil) + self.initView() + } + }else{ + LikeFavCommonFunc.shareInstance.addFavourite(postID: showID, postType: postType, categoryID: 0, vc: self) { isDone in + self.gameData?.markAsFavourite = true + K.GVar.reloadMyList = true + self.delegate?.updateRows(index: self.gameIndex, type: .favourite, isFav: true, isLike: nil) + self.initView() + } + } + } + + } + + likeView.addTapGesture { [weak self] in + guard let self else{return} + + if let gameData{ + guard let showID = gameData.id, let isLiked = gameData.isLiked, let postType = gameData.contentMoreDetails?.first?.postType else{return} + + if isLiked{ + LikeFavCommonFunc.shareInstance.unlikePost(postID: showID, postType: postType, vc: self) { isDone in + self.gameData?.isLiked = false + K.GVar.reloadMyList = true + self.delegate?.updateRows(index: self.gameIndex, type: .liked, isFav: nil, isLike: false) + self.initView() + } + }else{ + LikeFavCommonFunc.shareInstance.likePost(postID: showID, postType: postType, vc: self) { isDone in + self.gameData?.isLiked = true + K.GVar.reloadMyList = true + self.delegate?.updateRows(index: self.gameIndex, type: .liked, isFav: nil, isLike: true) + self.initView() + } + } + } + + } + + shareView.addTapGesture { + print("share") + } + } + + @IBAction func playNowBtnTapped(_ sender: LocalisedElementsButton) { + let sb = UIStoryboard(name: K.StoryBoard.Games, bundle: nil) + let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Games.gamesWebViewVC) as! GamesWebViewVC + //https://wokastaging.in/wokagames/Games/html/WokaLudo/index.php + vcPush.url = self.gameData?.gameURL + vcPush.orientation = self.gameData?.screenOrientation + vcPush.modalTransitionStyle = .crossDissolve + vcPush.modalPresentationStyle = .fullScreen + self.present(vcPush, animated: true) + } + + @IBAction func closeBtnTapped(_ sender: UIButton) { + self.dismiss(animated: true) { + + } + } +} diff --git a/WOKA/Games/Controller/GamesListVC.swift b/WOKA/Games/Controller/GamesListVC.swift new file mode 100644 index 0000000..3da11b8 --- /dev/null +++ b/WOKA/Games/Controller/GamesListVC.swift @@ -0,0 +1,165 @@ +// +// GamesListVC.swift +// WOKA +// +// Created by MacBook Pro on 04/07/24. +// + +import UIKit + +class GamesListVC: UIViewController { + + + @IBOutlet weak var scrollView: UIScrollView! + @IBOutlet weak var headerHeight: NSLayoutConstraint! + @IBOutlet weak var gamesListingTableView: UITableView! + @IBOutlet weak var tableHeight: NSLayoutConstraint! + @IBOutlet weak var headerView: ShimmerEffectView! + @IBOutlet weak var headerImage: UIImageView! + @IBOutlet weak var headerTitleLabel: UILabel! + @IBOutlet weak var gamesLoadingView: ShimmerEffectView! + + var vm = GamesListVM() + + override func viewDidLoad() { + super.viewDidLoad() + vm.vc = self + vm.initView() + scrollView.delegate = self + self.title = "Games".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) + 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) + // Customize the navigation bar's appearance + self.navigationController?.setColor(color: .black) + } + + override func viewDidLayoutSubviews() { + vm.updateTableHeight() + } + +} + +// MARK: - TableView DataSource , Delegates + +extension GamesListVC : TableViewSRC{ + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return vm.gameData.count == 0 ? 2 : vm.gameData.count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: K.CellIdentifier.WebSeries.webSeriesShowListingCell) as! WebSeriesShowListingCell + + if vm.gameData.count == 0{ + cell.showShimmer() + }else{ + let data = vm.gameData[indexPath.row] + cell.setGameData(data: data) + cell.stopShimmer() + } + + cell.btnTapped = { [self] (type) -> Void in + vm.updateFavLikes(type: type, index: indexPath.row) + } + + return cell + } + + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + /* + Updated the top header data + */ + vm.indexToLoad = indexPath.row + vm.setHeaderData() + + let data = vm.gameData[indexPath.row] + + let sb = UIStoryboard(name: K.StoryBoard.Games, bundle: nil) + let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Games.gamesDetailVC) as! GamesDetailVC + vcPush.modalPresentationStyle = .overCurrentContext + vcPush.modalTransitionStyle = .crossDissolve + vcPush.gameIndex = indexPath.row + vcPush.gameData = data + vcPush.delegate = self + self.present(vcPush, animated: true) + } +} + +extension GamesListVC : ReloadSeriesFavLike{ + + func updateRows(index: Int, type: FavCellCLick, isFav: Bool?, isLike: Bool?) { + if let isFav{ + switch isFav{ + case true: + vm.gameData[index].markAsFavourite = true + gamesListingTableView.reloadRows(at: [IndexPath(row: index, section: 0)],with: .none) + case false: + vm.gameData[index].markAsFavourite = false + gamesListingTableView.reloadRows(at: [IndexPath(row: index, section: 0)],with: .none) + } + K.GVar.reloadMyList = true + } + + if let isLike{ + switch isLike{ + case true: + vm.gameData[index].isLiked = true + vm.gameData[index].likesCount! += 1 + gamesListingTableView.reloadRows(at: [IndexPath(row: index, section: 0)],with: .none) + case false: + vm.gameData[index].isLiked = false + vm.gameData[index].likesCount! -= 1 + gamesListingTableView.reloadRows(at: [IndexPath(row: index, section: 0)],with: .none) + } + K.GVar.reloadMyList = true + } + } +} + +// MARK: - Animating scrollView + +extension GamesListVC: 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() + } + } +} diff --git a/WOKA/Games/Controller/GamesWebViewVC.swift b/WOKA/Games/Controller/GamesWebViewVC.swift new file mode 100644 index 0000000..59e0731 --- /dev/null +++ b/WOKA/Games/Controller/GamesWebViewVC.swift @@ -0,0 +1,83 @@ +// +// GamesWebViewVC.swift +// WOKA +// +// Created by MacBook Pro on 04/07/24. +// + +import UIKit +import WebKit + +class GamesWebViewVC: UIViewController { + + var url : String? + var orientation : ScreenOrientation? + + @IBOutlet weak var webView: WKWebView! + + override func viewDidLoad() { + super.viewDidLoad() + + if let orientation, orientation == .landscape{ + rotateToLandsScapeDevice() + } + + guard let url else{return} + + let authUrl = url + "?tk=" + AuthFunc.shareInstance.getAccessToken() + + let link = URL(string: authUrl)! + let request = URLRequest(url: link) + webView.load(request) + } + + func rotateToLandsScapeDevice(){ + let appDelegate = UIApplication.shared.delegate as! AppDelegate + appDelegate.myOrientation = .landscapeRight + if #available(iOS 16.0, *) { + let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene + windowScene?.requestGeometryUpdate(.iOS(interfaceOrientations: UIInterfaceOrientationMask.landscapeRight)) + } else { + UIDevice.current.setValue(UIInterfaceOrientationMask.landscapeRight.rawValue, forKey: "orientation") + } + UIView.setAnimationsEnabled(true) + } + + func rotateToPotraitScapeDevice(){ + + let appDelegate = UIApplication.shared.delegate as! AppDelegate + appDelegate.myOrientation = .portrait + if #available(iOS 16.0, *) { + let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene + windowScene?.requestGeometryUpdate(.iOS(interfaceOrientations: UIInterfaceOrientationMask.portrait)) + } else { + UIDevice.current.setValue(UIInterfaceOrientationMask.landscapeRight.rawValue, forKey: "orientation") + } +// UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation") + UIView.setAnimationsEnabled(true) + } + + @IBAction func backBtnTapped(_ sender: UIButton) { + let sb = UIStoryboard(name: K.StoryBoard.customAlerts, bundle: nil) + let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.CustomAlerts.yesNoAlertVC) as! YesNoAlertVC + vcPush.mainTitleText = "Warning" + vcPush.contentLabel = "Clicking \"OK\" will exit you from the game. Are you sure you want to proceed?" + vcPush.yesBtnText = "OK" + vcPush.noBtnText = "Cancel" + vcPush.onDoneBlock = { mode in + switch mode{ + case .yes: + self.rotateToPotraitScapeDevice() + Timer.scheduledTimer(withTimeInterval: 1, repeats: false) { _ in + self.dismiss(animated: true) + } + case .no: + print("no") + } + } + vcPush.modalPresentationStyle = .overCurrentContext + vcPush.modalTransitionStyle = .crossDissolve + self.present(vcPush, animated: true) + } + +} diff --git a/WOKA/Games/Games.storyboard b/WOKA/Games/Games.storyboard new file mode 100644 index 0000000..f4b7232 --- /dev/null +++ b/WOKA/Games/Games.storyboard @@ -0,0 +1,558 @@ + + + + + + + + + + + + + + Exo2-Bold + + + Exo2-Regular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WOKA/Games/Model/GamesListDM.swift b/WOKA/Games/Model/GamesListDM.swift new file mode 100644 index 0000000..b155aa3 --- /dev/null +++ b/WOKA/Games/Model/GamesListDM.swift @@ -0,0 +1,78 @@ +// +// GamesListDM.swift +// WOKA +// +// Created by MacBook Pro on 04/07/24. +// + +import Foundation + +enum ScreenOrientation: String, Codable { + case landscape = "Landscape" + case portrait = "Portrait" +} +// MARK: - GamesListDM +struct GamesListDM: Codable { + let gameData: [GameDatum]? + let totalRecords: Int? + + enum CodingKeys: String, CodingKey { + case gameData = "game_data" + case totalRecords = "total_records" + } + + // MARK: - GameDatum + struct GameDatum: Codable { + let id: Int? + let title, description: String? + let gameURL: String? + let screenOrientation: ScreenOrientation? + let thumbnailPath: String? + let categoryMasterID, ageRangeMasterID: String? + let releaseDate: String? + let languageMasterID: Int? + let genderMasterID: String? + let contentMoreDetails: [ContentMoreDetail]? +// let categoryData, ageRangeData, genderData: [JSONAny]? + var markAsFavourite, isLiked: Bool? + var likesCount, bookmarkCount: Int? + + enum CodingKeys: String, CodingKey { + case id, title, description + case gameURL = "game_url" + case screenOrientation = "screen_orientation" + case thumbnailPath = "thumbnail_path" + case categoryMasterID = "category_master_id" + case ageRangeMasterID = "age_range_master_id" + case releaseDate = "release_date" + case languageMasterID = "language_master_id" + case genderMasterID = "gender_master_id" + case contentMoreDetails = "content_more_details" +// case categoryData = "category_data" +// case ageRangeData = "age_range_data" +// case genderData = "gender_data" + case markAsFavourite = "mark_as_favourite" + case isLiked = "is_liked" + case likesCount = "likes_count" + case bookmarkCount = "bookmark_count" + } + } + + // MARK: - ContentMoreDetail + struct ContentMoreDetail: Codable { + let id, contentID, postType, languageMasterID: Int? + let title, description, tagsKeywords: String? + let url: String? + + enum CodingKeys: String, CodingKey { + case id + case contentID = "content_id" + case postType = "post_type" + case languageMasterID = "language_master_id" + case title, description + case tagsKeywords = "tags_keywords" + case url + } + } + +} diff --git a/WOKA/Games/ViewModel/GamesListVM.swift b/WOKA/Games/ViewModel/GamesListVM.swift new file mode 100644 index 0000000..7c891a2 --- /dev/null +++ b/WOKA/Games/ViewModel/GamesListVM.swift @@ -0,0 +1,160 @@ +// +// GamesListVM.swift +// WOKA +// +// Created by MacBook Pro on 04/07/24. +// + +import UIKit +import Alamofire + +class GamesListVM{ + + weak var vc : GamesListVC! + var gameData = [GamesListDM.GameDatum]() + var indexToLoad = 0 + + func initView(){ + setupCell() + let color1 = #colorLiteral(red: 0.8, green: 0.6078431373, blue: 0.1098039216, alpha: 1) + let color2 = #colorLiteral(red: 0.8, green: 0.2901960784, blue: 0.1098039216, alpha: 1) + self.vc.view.applyGradient(colors: [color1,color2], startPoint: .Point.left.point , endPoint: .Point.right.point) + startShimmer() + getGamesListing() + } + + func setupCell(){ + vc.gamesListingTableView.register(UINib(nibName: K.CellIdentifier.WebSeries.webSeriesShowListingCell, bundle: nil), forCellReuseIdentifier: K.CellIdentifier.WebSeries.webSeriesShowListingCell) + vc.gamesListingTableView.delegate = vc.self + vc.gamesListingTableView.dataSource = vc.self + } + + func startShimmer(){ + vc.headerView.startShimmer() + vc.gamesLoadingView.startShimmer() + } + + func stopShimmer(){ + vc.headerView.stopShimmer() + vc.gamesLoadingView.stopShimmer() + } + + func setHeaderData(){ + let data = gameData[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 updateTableHeight(){ + self.vc.tableHeight.constant = self.vc.gamesListingTableView.contentSize.height + 100 + self.vc.gamesListingTableView.layoutIfNeeded() + self.vc.tableHeight.constant = self.vc.gamesListingTableView.contentSize.height + } + + // MARK: - Get Games Data + + func getGamesListing(){ + let headers : HTTPHeaders = ["access-token" : AuthFunc.shareInstance.getAccessToken()] + NetworkManager.shareInstance.apiRequest(url: APIEndPoints.Games.game_listing, method: .post,headers: headers) { [weak self](result : Result, 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?.gameData else{return} + self.gameData.removeAll() + self.gameData = data + self.vc.gamesListingTableView.reloadData() + self.vc.tableHeight.constant = self.vc.gamesListingTableView.contentSize.height + 100 + self.vc.gamesListingTableView.layoutIfNeeded() + self.vc.tableHeight.constant = self.vc.gamesListingTableView.contentSize.height + self.setHeaderData() + self.stopShimmer() + default: + break + } + case .failure(let error): + guard let self else{ + Utilities.dismissProgressHUD() + return + } + Utilities.dismissProgressHUD() + Utilities.alertWithBtnCompletion(title: "Error", msgBody: error.localizedDescription, okBtnStr: "Retry?", vc: self.vc) { isDone in + if isDone{ + self.getGamesListing() + } + } + } + } + } + + // MARK: - Update Fav Likes + + func updateFavLikes(type : FavCellCLick, index : Int){ + let data = gameData[index] + 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{ + gameData[index].markAsFavourite = false + vc.gamesListingTableView.reloadRows(at: [IndexPath(row: index, section: 0)],with: .none) + K.GVar.reloadMyList = true + } + } + }else{ + LikeFavCommonFunc.shareInstance.addFavourite(postID: postID, postType: postType, categoryID: 0, vc: self.vc) { [unowned self] isDone in + if isDone{ + gameData[index].markAsFavourite = true + vc.gamesListingTableView.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.vc) { [unowned self] isDone in + if isDone{ + gameData[index].isLiked = false + gameData[index].likesCount! -= 1 + vc.gamesListingTableView.reloadRows(at: [IndexPath(row: index, section: 0)],with: .none) + K.GVar.reloadMyList = true + } + } + }else{ + LikeFavCommonFunc.shareInstance.likePost(postID: postID, postType: postType, vc: self.vc){ [unowned self] isDone in + if isDone{ + gameData[index].isLiked = true + gameData[index].likesCount! += 1 + vc.gamesListingTableView.reloadRows(at: [IndexPath(row: index, section: 0)],with: .none) + K.GVar.reloadMyList = true + } + } + } + } + } + +} diff --git a/WOKA/Localized Module/hi.lproj/Localizable.strings b/WOKA/Localized Module/hi.lproj/Localizable.strings index 0f64712..063f227 100644 --- a/WOKA/Localized Module/hi.lproj/Localizable.strings +++ b/WOKA/Localized Module/hi.lproj/Localizable.strings @@ -232,3 +232,14 @@ "SHARE" = "शेयर"; "LIKE" = "पसंद"; "LIKED" = "पसंदिता"; + +/* + Audio Books + */ +"LISTEN & ENJOY" = "सुनें और आनंद लें"; +"LISTEN" = "सुनें"; + +/* + Games + */ +"HAVE A FUN TIME" = "आनंद करने का समय"; diff --git a/WOKA/Network Adapter/APIEndPoints.swift b/WOKA/Network Adapter/APIEndPoints.swift index 756e4fc..4140375 100644 --- a/WOKA/Network Adapter/APIEndPoints.swift +++ b/WOKA/Network Adapter/APIEndPoints.swift @@ -94,6 +94,11 @@ struct APIEndPoints { static let listen_audio_listing = makeURL(path: "listen_audio_listing") } + struct Games{ + static let game_listing = makeURL(path: "game_listing") + static let get_token_to_auth_player = makeURL(path: "get_token_to_auth_player") + } + // Other endpoint categories... struct Links { static let privacyPolicy = "https://www.wokaland.com/privacy-policy/" diff --git a/WOKA/Theme/Base.lproj/Theme.storyboard b/WOKA/Theme/Base.lproj/Theme.storyboard index 2cd316b..d48130d 100644 --- a/WOKA/Theme/Base.lproj/Theme.storyboard +++ b/WOKA/Theme/Base.lproj/Theme.storyboard @@ -215,7 +215,7 @@ - + @@ -235,7 +235,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -284,26 +284,36 @@ - - + + - - - - + + + + + + + + + + - + + + + + - + @@ -325,7 +335,7 @@ - + @@ -357,22 +367,20 @@ - - - - + + - - + + @@ -412,6 +420,7 @@ + @@ -421,6 +430,7 @@ + @@ -445,6 +455,7 @@ + diff --git a/WOKA/Theme/Controller/PlayerVC.swift b/WOKA/Theme/Controller/PlayerVC.swift index cd0e96a..0d236a8 100644 --- a/WOKA/Theme/Controller/PlayerVC.swift +++ b/WOKA/Theme/Controller/PlayerVC.swift @@ -107,17 +107,17 @@ class PlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate { player.play() case .webSeries: if videoIndex == 0{ - player.play() + player.seek(to: 0) }else{ - player.play() - player.stop() + player.seek(to: 1) player.nextUpPlaylistIndex = videoIndex ?? 0 player.next() } case .trailer: player.play() - case .continueWatching: - player.play() + case .continueWatching,.audioBooks, .games: + player.seek(to: 0) +// player.play() case nil: break } diff --git a/WOKA/Theme/Controller/ThemeOneVC.swift b/WOKA/Theme/Controller/ThemeOneVC.swift index fe4f69c..8d7cebf 100644 --- a/WOKA/Theme/Controller/ThemeOneVC.swift +++ b/WOKA/Theme/Controller/ThemeOneVC.swift @@ -28,6 +28,7 @@ class ThemeOneVC: UIViewController { @IBOutlet weak var moonImage: UIImageView! @IBOutlet weak var moreStack: UIStackView! @IBOutlet weak var bottomArrow: UIImageView! + @IBOutlet weak var gamesView: UIView! var timer: Timer? diff --git a/WOKA/Theme/ViewModel/ThemeOneVM.swift b/WOKA/Theme/ViewModel/ThemeOneVM.swift index 01a2abc..a06bad3 100644 --- a/WOKA/Theme/ViewModel/ThemeOneVM.swift +++ b/WOKA/Theme/ViewModel/ThemeOneVM.swift @@ -135,6 +135,15 @@ class ThemeOneVM{ vc.navigationController?.pushViewController(vcPush, animated: true) } } + + vc.gamesView.addTapGesture { + ViewButtonAnimation.sharedInstance.btnTapped(in: self.vc, view: self.vc.gamesView) { [weak self] in + guard let self else{return} + let sb = UIStoryboard(name: K.StoryBoard.Games, bundle: nil) + let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Games.gamesListVC) as! GamesListVC + vc.navigationController?.pushViewController(vcPush, animated: true) + } + } } // MARK: - Animate Clouds and LiveTV diff --git a/WOKA/WebSeries/Controller/WebSeriesSeasonVC.swift b/WOKA/WebSeries/Controller/WebSeriesSeasonVC.swift index aa9e594..672412f 100644 --- a/WOKA/WebSeries/Controller/WebSeriesSeasonVC.swift +++ b/WOKA/WebSeries/Controller/WebSeriesSeasonVC.swift @@ -53,7 +53,10 @@ class WebSeriesSeasonVC: UIViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) navigationController?.setNavigationBarHidden(false, animated: animated) - self.navigationController?.setColor(color: .black) + } + + override func viewDidAppear(_ animated: Bool) { + self.navigationController?.setColor(color: .white) } override func viewWillDisappear(_ animated: Bool) { diff --git a/WOKA/WebSeries/Controller/WebSeriesVC.swift b/WOKA/WebSeries/Controller/WebSeriesVC.swift index 4162c08..a7e3e2d 100644 --- a/WOKA/WebSeries/Controller/WebSeriesVC.swift +++ b/WOKA/WebSeries/Controller/WebSeriesVC.swift @@ -16,7 +16,7 @@ class WebSeriesVC: UIViewController { @IBOutlet weak var headerView: ShimmerEffectView! @IBOutlet weak var masilaTrailerView: ShimmerEffectView! - + @IBOutlet weak var videoLanguageView: ShimmerEffectView! @IBOutlet weak var topLabel: UILabel! @@ -156,6 +156,7 @@ extension WebSeriesVC : TableViewSRC{ } } } + K.GVar.reloadMyList = true } } diff --git a/WOKA/WebSeries/JWPlayerManager.swift b/WOKA/WebSeries/JWPlayerManager.swift index bafdddc..f2ecb4a 100644 --- a/WOKA/WebSeries/JWPlayerManager.swift +++ b/WOKA/WebSeries/JWPlayerManager.swift @@ -13,6 +13,8 @@ enum VideoContentType{ case webSeries case trailer case continueWatching + case audioBooks + case games } struct JwPlayerItemCreate{ @@ -81,7 +83,7 @@ class JWPlayerManager { .title(liveStreamItem.titles ?? "Trailer") .build() items.append(item) - case .continueWatching: + case .continueWatching, .audioBooks, .games: guard let liveStreamItem = playerItems.first else { print("Invalid live stream URL") return diff --git a/WOKA/WebSeries/View/WebSeriesShowListingCell.swift b/WOKA/WebSeries/View/WebSeriesShowListingCell.swift index e3ce573..f1ae44c 100644 --- a/WOKA/WebSeries/View/WebSeriesShowListingCell.swift +++ b/WOKA/WebSeries/View/WebSeriesShowListingCell.swift @@ -70,13 +70,6 @@ class WebSeriesShowListingCell: UITableViewCell { }else{ favBtn.setImage(UIImage(named: "FavouriteRemove"), for: .normal) } -// switch favourite{ -// case true: -// favBtn.setImage(UIImage(systemName: "heart.fill"), for: .normal) -// case false: -// favBtn.setImage(UIImage(systemName: "heart"), for: .normal) -// -// } } } @@ -111,6 +104,37 @@ class WebSeriesShowListingCell: UITableViewCell { } } + func setGameData(data: GamesListDM.GameDatum){ + //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: diff --git a/WOKA/WebSeries/ViewModel/WebSeriesSeasonVM.swift b/WOKA/WebSeries/ViewModel/WebSeriesSeasonVM.swift index ef034bf..7cdf97d 100644 --- a/WOKA/WebSeries/ViewModel/WebSeriesSeasonVM.swift +++ b/WOKA/WebSeries/ViewModel/WebSeriesSeasonVM.swift @@ -27,10 +27,17 @@ class WebSeriesSeasonVM{ var indexSelected : Int? func initView(){ + let color1 = #colorLiteral(red: 0.5921568627, green: 0.2588235294, blue: 0.8941176471, alpha: 1) + let color2 = #colorLiteral(red: 0.368627451, green: 0.1215686275, blue: 0.768627451, alpha: 1) + self.vc.view.applyGradient(colors: [color1,color2], startPoint: .Point.left.point , endPoint: .Point.right.point) + getSeasonListing() setupCell() setShowData() - + handleTapGesture() + } + + func handleTapGesture(){ vc.addView.addTapGesture { [weak self] in guard let self ,let indexSelected, let categoryID, let showData, let showID = showData.id, let isFav = showData.markAsFavourite, let postType = showData.contentMoreDetails?.first?.postType else{return} diff --git a/WOKA/WebSeries/WebSeries.storyboard b/WOKA/WebSeries/WebSeries.storyboard index a281065..9d2ccd5 100644 --- a/WOKA/WebSeries/WebSeries.storyboard +++ b/WOKA/WebSeries/WebSeries.storyboard @@ -379,7 +379,7 @@ - +
- + 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. @@ -967,7 +967,7 @@
- +