- Updated my list with guest user

- Handled sidebar logout if user is guest
- Handled free sign in my list
- Handled close button in my list for guest user to navigate to home
- Added check for guest user in web-series listing
- Added a universal popup for login for guest type user, also addd touch handling if user clicks outside of the box
This commit is contained in:
2024-07-16 19:56:09 +05:30
parent 6244317f3a
commit 850593c0c8
23 changed files with 451 additions and 91 deletions

View File

@@ -154,6 +154,7 @@
52CA28FC2BE11A0400708B49 /* UserIntrestVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52CA28FB2BE11A0400708B49 /* UserIntrestVM.swift */; };
52CC38C32BDF812F00B74C3E /* LocalisedElements.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52CC38C22BDF812F00B74C3E /* LocalisedElements.swift */; };
52CCD7B02C1AF0F80078BD65 /* RadioVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52CCD7AF2C1AF0F80078BD65 /* RadioVC.swift */; };
52D23F112C465E6F003E743A /* LogoutPopupVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52D23F102C465E6F003E743A /* LogoutPopupVC.swift */; };
52D2F3D82C24043D009E52FF /* ShimmerEffectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52D2F3D72C24043D009E52FF /* ShimmerEffectView.swift */; };
52D6A2462C21A29800145908 /* ContinueWatchingDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52D6A2452C21A29800145908 /* ContinueWatchingDM.swift */; };
52D6A2482C21A3A500145908 /* WebSeriesVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52D6A2472C21A3A500145908 /* WebSeriesVM.swift */; };
@@ -178,7 +179,7 @@
52FDBA7D2BFF481A009D7AC7 /* ThemeOneVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52FDBA7C2BFF481A009D7AC7 /* ThemeOneVM.swift */; };
52FDDAB52BF34DC300E037C1 /* YesNoAlertVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52FDDAB42BF34DC300E037C1 /* YesNoAlertVC.swift */; };
619A5A1BD8BD968ADC83C106 /* Pods_WOKA.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BBA543A4216400A2864E3D3E /* Pods_WOKA.framework */; };
9C007F202C255DF200F798C2 /* SeasonEpisodeListingDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C007F1F2C255DF200F798C2 /* SeasonEpisodeListingDM.swift */; };
9C007F202C255DF200F798C2 /* EpisodeListingDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C007F1F2C255DF200F798C2 /* EpisodeListingDM.swift */; };
9C007F232C25603800F798C2 /* WebSeriesEpisodeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C007F212C25603800F798C2 /* WebSeriesEpisodeCell.swift */; };
9C007F242C25603800F798C2 /* WebSeriesEpisodeCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9C007F222C25603800F798C2 /* WebSeriesEpisodeCell.xib */; };
9C0A853F2BEE35340093783D /* ForgotPassDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C0A853E2BEE35340093783D /* ForgotPassDM.swift */; };
@@ -438,6 +439,7 @@
52CA28FB2BE11A0400708B49 /* UserIntrestVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserIntrestVM.swift; sourceTree = "<group>"; };
52CC38C22BDF812F00B74C3E /* LocalisedElements.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalisedElements.swift; sourceTree = "<group>"; };
52CCD7AF2C1AF0F80078BD65 /* RadioVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioVC.swift; sourceTree = "<group>"; };
52D23F102C465E6F003E743A /* LogoutPopupVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogoutPopupVC.swift; sourceTree = "<group>"; };
52D2F3D72C24043D009E52FF /* ShimmerEffectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShimmerEffectView.swift; sourceTree = "<group>"; };
52D6A2452C21A29800145908 /* ContinueWatchingDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContinueWatchingDM.swift; sourceTree = "<group>"; };
52D6A2472C21A3A500145908 /* WebSeriesVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebSeriesVM.swift; sourceTree = "<group>"; };
@@ -463,7 +465,7 @@
52FDBA7A2BFF2712009D7AC7 /* AuthFuncTimeHandling.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthFuncTimeHandling.swift; sourceTree = "<group>"; };
52FDBA7C2BFF481A009D7AC7 /* ThemeOneVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemeOneVM.swift; sourceTree = "<group>"; };
52FDDAB42BF34DC300E037C1 /* YesNoAlertVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YesNoAlertVC.swift; sourceTree = "<group>"; };
9C007F1F2C255DF200F798C2 /* SeasonEpisodeListingDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeasonEpisodeListingDM.swift; sourceTree = "<group>"; };
9C007F1F2C255DF200F798C2 /* EpisodeListingDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EpisodeListingDM.swift; sourceTree = "<group>"; };
9C007F212C25603800F798C2 /* WebSeriesEpisodeCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebSeriesEpisodeCell.swift; sourceTree = "<group>"; };
9C007F222C25603800F798C2 /* WebSeriesEpisodeCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WebSeriesEpisodeCell.xib; sourceTree = "<group>"; };
9C0A853E2BEE35340093783D /* ForgotPassDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ForgotPassDM.swift; sourceTree = "<group>"; };
@@ -911,6 +913,7 @@
5259542D2BEA393700191286 /* AlertCustomVC.swift */,
5259542F2BEA394300191286 /* CustomAlerts.storyboard */,
52FDDAB42BF34DC300E037C1 /* YesNoAlertVC.swift */,
52D23F102C465E6F003E743A /* LogoutPopupVC.swift */,
);
path = Alerts;
sourceTree = "<group>";
@@ -1167,7 +1170,7 @@
52D6A24D2C22B3AB00145908 /* WebSeriesShowListDM.swift */,
52D6A2532C22B93F00145908 /* CategoryListingDM.swift */,
528E5F1A2C24531200E33E4E /* SeasonListingDM.swift */,
9C007F1F2C255DF200F798C2 /* SeasonEpisodeListingDM.swift */,
9C007F1F2C255DF200F798C2 /* EpisodeListingDM.swift */,
52AC2D242C295A7900337473 /* TeaserDM.swift */,
);
path = Model;
@@ -1769,7 +1772,7 @@
52D774EB2BDFC0BF001D87DE /* OTPVC.swift in Sources */,
9C8446872C40FC6E003E3E53 /* AVPlayerTesting.swift in Sources */,
52AF71F42C36C40B00BC5972 /* GamesWebViewVC.swift in Sources */,
9C007F202C255DF200F798C2 /* SeasonEpisodeListingDM.swift in Sources */,
9C007F202C255DF200F798C2 /* EpisodeListingDM.swift in Sources */,
52D2F3D82C24043D009E52FF /* ShimmerEffectView.swift in Sources */,
9C27E16F2BDB866500EC1DA9 /* CellIdentifier.swift in Sources */,
52BC3BF22C170264002FACA6 /* MoreVM.swift in Sources */,
@@ -1789,6 +1792,7 @@
523ED25E2BDA2BC700CFED02 /* AppDelegate.swift in Sources */,
9C7939132C0EFCAE00F5D6E6 /* FaqVM.swift in Sources */,
52D774ED2BDFC13F001D87DE /* OTPVM.swift in Sources */,
52D23F112C465E6F003E743A /* LogoutPopupVC.swift in Sources */,
525327D62BFCC23600F64283 /* SideMenuVM.swift in Sources */,
9CBCB2A32BE50C95007D7934 /* ResetPassUserNameVC.swift in Sources */,
52A3F6A52BECBA8D0000BB0B /* LinkedChildDM.swift in Sources */,

View File

@@ -257,6 +257,136 @@
</objects>
<point key="canvasLocation" x="-82" y="4"/>
</scene>
<!--Logout PopupVC-->
<scene sceneID="OJT-CW-wma">
<objects>
<viewController storyboardIdentifier="LogoutPopupVC" id="v2P-Rh-60n" customClass="LogoutPopupVC" customModule="WOKA" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="HJZ-tC-Ei6">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view alpha="0.5" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="U8A-qc-omm">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="25" translatesAutoresizingMaskIntoConstraints="NO" id="aAI-cp-r6i" userLabel="GuestLoginStack">
<rect key="frame" x="25" y="331.33333333333331" width="343" height="214.66666666666669"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="ZZ5-cb-qPp">
<rect key="frame" x="15" y="15" width="313" height="41"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="AYl-v6-e0E">
<rect key="frame" x="0.0" y="0.0" width="313" height="30"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Continue to WOKA" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Goz-WU-5j7" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="313" height="30"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" name="TextDarkBlue"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3kZ-SQ-8j0">
<rect key="frame" x="283" y="0.0" width="30" height="30"/>
<constraints>
<constraint firstAttribute="width" secondItem="3kZ-SQ-8j0" secondAttribute="height" multiplier="1:1" id="UwD-6K-eyY"/>
</constraints>
<color key="tintColor" name="TextDarkBlue"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="xmark.circle" catalog="system"/>
<connections>
<action selector="closeBtnTapped:" destination="v2P-Rh-60n" eventType="touchUpInside" id="io1-2E-CVO"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="3kZ-SQ-8j0" secondAttribute="bottom" id="Ct6-KL-cCM"/>
<constraint firstItem="Goz-WU-5j7" firstAttribute="top" secondItem="AYl-v6-e0E" secondAttribute="top" id="GUV-9B-bjJ"/>
<constraint firstAttribute="height" constant="30" id="Zaf-bd-eq6"/>
<constraint firstAttribute="trailing" secondItem="Goz-WU-5j7" secondAttribute="trailing" id="daK-qF-Dg0"/>
<constraint firstAttribute="bottom" secondItem="Goz-WU-5j7" secondAttribute="bottom" id="iek-4F-fDJ"/>
<constraint firstAttribute="trailing" secondItem="3kZ-SQ-8j0" secondAttribute="trailing" id="wl8-90-hzm"/>
<constraint firstItem="3kZ-SQ-8j0" firstAttribute="top" secondItem="AYl-v6-e0E" secondAttribute="top" id="xRH-s0-cqy"/>
<constraint firstItem="Goz-WU-5j7" firstAttribute="leading" secondItem="AYl-v6-e0E" secondAttribute="leading" id="xUe-tz-gqi"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sXs-Db-s9I">
<rect key="frame" x="0.0" y="40" width="313" height="1"/>
<color key="backgroundColor" name="WelcomeBlue"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="oOa-xb-9M3"/>
</constraints>
</view>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="To continue, please sign in for more adventures and features..." lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Wnh-Ak-ZMI" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="15" y="81" width="313" height="38.666666666666657"/>
<fontDescription key="fontDescription" name="Exo2-Regular" family="Exo 2" pointSize="16"/>
<color key="textColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="40" translatesAutoresizingMaskIntoConstraints="NO" id="WxA-c4-4B2">
<rect key="frame" x="15" y="144.66666666666669" width="313" height="50"/>
<subviews>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nCe-4s-FAe" customClass="LocalisedElementsButton" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="86.666666666666686" y="0.0" width="140" height="50"/>
<color key="backgroundColor" red="0.36862745099999999" green="0.1215686275" blue="0.76862745099999996" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="140" id="ZFP-mt-TZF"/>
</constraints>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Free Sign In">
<fontDescription key="titleFontDescription" name="Exo2-Medium" family="Exo 2" pointSize="18"/>
</buttonConfiguration>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="25"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="freeSignInTapped:" destination="v2P-Rh-60n" eventType="touchUpInside" id="lpa-Uq-Gzg"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="50" id="8gu-kz-5MK"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</stackView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<edgeInsets key="layoutMargins" top="15" left="15" bottom="20" right="15"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="15"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</stackView>
</subviews>
<viewLayoutGuide key="safeArea" id="v6V-y2-Smt"/>
<constraints>
<constraint firstItem="U8A-qc-omm" firstAttribute="top" secondItem="HJZ-tC-Ei6" secondAttribute="top" id="NzD-BF-SeJ"/>
<constraint firstItem="aAI-cp-r6i" firstAttribute="centerY" secondItem="v6V-y2-Smt" secondAttribute="centerY" id="RDo-Ce-21g"/>
<constraint firstItem="aAI-cp-r6i" firstAttribute="leading" secondItem="v6V-y2-Smt" secondAttribute="leading" constant="25" id="WFf-Og-4BO"/>
<constraint firstAttribute="trailing" secondItem="aAI-cp-r6i" secondAttribute="trailing" constant="25" id="dUt-OS-o2G"/>
<constraint firstItem="U8A-qc-omm" firstAttribute="trailing" secondItem="v6V-y2-Smt" secondAttribute="trailing" id="eKH-zD-26k"/>
<constraint firstItem="U8A-qc-omm" firstAttribute="leading" secondItem="v6V-y2-Smt" secondAttribute="leading" id="f5B-v9-LLK"/>
<constraint firstAttribute="bottom" secondItem="U8A-qc-omm" secondAttribute="bottom" id="xCx-Kc-wb5"/>
</constraints>
</view>
<connections>
<outlet property="guestLoginStack" destination="aAI-cp-r6i" id="V1a-Mg-jbB"/>
<outlet property="outerView" destination="U8A-qc-omm" id="yf4-kw-gqy"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="6Uw-cR-jW4" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="572" y="4"/>
</scene>
</scenes>
<resources>
<image name="xmark.circle" catalog="system" width="128" height="123"/>

View File

@@ -0,0 +1,35 @@
//
// LogoutPopupVC.swift
// WOKA
//
// Created by MacBook Pro on 16/07/24.
//
import UIKit
class LogoutPopupVC: UIViewController {
@IBOutlet weak var outerView: UIView!
@IBOutlet weak var guestLoginStack: UIStackView!
override func viewDidLoad() {
super.viewDidLoad()
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(handleTap(_:)))
outerView.addGestureRecognizer(tapGesture)
}
@objc func handleTap(_ gesture: UITapGestureRecognizer) {
let location = gesture.location(in: outerView)
if !guestLoginStack.frame.contains(location) {
self.dismiss(animated: true)
}
}
@IBAction func closeBtnTapped(_ sender: UIButton) {
self.dismiss(animated: true)
}
@IBAction func freeSignInTapped(_ sender: LocalisedElementsButton) {
UIApplication.setRootView(LoginNavVC.instantiate(from: .AuthenticationSB))
}
}

View File

@@ -47,6 +47,8 @@ class AudioBookDetailsVC : UIViewController{
func tapHandler(){
addView.addTapGesture { [weak self] in
guard let self else{return}
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
if let audioData{
guard let showID = audioData.id, let isFav = audioData.markAsFavourite, let postType = audioData.contentMoreDetails?.first?.postType else{return}
@@ -92,7 +94,8 @@ class AudioBookDetailsVC : UIViewController{
likeView.addTapGesture { [weak self] in
guard let self else{return}
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
if let audioData{
guard let showID = audioData.id, let isLiked = audioData.isLiked, let postType = audioData.contentMoreDetails?.first?.postType else{return}

View File

@@ -37,6 +37,7 @@ extension K{
struct CustomAlerts{
static let alertCustomVC = "AlertCustomVC"
static let yesNoAlertVC = "YesNoAlertVC"
static let logoutPopupVC = "LogoutPopupVC"
}
struct Theme{

View File

@@ -91,6 +91,7 @@ class GamesDetailVC: UIViewController {
addView.addTapGesture { [weak self] in
guard let self else{return}
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
if let gameData{
guard let showID = gameData.id, let isFav = gameData.markAsFavourite, let postType = gameData.contentMoreDetails?.first?.postType else{return}
@@ -116,7 +117,8 @@ class GamesDetailVC: UIViewController {
likeView.addTapGesture { [weak self] in
guard let self else{return}
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
if let gameData{
guard let showID = gameData.id, let isLiked = gameData.isLiked, let postType = gameData.contentMoreDetails?.first?.postType else{return}

View File

@@ -28,6 +28,9 @@ class MyListVC: UIViewController{
@IBOutlet weak var scrollView: UIScrollView!
@IBOutlet weak var gradientView: UIView!
@IBOutlet weak var guestLoginView: UIView!
@IBOutlet weak var guestLoginStack: UIStackView!
var vm = MyListVM()
override func viewDidLoad() {
@@ -75,6 +78,9 @@ class MyListVC: UIViewController{
self.tabBarController?.selectedIndex = 0
}
@IBAction func freeSignIn(_ sender: LocalisedElementsButton) {
UIApplication.setRootView(LoginNavVC.instantiate(from: .AuthenticationSB))
}
}
// MARK: - CollectionView Delegate

View File

@@ -16,6 +16,9 @@
<array key="Exo2-Medium.ttf">
<string>Exo2-Medium</string>
</array>
<array key="Exo2-Regular.ttf">
<string>Exo2-Regular</string>
</array>
<array key="Exo2-SemiBold.ttf">
<string>Exo2-SemiBold</string>
</array>
@@ -892,8 +895,8 @@
<action selector="sideBarBtnTapped:" destination="55l-Gk-Npk" eventType="touchUpInside" id="L0r-44-zYU"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Favourites" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jbL-QO-JJl" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="70" y="74.666666666666671" width="111.33333333333331" height="26.666666666666671"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="FAVORITES" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jbL-QO-JJl" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="70" y="74.666666666666671" width="113.66666666666669" height="26.666666666666671"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="22"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
@@ -1109,10 +1112,112 @@
<viewLayoutGuide key="contentLayoutGuide" id="ac6-o2-deF"/>
<viewLayoutGuide key="frameLayoutGuide" id="ijh-ix-uLc"/>
</scrollView>
<view alpha="0.59999999999999998" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ygH-wj-cLk">
<rect key="frame" x="0.0" y="116" width="430" height="733"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<stackView hidden="YES" opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="25" translatesAutoresizingMaskIntoConstraints="NO" id="Dau-7f-0vb" userLabel="GuestLoginStack">
<rect key="frame" x="20" y="346.66666666666669" width="390" height="214.66666666666669"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="1Ae-HV-40N">
<rect key="frame" x="15" y="15" width="360" height="41"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UGN-nI-FTc">
<rect key="frame" x="0.0" y="0.0" width="360" height="30"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Continue to WOKA" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zUB-EI-c2Q" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="360" height="30"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" name="TextDarkBlue"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4Ln-Kh-7mE">
<rect key="frame" x="330" y="0.0" width="30" height="30"/>
<constraints>
<constraint firstAttribute="width" secondItem="4Ln-Kh-7mE" secondAttribute="height" multiplier="1:1" id="fCF-KL-2CN"/>
</constraints>
<color key="tintColor" name="TextDarkBlue"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="xmark.circle" catalog="system"/>
<connections>
<action selector="backBtntapped:" destination="55l-Gk-Npk" eventType="touchUpInside" id="jgR-is-2bc"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="zUB-EI-c2Q" firstAttribute="top" secondItem="UGN-nI-FTc" secondAttribute="top" id="0dY-k9-Lu8"/>
<constraint firstItem="4Ln-Kh-7mE" firstAttribute="top" secondItem="UGN-nI-FTc" secondAttribute="top" id="BQN-Y0-cuH"/>
<constraint firstAttribute="bottom" secondItem="zUB-EI-c2Q" secondAttribute="bottom" id="FZF-Ux-NQM"/>
<constraint firstAttribute="trailing" secondItem="zUB-EI-c2Q" secondAttribute="trailing" id="Mtz-xZ-hbr"/>
<constraint firstAttribute="trailing" secondItem="4Ln-Kh-7mE" secondAttribute="trailing" id="Qrd-R3-puP"/>
<constraint firstItem="zUB-EI-c2Q" firstAttribute="leading" secondItem="UGN-nI-FTc" secondAttribute="leading" id="nDy-Cr-caO"/>
<constraint firstAttribute="bottom" secondItem="4Ln-Kh-7mE" secondAttribute="bottom" id="rk6-Gg-Stl"/>
<constraint firstAttribute="height" constant="30" id="xjX-Wf-osR"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ZfH-yD-dtw">
<rect key="frame" x="0.0" y="40" width="360" height="1"/>
<color key="backgroundColor" name="WelcomeBlue"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="T0c-lY-zr5"/>
</constraints>
</view>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="To continue, please sign in for more adventures and features..." lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZEB-Wb-YAQ" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="15" y="81" width="360" height="38.666666666666657"/>
<fontDescription key="fontDescription" name="Exo2-Regular" family="Exo 2" pointSize="16"/>
<color key="textColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="40" translatesAutoresizingMaskIntoConstraints="NO" id="hzv-re-WXq">
<rect key="frame" x="15" y="144.66666666666663" width="360" height="50"/>
<subviews>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gWo-Sn-XnS" customClass="LocalisedElementsButton" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="110" y="0.0" width="140" height="50"/>
<color key="backgroundColor" red="0.36862745099999999" green="0.1215686275" blue="0.76862745099999996" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="140" id="ELX-ke-8x2"/>
</constraints>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Free Sign In">
<fontDescription key="titleFontDescription" name="Exo2-Medium" family="Exo 2" pointSize="18"/>
</buttonConfiguration>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="25"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="freeSignIn:" destination="55l-Gk-Npk" eventType="touchUpInside" id="iOk-Yf-ivd"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="50" id="0fT-tf-DWy"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</stackView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<edgeInsets key="layoutMargins" top="15" left="15" bottom="20" right="15"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="15"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</stackView>
</subviews>
<viewLayoutGuide key="safeArea" id="fPD-rO-ZgU"/>
<color key="backgroundColor" red="0.82745098039215681" green="0.93725490196078431" blue="0.97254901960784312" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="Dau-7f-0vb" firstAttribute="centerY" secondItem="fPD-rO-ZgU" secondAttribute="centerY" id="0rW-IM-pWT"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="trailing" secondItem="a7Y-B6-f0Q" secondAttribute="trailing" constant="15" id="1TC-Nf-fdz"/>
<constraint firstItem="jbL-QO-JJl" firstAttribute="leading" secondItem="5ML-g4-686" secondAttribute="trailing" constant="15" id="5bI-AA-E64"/>
<constraint firstItem="SyC-Qw-kzE" firstAttribute="bottom" secondItem="fPD-rO-ZgU" secondAttribute="bottom" id="7R3-kt-ANX"/>
@@ -1120,16 +1225,22 @@
<constraint firstItem="a7Y-B6-f0Q" firstAttribute="top" secondItem="fPD-rO-ZgU" secondAttribute="top" constant="10" id="L4o-KM-D1O"/>
<constraint firstItem="cxl-Av-gEU" firstAttribute="bottom" secondItem="a7Y-B6-f0Q" secondAttribute="bottom" constant="7" id="Lur-Ax-w8w"/>
<constraint firstItem="SyC-Qw-kzE" firstAttribute="trailing" secondItem="fPD-rO-ZgU" secondAttribute="trailing" id="M3t-nE-gwc"/>
<constraint firstItem="Dau-7f-0vb" firstAttribute="leading" secondItem="23B-pX-ODs" secondAttribute="leading" constant="20" id="M71-ET-eJZ"/>
<constraint firstItem="5ML-g4-686" firstAttribute="leading" secondItem="23B-pX-ODs" secondAttribute="leading" constant="5" id="Na5-Wr-DSa"/>
<constraint firstItem="SyC-Qw-kzE" firstAttribute="top" secondItem="a7Y-B6-f0Q" secondAttribute="bottom" constant="10" id="Nyh-j8-zuL"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="trailing" secondItem="ygH-wj-cLk" secondAttribute="trailing" id="Pyd-Eq-Pwe"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="trailing" secondItem="fTK-nk-bN9" secondAttribute="trailing" id="XRW-xO-sGx"/>
<constraint firstItem="cxl-Av-gEU" firstAttribute="top" secondItem="23B-pX-ODs" secondAttribute="top" id="Y0G-Ua-UcP"/>
<constraint firstItem="QHo-nZ-miK" firstAttribute="centerX" secondItem="fPD-rO-ZgU" secondAttribute="centerX" id="ZkK-bD-6Ys"/>
<constraint firstItem="5ML-g4-686" firstAttribute="centerY" secondItem="a7Y-B6-f0Q" secondAttribute="centerY" id="aC4-mQ-heC"/>
<constraint firstItem="ygH-wj-cLk" firstAttribute="leading" secondItem="fPD-rO-ZgU" secondAttribute="leading" id="cSC-hc-XwN"/>
<constraint firstItem="SyC-Qw-kzE" firstAttribute="leading" secondItem="fPD-rO-ZgU" secondAttribute="leading" id="cd5-Pg-diL"/>
<constraint firstAttribute="trailing" secondItem="Dau-7f-0vb" secondAttribute="trailing" constant="20" id="ejF-GB-Yna"/>
<constraint firstItem="jbL-QO-JJl" firstAttribute="centerY" secondItem="5ML-g4-686" secondAttribute="centerY" constant="-1" id="h8B-5o-mja"/>
<constraint firstItem="cxl-Av-gEU" firstAttribute="leading" secondItem="fPD-rO-ZgU" secondAttribute="leading" id="iba-8r-UBq"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="bottom" secondItem="ygH-wj-cLk" secondAttribute="bottom" id="l0J-sT-Rn0"/>
<constraint firstItem="QHo-nZ-miK" firstAttribute="centerY" secondItem="fPD-rO-ZgU" secondAttribute="centerY" id="npC-Cx-MHl"/>
<constraint firstItem="ygH-wj-cLk" firstAttribute="top" secondItem="cxl-Av-gEU" secondAttribute="bottom" id="rb7-EW-WCc"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="trailing" secondItem="cxl-Av-gEU" secondAttribute="trailing" id="usz-Hi-BR2"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="bottom" secondItem="fTK-nk-bN9" secondAttribute="bottom" constant="-20" id="vmC-a4-Yy3"/>
</constraints>
@@ -1142,6 +1253,8 @@
<outlet property="gamesCV" destination="5ff-Y7-nit" id="vM3-Z9-paV"/>
<outlet property="gamesStack" destination="Cgp-Ok-Imj" id="63D-lB-0lW"/>
<outlet property="gradientView" destination="cxl-Av-gEU" id="Sag-vq-nKu"/>
<outlet property="guestLoginStack" destination="Dau-7f-0vb" id="aC3-i3-TRK"/>
<outlet property="guestLoginView" destination="ygH-wj-cLk" id="XFr-0L-L0a"/>
<outlet property="karaokeCV" destination="Grz-ok-w2U" id="vAr-XE-2Ne"/>
<outlet property="karaokeStack" destination="jE2-WP-tD4" id="azr-yq-sDA"/>
<outlet property="noDataStack" destination="QHo-nZ-miK" id="mA1-FT-iQl"/>
@@ -1225,17 +1338,21 @@
<image name="WebSeriesIcon" width="33.333332061767578" height="30.333333969116211"/>
<image name="WokaFmIcon" width="35" height="35"/>
<image name="xmark" catalog="system" width="128" height="113"/>
<image name="xmark.circle" catalog="system" width="128" height="123"/>
<namedColor name="TextDarkBlue">
<color red="0.10599999874830246" green="0.050999999046325684" blue="0.60399997234344482" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="WelcomeBlue">
<color red="0.32899999618530273" green="0.32400000095367432" blue="0.4779999852180481" alpha="0.33000001311302185" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemGreenColor">
<color red="0.20392156862745098" green="0.7803921568627451" blue="0.34901960784313724" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.20392156859999999" green="0.78039215689999997" blue="0.34901960780000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemMintColor">
<color red="0.0" green="0.7803921568627451" blue="0.74509803921568629" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.0" green="0.78039215689999997" blue="0.74509803919999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>

View File

@@ -28,10 +28,18 @@ class MyListVM{
var selectedCollection : CollectionSelectionMyList?
func initView(){
NotificationCenter.default.addObserver(self, selector: #selector(languageChanged), name: .languageDidChange, object: nil)
if AuthFunc.shareInstance.getUserType() == 3{ // handle guest
vc.guestLoginView.isHidden = false
vc.guestLoginStack.isHidden = false
vc.scrollView.isHidden = true
return
}
setupCell()
Utilities.startProgressHUD()
getFavouriteListing()
NotificationCenter.default.addObserver(self, selector: #selector(languageChanged), name: .languageDidChange, object: nil)
}
func addGradient(){

View File

@@ -100,12 +100,14 @@ class KaraokeDetailsVC: UIViewController {
}
func tapHandler(){
self.view.addTapGesture {
self.dismiss(animated: true)
}
addView.addTapGesture { [weak self] in
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
guard let self else{return}
if let karaokeData{
@@ -130,6 +132,8 @@ class KaraokeDetailsVC: UIViewController {
}
likeView.addTapGesture { [weak self] in
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
guard let self else{return}
if let karaokeData{

View File

@@ -52,3 +52,6 @@
"ऑडियो पुस्तकें" = "Audio Books";
"कराओके" = "Karaoke";
"खेल" = "Games";
"फ्री साइन इन" = "Free Sign In";
"कृपया अधिक रोमांच और सुविधाओ के लिए साइन इन करे..." = "To continue, please sign in for more adventures and features...";
"WOKA से जुड़े रहे" = "Continue to WOKA";

View File

@@ -214,6 +214,9 @@
"Audio Books" = "ऑडियो पुस्तकें";
"Karaoke" = "कराओके";
"Games" = "खेल";
"Free Sign In" = "फ्री साइन इन";
"To continue, please sign in for more adventures and features..." = "कृपया अधिक रोमांच और सुविधाओ के लिए साइन इन करे...";
"Continue to WOKA" = "WOKA से जुड़े रहे";
/*

View File

@@ -75,6 +75,21 @@ class AuthFunc{
return isLoginned
}
/*
Logout PopUP Handling
*/
func guestUserLoginPopUp() -> Bool{
if AuthFunc.shareInstance.getUserType() == 3{
let sb = UIStoryboard(name: K.StoryBoard.customAlerts, bundle: nil)
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.CustomAlerts.logoutPopupVC) as! LogoutPopupVC
vcPush.modalPresentationStyle = .overCurrentContext
vcPush.modalTransitionStyle = .crossDissolve
UIApplication.topViewController()?.present(vcPush, animated: true)
return true
}
return false
}
/*
This func will return the access token saved at the time of login
*/

View File

@@ -86,7 +86,7 @@ struct APIEndPoints {
static let watch_show_listing = makeURL(path: "watch_show_listing")
static let category_listing = makeURL(path: "category_listing")
static let season_listing = makeURL(path: "season_listing")
static let season_episode_listing = makeURL(path: "season_episode_listing")
static let episode_listing = makeURL(path: "episode_listing")
static let teaser_listing = makeURL(path: "teaser_listing")
}

View File

@@ -91,6 +91,13 @@ class SideMenuVC: UIViewController {
}
@IBAction func logoutBtnTapped(_ sender: LocalisedElementsButton) {
// if its guest user navigate him to login
if AuthFunc.shareInstance.getUserType() == 3{
self.sideMenuController?.hideMenu()
UIApplication.setRootView(LoginNavVC.instantiate(from: .AuthenticationSB))
return
}
let sb = UIStoryboard(name: K.StoryBoard.customAlerts, bundle: nil)
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.CustomAlerts.yesNoAlertVC) as! YesNoAlertVC
vcPush.mainTitleText = "WOKA"

View File

@@ -21,7 +21,7 @@ class EpisodeDetailsVC: UIViewController {
var teaserData : TeaserDM.ResultData?
var episodeData : SeasonEpisodeListingDM.EpisodeDatum?
var episodeData : EpisodeListingDM.ResultData?
override func viewDidLoad() {
super.viewDidLoad()

View File

@@ -110,7 +110,7 @@ extension WebSeriesSeasonVC : TableViewSRC{
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
switch tableView{
case episodeTableView:
return vm.seasonEpisodeData.first?.episodeData?.count ?? 0
return vm.seasonEpisodeData.count
case teaserTableView:
return vm.teaserData.count
default:
@@ -126,9 +126,8 @@ extension WebSeriesSeasonVC : TableViewSRC{
let cell = tableView.dequeueReusableCell(withIdentifier: K.CellIdentifier.WebSeries.webSeriesEpisodeCell) as! WebSeriesEpisodeCell
switch tableView{
case episodeTableView:
if let data = vm.seasonEpisodeData.first?.episodeData?[indexPath.row]{
cell.setData(data: data)
}
let data = vm.seasonEpisodeData[indexPath.row]
cell.setData(data: data)
case teaserTableView:
let data = vm.teaserData[indexPath.row]
cell.setTeaserData(data: data)
@@ -168,7 +167,7 @@ extension WebSeriesSeasonVC : TableViewSRC{
case self.episodeTableView:
guard let episodeData = vm.seasonEpisodeData.first?.episodeData else{return}
let episodeData = vm.seasonEpisodeData
for i in episodeData{
var url = String()
guard let englishData = i.contentMoreDetails?.filter({$0.languageMasterID == 1}).first, let hindiData = i.contentMoreDetails?.filter({$0.languageMasterID == 2}).first else{return}
@@ -210,7 +209,7 @@ extension WebSeriesSeasonVC : TableViewSRC{
let data = vm.teaserData[indexPath.row]
vcPush.teaserData = data
default:
let data = vm.seasonEpisodeData.first?.episodeData?[indexPath.row]
let data = vm.seasonEpisodeData[indexPath.row]
vcPush.episodeData = data
}
vcPush.onDoneBlock = { [weak self] in
@@ -240,7 +239,7 @@ extension WebSeriesSeasonVC : TableViewSRC{
playerItems.append(JwPlayerItemCreate(url: url, poster: teaserData.thumbnailPath, titles: hindiData.title))
}
case self.episodeTableView:
guard let episodeData = vm.seasonEpisodeData.first?.episodeData else{return}
let episodeData = vm.seasonEpisodeData
for i in episodeData{
var url = String()
guard let englishData = i.contentMoreDetails?.filter({$0.languageMasterID == 1}).first, let hindiData = i.contentMoreDetails?.filter({$0.languageMasterID == 2}).first else{return}

View File

@@ -86,7 +86,9 @@ class WebSeriesVC: UIViewController {
loadMoreBtn.isHidden = true
vm.pageNo += 1
loadMoreActivityIndicator.startAnimating()
vm.getShowListing(categoryID: 18, isBtnClick: true)
if let index = vm.dropDownModule.indexForSelectedRow, let categoryIndex = vm.categoryListingData[index].id{
vm.getShowListing(categoryID: categoryIndex, isBtnClick: true)
}
}
}

View File

@@ -1,5 +1,5 @@
//
// SeasonEpisodeListingDM.swift
// EpisodeListingDM.swift
// WOKA
//
// Created by Bilal on 21/06/2024.
@@ -7,8 +7,10 @@
import Foundation
// MARK: - SeasonEpisodeListingDM
struct SeasonEpisodeListingDM: Codable {
import Foundation
// MARK: - EpisodeListingDM
struct EpisodeListingDM: Codable {
let result: [ResultData]?
let totalRecords: Int?
@@ -17,52 +19,20 @@ struct SeasonEpisodeListingDM: Codable {
case totalRecords = "total_records"
}
// MARK: - Result
struct ResultData: Codable {
let id, watchShowsMasterID: Int?
let seasonNumber: String?
let noOfEpisodes: Int?
let seasonDescription: String?
let releaseYear: Int?
let seasonTitle: String?
let trailerURL: String?
let thumbnailPath: String?
let thumbnailImgURL: String?
let tagsKeyword, releaseDate, mediaType: String?
let seasonMoreDetails: [MoreDetail]?
let episodeData: [EpisodeDatum]?
let episodeTotalRecords: Int?
enum CodingKeys: String, CodingKey {
case id
case watchShowsMasterID = "watch_shows_master_id"
case seasonNumber = "season_number"
case noOfEpisodes = "no_of_episodes"
case seasonDescription = "season_description"
case releaseYear = "release_year"
case seasonTitle = "season_title"
case trailerURL = "trailer_url"
case thumbnailPath = "thumbnail_path"
case thumbnailImgURL = "thumbnail_img_url"
case tagsKeyword = "tags_keyword"
case releaseDate = "release_date"
case mediaType = "media_type"
case seasonMoreDetails = "season_more_details"
case episodeData = "episode_data"
case episodeTotalRecords = "episode_total_records"
}
}
// MARK: - EpisodeDatum
struct EpisodeDatum: Codable {
let id, watchShowsMasterID, seasonMasterID, episodeNumber: Int?
let episodeTitle, episodeDescription: String?
let thumbnailPath: String?
let thumbnailImgURL: String?
let episodeURL: String?
let languageMasterID: Int?
let tagsKeyword, episodeDuration, releaseDate: String?
let contentMoreDetails: [MoreDetail]?
let tagsKeyword, episodeDuration: String?
let releaseDate: String?
let contentMoreDetails: [ContentMoreDetail]?
let seasonData: SeasonData?
let userVideoView: [UserVideoView]?
enum CodingKeys: String, CodingKey {
case id
@@ -79,14 +49,34 @@ struct SeasonEpisodeListingDM: Codable {
case episodeDuration = "episode_duration"
case releaseDate = "release_date"
case contentMoreDetails = "content_more_details"
case seasonData = "season_data"
case userVideoView = "user_video_view"
}
}
// MARK: - UserVideoView
struct UserVideoView: Codable {
let id, userID, postID, postType: Int?
let totalWatchedDuration, lastWatchedLeft: String?
let categoryID: Int?
// MARK: - MoreDetail
struct MoreDetail: Codable {
enum CodingKeys: String, CodingKey {
case id
case userID = "user_id"
case postID = "post_id"
case postType = "post_type"
case totalWatchedDuration = "total_watched_duration"
case lastWatchedLeft = "last_watched_left"
case categoryID = "category_id"
}
}
// MARK: - ContentMoreDetail
struct ContentMoreDetail: Codable {
let id, contentID, postType, languageMasterID: Int?
let title, description, tagsKeywords: String?
let contentHDURL, contentSDURL, trailerHDURL, trailerSDURL: String?
let contentHDURL, contentSDURL: String?
enum CodingKeys: String, CodingKey {
case id
@@ -97,8 +87,18 @@ struct SeasonEpisodeListingDM: Codable {
case tagsKeywords = "tags_keywords"
case contentHDURL = "content_hd_url"
case contentSDURL = "content_sd_url"
case trailerHDURL = "trailer_hd_url"
case trailerSDURL = "trailer_sd_url"
}
}
// MARK: - SeasonData
struct SeasonData: Codable {
let id, watchShowsMasterID: Int?
let seasonNumber: String?
enum CodingKeys: String, CodingKey {
case id
case watchShowsMasterID = "watch_shows_master_id"
case seasonNumber = "season_number"
}
}

View File

@@ -29,7 +29,7 @@ class WebSeriesEpisodeCell: UITableViewCell {
// Configure the view for the selected state
}
func setData(data : SeasonEpisodeListingDM.EpisodeDatum){
func setData(data : EpisodeListingDM.ResultData){
if let url = data.thumbnailPath{
self.seasonImage.imageURL(url, color: .black)
}

View File

@@ -167,6 +167,8 @@ class WebSeriesShowListingCell: UITableViewCell {
}
@IBAction func btnTapped(_ sender: UIButton) {
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
switch sender{
case likeBtn:
if btnTapped != nil {

View File

@@ -18,14 +18,15 @@ class WebSeriesSeasonVM{
var seasonListingData = [SeasonListingDM.Result]()
var seasonEpisodeData = [SeasonEpisodeListingDM.ResultData]()
var seasonEpisodeData = [EpisodeListingDM.ResultData]()
var teaserData = [TeaserDM.ResultData]()
var showData : WebSeriesShowListDM.ShowDatum?
var indexSelected : Int?
var pageNo = 0
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)
@@ -39,6 +40,8 @@ class WebSeriesSeasonVM{
func handleTapGesture(){
vc.addView.addTapGesture { [weak self] in
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
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}
if isFav {
@@ -61,6 +64,8 @@ class WebSeriesSeasonVM{
}
vc.likeView.addTapGesture { [weak self] in
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
guard let self ,let indexSelected, let showData, let showID = showData.id, let isLiked = showData.isLiked, let postType = showData.contentMoreDetails?.first?.postType else{return}
if isLiked{
@@ -216,9 +221,12 @@ class WebSeriesSeasonVM{
Utilities.startProgressHUD()
guard let watchShowID = showData?.id, let episodeSelectedCateogory else{return}
let headers : HTTPHeaders = ["access-token" : AuthFunc.shareInstance.getAccessToken()]
let params : Parameters = ["watch_show_id" : watchShowID,
"season_id" : episodeSelectedCateogory]
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.WebSeries.season_episode_listing, method: .post,parameters: params,headers : headers) { [weak self](result : Result<BaseResponseModel<SeasonEpisodeListingDM>, NetworkManager.APIError>) in
let params : Parameters = ["watch_show_master_id" : watchShowID,
"season_master_id" : episodeSelectedCateogory,
"api_version" : "v2",
"start" : pageNo,
"limit": 5]
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.WebSeries.episode_listing, method: .post,parameters: params,headers : headers) { [weak self](result : Result<BaseResponseModel<EpisodeListingDM>, NetworkManager.APIError>) in
switch result{
case .success(let data):
guard let self else{
@@ -237,15 +245,15 @@ class WebSeriesSeasonVM{
guard let data = data.data?.result else{return}
self.seasonEpisodeData.removeAll()
self.seasonEpisodeData = data
self.seasonEpisodeData = self.seasonEpisodeData.filter {
$0.episodeData != nil && !$0.episodeData!.isEmpty
}
// self.seasonEpisodeData = self.seasonEpisodeData.filter {
// $0.episodeData != nil && !$0.episodeData!.isEmpty
// }
if self.seasonEpisodeData.count == 0{
self.vc.episodeTitle.isHidden = true
self.vc.episodeTitle.text = ""
}else{
self.vc.episodeTitle.isHidden = false
self.vc.episodeTitle.text = data.first?.mediaType?.uppercased()
self.vc.episodeTitle.text = "Episodes"
}
self.vc.episodeTableView.reloadData()

View File

@@ -35,8 +35,8 @@ class WebSeriesVM{
vc.title = "WEB SERIES".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue)
vc.view.applyGradient(colors: [color2, color1], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0.8, y: 0))
getContinueWatching()
getCategoryListing()
getContinueWatching()
// for the first load always send hindi as it is default category
self.getShowListing(categoryID: 18)
@@ -108,7 +108,9 @@ class WebSeriesVM{
//if the language is changed call the showlisting api
if let id = categoryListingData[index].id {
getShowListing(categoryID: id)
Utilities.startProgressHUD()
pageNo = 0
getShowListing(categoryID: id,languageChange: true)
}
}
@@ -116,7 +118,6 @@ class WebSeriesVM{
// MARK: - Api Calls
func getContinueWatching(){
// Utilities.startProgressHUD()
let headers : HTTPHeaders = ["access-token" : AuthFunc.shareInstance.getAccessToken()]
let params : Parameters = ["post_type" : 3] // 3- webseries
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.WebSeries.continue_watching, method: .post,parameters: params,headers : headers) { [weak self](result : Result<BaseResponseModel<ContinueWatchingDM>, NetworkManager.APIError>) in
@@ -159,14 +160,14 @@ class WebSeriesVM{
}
}
func getShowListing(categoryID : Int, isBtnClick : Bool = false){
func getShowListing(categoryID : Int, isBtnClick : Bool = false, languageChange : Bool = false){
// Utilities.startProgressHUD()
let headers : HTTPHeaders = ["access-token" : AuthFunc.shareInstance.getAccessToken()]
let params : Parameters = ["category_id" : categoryID,
"api_version" : "v2",
"start" : pageNo,
"limit": 10] // from category listing api , default will be 1
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.WebSeries.watch_show_listing, method: .post,parameters: params,headers: headers) { [weak self](result : Result<BaseResponseModel<WebSeriesShowListDM>, NetworkManager.APIError>) in
"limit": 6] // from category listing api , default will be 1
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.WebSeries.watch_show_listing, method: .post,parameters: params,headers: headers, queue: QueueHelper.utilityGroup) { [weak self](result : Result<BaseResponseModel<WebSeriesShowListDM>, NetworkManager.APIError>) in
switch result{
case .success(let data):
guard let self else{
@@ -182,8 +183,13 @@ class WebSeriesVM{
vc.toast(msg: data.message ?? "Unrecognised error" , time: 2)
case 1:
Utilities.dismissProgressHUD()
guard let data = data.data?.showData else{return}
self.showData.append(contentsOf: data)
guard let dataCount = data.data?.totalRecords , let data = data.data?.showData else{return}
if languageChange{
self.showData.removeAll()
self.showData.append(contentsOf: data)
}else{
self.showData.append(contentsOf: data)
}
self.vc.showListingTableView.reloadData()
self.vc.tableHeight.constant = self.vc.showListingTableView.contentSize.height + 100
self.vc.showListingTableView.layoutIfNeeded()
@@ -194,13 +200,18 @@ class WebSeriesVM{
self.vc.loadMoreActivityIndicator.stopAnimating()
self.vc.loadMoreActivityIndicator.hidesWhenStopped = true
if self.showData.count.isMultiple(of: 10) && !self.stopFetch{
// if not multiple of 10, means more data can be there, show more btn
self.vc.loadMoreBtn.isHidden = false
}else{
self.stopFetch = true
if self.showData.count == dataCount{
self.vc.loadMoreBtn.isHidden = true
}else{
self.vc.loadMoreBtn.isHidden = false
}
// if self.showData.count.isMultiple(of: 6) && !self.stopFetch{
// // if not multiple of 10, means more data can be there, show more btn
// self.vc.loadMoreBtn.isHidden = false
// }else{
// self.stopFetch = true
// self.vc.loadMoreBtn.isHidden = true
// }
default:
break
}