- My list Audio books on add remove fav, only calling audiobooks api and reloading in background

- My list Games on add remove fav, only calling Games api and reloading in background
- My list Karaoke on add remove fav, only calling Karaoke api and reloading in background
-Finalised clicks count for every module
This commit is contained in:
2024-08-12 19:58:58 +05:30
parent 3eccad3149
commit d17fe416ae
69 changed files with 708 additions and 137 deletions

View File

@@ -12,6 +12,7 @@
5202AB012BDFA7900043B7BD /* EmailValidation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5202AB002BDFA7900043B7BD /* EmailValidation.swift */; };
520346962C64E29A00D0BD20 /* MyListViewAllCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 520346952C64E29A00D0BD20 /* MyListViewAllCell.xib */; };
520346972C64E29A00D0BD20 /* MyListViewAllCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 520346942C64E29A00D0BD20 /* MyListViewAllCell.swift */; };
5210438E2C69E18F0005A4D1 /* WOKA.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 5210438C2C69E18F0005A4D1 /* WOKA.xcdatamodeld */; };
5219C2C22C086D9C00A1DF4D /* DataTypeConversion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5219C2C12C086D9B00A1DF4D /* DataTypeConversion.swift */; };
521CB1002C493DB80085BDF8 /* JWPlayerKit in Frameworks */ = {isa = PBXBuildFile; productRef = 521CB0FF2C493DB80085BDF8 /* JWPlayerKit */; };
522242662BFC74380085C632 /* MyListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522242632BFC74380085C632 /* MyListVC.swift */; };
@@ -307,7 +308,6 @@
9C85A9F32C5CE1060031C365 /* FirebasePerformance in Frameworks */ = {isa = PBXBuildFile; productRef = 9C85A9F22C5CE1060031C365 /* FirebasePerformance */; };
9C8C4FAE2C1315410017DD3B /* WebViewVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C8C4FAD2C1315410017DD3B /* WebViewVC.swift */; };
9C8C4FB02C1328060017DD3B /* Disclaimer.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 9C8C4FAF2C1328060017DD3B /* Disclaimer.rtf */; };
9C9BE46C2C65DF2A00C48D6A /* WOKA.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 9C9BE46A2C65DF2A00C48D6A /* WOKA.xcdatamodeld */; };
9C9BE46E2C663B1600C48D6A /* JWKaraokePlayerVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C9BE46D2C663B1600C48D6A /* JWKaraokePlayerVM.swift */; };
9C9BEEC72BEE1BBF004ECC2F /* CollectionViewCenteredFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C9BEEC62BEE1BBF004ECC2F /* CollectionViewCenteredFlowLayout.swift */; };
9CA7C6C02C1093E500D73742 /* ProfileVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CA7C6BF2C1093E500D73742 /* ProfileVC.swift */; };
@@ -372,6 +372,7 @@
520346952C64E29A00D0BD20 /* MyListViewAllCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MyListViewAllCell.xib; sourceTree = "<group>"; };
520B6E3E2C0751E90091C478 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Theme.strings; sourceTree = "<group>"; };
520B6E402C0751EF0091C478 /* hi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hi; path = hi.lproj/Theme.strings; sourceTree = "<group>"; };
5210438D2C69E18F0005A4D1 /* WOKA.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = WOKA.xcdatamodel; sourceTree = "<group>"; };
5219C2C12C086D9B00A1DF4D /* DataTypeConversion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataTypeConversion.swift; sourceTree = "<group>"; };
522242632BFC74380085C632 /* MyListVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyListVC.swift; sourceTree = "<group>"; };
522242652BFC74380085C632 /* TabBarVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabBarVC.swift; sourceTree = "<group>"; };
@@ -662,7 +663,6 @@
9C85A9EB2C5CD5CD0031C365 /* MyListDataTemp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyListDataTemp.swift; sourceTree = "<group>"; };
9C8C4FAD2C1315410017DD3B /* WebViewVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebViewVC.swift; sourceTree = "<group>"; };
9C8C4FAF2C1328060017DD3B /* Disclaimer.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = Disclaimer.rtf; sourceTree = "<group>"; };
9C9BE46B2C65DF2A00C48D6A /* WOKA.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = WOKA.xcdatamodel; sourceTree = "<group>"; };
9C9BE46D2C663B1600C48D6A /* JWKaraokePlayerVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JWKaraokePlayerVM.swift; sourceTree = "<group>"; };
9C9BEEC62BEE1BBF004ECC2F /* CollectionViewCenteredFlowLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionViewCenteredFlowLayout.swift; sourceTree = "<group>"; };
9CA7C6BF2C1093E500D73742 /* ProfileVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileVC.swift; sourceTree = "<group>"; };
@@ -888,7 +888,7 @@
9C535DC82C00C34000DA6DCD /* Theme */,
52DAC6462C21761700E2F85B /* WebSeries */,
9C834ED92C1C20EC00B29A9C /* WOKA.entitlements */,
9C9BE46A2C65DF2A00C48D6A /* WOKA.xcdatamodeld */,
5210438C2C69E18F0005A4D1 /* WOKA.xcdatamodeld */,
52ACC1292C610EC900791528 /* PersistentStorage.swift */,
);
path = WOKA;
@@ -2226,6 +2226,7 @@
52A6DCA02C4E3AA600F63C51 /* ShopListingCell.swift in Sources */,
525954192BE8CC3400191286 /* ConstantString.swift in Sources */,
52D774EB2BDFC0BF001D87DE /* OTPVC.swift in Sources */,
5210438E2C69E18F0005A4D1 /* WOKA.xcdatamodeld in Sources */,
9C8446872C40FC6E003E3E53 /* AVPlayerTesting.swift in Sources */,
52AF71F42C36C40B00BC5972 /* GamesWebViewVC.swift in Sources */,
9C007F202C255DF200F798C2 /* EpisodeListingDM.swift in Sources */,
@@ -2379,7 +2380,6 @@
52C8B05F2BDA5AFA003B51D0 /* SplashVM.swift in Sources */,
52C1A4E12C05B69F007BAA50 /* UIApplicationSwitchRoot.swift in Sources */,
527A2BCC2C577F8A0080DF9B /* AnalyticsEventKeys.swift in Sources */,
9C9BE46C2C65DF2A00C48D6A /* WOKA.xcdatamodeld in Sources */,
52663FF72BDFACF60001D8CE /* ShadowView.swift in Sources */,
522D65602C1ACD8D0021E505 /* UserNotificationVC.swift in Sources */,
52AC2D252C295A7900337473 /* TeaserDM.swift in Sources */,
@@ -2879,14 +2879,14 @@
/* End XCSwiftPackageProductDependency section */
/* Begin XCVersionGroup section */
9C9BE46A2C65DF2A00C48D6A /* WOKA.xcdatamodeld */ = {
5210438C2C69E18F0005A4D1 /* WOKA.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
9C9BE46B2C65DF2A00C48D6A /* WOKA.xcdatamodel */,
5210438D2C69E18F0005A4D1 /* WOKA.xcdatamodel */,
);
currentVersion = 9C9BE46B2C65DF2A00C48D6A /* WOKA.xcdatamodel */;
currentVersion = 5210438D2C69E18F0005A4D1 /* WOKA.xcdatamodel */;
name = WOKA.xcdatamodeld;
path = /Users/bilal/Desktop/woka_native_ios_swift/WOKA/WOKA.xcdatamodeld;
path = /Users/macbookpro/Desktop/WOKA/WOKA/WOKA.xcdatamodeld;
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
};

View File

@@ -38,6 +38,10 @@ class AddNewAddressVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
override func viewDidDisappear(_ animated: Bool) {
@@ -47,6 +51,7 @@ class AddNewAddressVC: UIViewController {
self.navigationController?.setColor(color: .black)
}
@IBAction func submitBtnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addShopCount(postID: 0)
if enterAddressNAmeTF.text!.count < 2 {
Utilities.alertWithBtn(title: "", msgBody: "Name should be minimum 2 Characters.", okBtnStr: "OK", vc: self)

View File

@@ -36,7 +36,6 @@ class AddressListVC: UIViewController {
override func viewDidAppear(_ animated: Bool) {
self.navigationController?.setColor(color: .white)
// handle data change
self.tableView.reloadData()
}
@@ -44,6 +43,10 @@ class AddressListVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
override func viewDidDisappear(_ animated: Bool) {
@@ -54,6 +57,8 @@ class AddressListVC: UIViewController {
}
@IBAction func btnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addShopCount(postID: 0)
switch sender{
case useSelectedAddBtn:
if let addressID = CartDataCache.addressData.filter({$0.isDefault == true}).first?.id{
@@ -89,6 +94,8 @@ extension AddressListVC : TableViewSRC{
CartDataCache.addressData[index].isDefault = false
}
PersistentStorage.shared.addShopCount(postID: 0)
//
if CartDataCache.addressData[indexPath.row].eddDate == nil || CartDataCache.addressData[indexPath.row].eddDate == ""{
if let pincode = CartDataCache.addressData[indexPath.row].pincode, let id = CartDataCache.addressData[indexPath.row].id{

View File

@@ -30,6 +30,16 @@ class PaymentWebViewVC: UIViewController,WKNavigationDelegate {
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(true, animated: animated)
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: animated)
}
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
Utilities.dismissProgressHUD()
}
@@ -46,9 +56,15 @@ class PaymentWebViewVC: UIViewController,WKNavigationDelegate {
domain = finalURL.host ?? ""
}
if domain == "secure.ccavenue.com" && endpoint.lowercased() == "canceltransaction"{
if domain == "secure.ccavenue.com" && endpoint.lowercased() == "canceltransaction"{ // failure
Timer.scheduledTimer(withTimeInterval: 2.5, repeats: false) { _ in
self.dismiss(animated: true)
self.navigationController?.popViewController(animated: true)
}
}else if domain == "secure.ccavenue.com" && endpoint.lowercased() == "redirectToMerchant"{ // success
// nav to home. & delete my cart
CartDataCache.shareInstance.removeAll()
Timer.scheduledTimer(withTimeInterval: 2.5, repeats: false) { _ in
self.navigationController?.popToRootViewController(animated: true)
}
}
} else {
@@ -57,25 +73,5 @@ class PaymentWebViewVC: UIViewController,WKNavigationDelegate {
}
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(false, animated: animated)
}
override func viewDidAppear(_ animated: Bool) {
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)
}
}

View File

@@ -36,6 +36,10 @@ class VerifyAddressPincodeVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
override func viewDidDisappear(_ animated: Bool) {
@@ -46,6 +50,7 @@ class VerifyAddressPincodeVC: UIViewController {
}
@IBAction func proceedBtnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addShopCount(postID: 0)
guard let tf = pinCodeTF.text else{return}
if sender.titleLabel?.text == "CHECK NOW"{
if tf.count < 6{

View File

@@ -171,7 +171,7 @@ class AddressListVM{
vcPush.url = data.url
vcPush.modalTransitionStyle = .crossDissolve
vcPush.modalPresentationStyle = .fullScreen
self.vc.present(vcPush, animated: true)
self.vc.navigationController?.pushViewController(vcPush, animated: true)
default:
Utilities.dismissProgressHUD()
break

View File

@@ -47,6 +47,9 @@ class AudioBookDetailsVC : UIViewController{
@objc func handleTap(_ gesture: UITapGestureRecognizer) {
let location = gesture.location(in: outerView)
if !contentView.frame.contains(location) {
if let postID = audioData?.id{
PersistentStorage.shared.addAudioCount(postID: postID)
}
self.dismiss(animated: true)
}
}
@@ -57,6 +60,9 @@ class AudioBookDetailsVC : UIViewController{
addView.addTapGesture { [weak self] in
guard let self else{return}
if let postID = audioData?.id{
PersistentStorage.shared.addAudioCount(postID: postID)
}
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
if let audioData{
@@ -66,10 +72,12 @@ class AudioBookDetailsVC : UIViewController{
LikeFavCommonFunc.shareInstance.removeFavourite(postID: showID, postType: postType, categoryID: 0, vc: self) { isDone in
self.audioData?.markAsFavourite = false
if let index = MyListDataTemp.shareInstance.favListingData?.audioData?.firstIndex(where: {$0.id == showID}){
MyListDataTemp.shareInstance.favListingData?.audioData?.remove(at: index)
K.GVar.myListSoftReload = true
}
// if let index = MyListDataTemp.shareInstance.favListingData?.audioData?.firstIndex(where: {$0.id == showID}){
// MyListDataTemp.shareInstance.favListingData?.audioData?.remove(at: index)
// K.GVar.myListSoftReload = true
// }
K.GVar.reloadMyListAudioBooks = true
self.delegate?.updateRows(index: self.audioIndex, type: .favourite, isFav: false, isLike: nil, id: showID)
self.initView()
@@ -78,10 +86,12 @@ class AudioBookDetailsVC : UIViewController{
LikeFavCommonFunc.shareInstance.addFavourite(postID: showID, postType: postType, categoryID: 0, vc: self) { isDone in
self.audioData?.markAsFavourite = true
if let audioData = self.audioData{
MyListDataTemp.shareInstance.favListingData?.audioData?.append(audioData)
K.GVar.myListSoftReload = true
}
// if let audioData = self.audioData{
// MyListDataTemp.shareInstance.favListingData?.audioData?.append(audioData)
// K.GVar.myListSoftReload = true
// }
K.GVar.reloadMyListAudioBooks = true
self.delegate?.updateRows(index: self.audioIndex, type: .favourite, isFav: true, isLike: nil, id: showID)
self.initView()
@@ -121,6 +131,9 @@ class AudioBookDetailsVC : UIViewController{
likeView.addTapGesture { [weak self] in
guard let self else{return}
if let postID = audioData?.id{
PersistentStorage.shared.addAudioCount(postID: postID)
}
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
if let audioData{
@@ -196,7 +209,12 @@ class AudioBookDetailsVC : UIViewController{
}
shareView.addTapGesture {
shareView.addTapGesture { [weak self] in
guard let self else{return}
if let postID = audioData?.id{
PersistentStorage.shared.addAudioCount(postID: postID)
}
if let name = URL(string: "https://apps.apple.com/in/app/woka/id6465305185"), !name.absoluteString.isEmpty {
let objectsToShare = [name]
let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
@@ -335,9 +353,9 @@ class AudioBookDetailsVC : UIViewController{
}
@IBAction func closeBtnTapped(_ sender: UIButton) {
self.dismiss(animated: true) {
if let postID = audioData?.id{
PersistentStorage.shared.addAudioCount(postID: postID)
}
self.dismiss(animated: true)
}
}

View File

@@ -59,6 +59,11 @@ class AudioBookHomeVC: UIViewController {
// Customize the navigation bar's appearance
self.navigationController?.setColor(color: .black)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
override func viewDidLayoutSubviews() {
@@ -74,6 +79,9 @@ class AudioBookHomeVC: UIViewController {
@IBAction func listenAudioBtnTapped(_ sender: LocalisedElementsButton) {
guard let data = vm.headerData else{return}
if let postID = data.id{
PersistentStorage.shared.addAudioCount(postID: postID)
}
var playerItems = [JwPlayerItemCreate]()
if AuthFunc.shareInstance.getDefaultLanguage() == .english{
if let englishData = data.contentMoreDetails?.filter({$0.languageMasterID == 1}).first, let url = englishData.url{
@@ -157,7 +165,7 @@ extension AudioBookHomeVC : TableViewSRC{
guard let postID = data.id ,let postType = data.contentMoreDetails?.first?.postType else{return}
let isFav = data.markAsFavourite
let isLiked = data.isLiked
PersistentStorage.shared.addAudioCount(postID: postID)
vm.updateFavLikes(type: type, isFav: isFav, isLiked: isLiked, postID: postID, postType: postType)
}
@@ -171,6 +179,11 @@ extension AudioBookHomeVC : TableViewSRC{
Updated the top header data
*/
vm.headerData = data
if let postID = data.id{
PersistentStorage.shared.addAudioCount(postID: postID)
}
vm.setHeaderData()
let sb = UIStoryboard(name: K.StoryBoard.audioBooks, bundle: nil)
@@ -200,7 +213,7 @@ extension AudioBookHomeVC : CollectionViewSRC{
guard let postID = data.id ,let postType = data.contentMoreDetails?.first?.postType else{return}
let isFav = data.markAsFavourite
let isLiked = data.isLiked
PersistentStorage.shared.addAudioCount(postID: postID)
vm.updateFavLikes(type: type, isFav: isFav, isLiked: isLiked, postID: postID, postType: postType)
}
return cell
@@ -209,6 +222,10 @@ extension AudioBookHomeVC : CollectionViewSRC{
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
let data = vm.continueWatchingData[indexPath.row]
vm.headerData = data
if let postID = data.id{
PersistentStorage.shared.addAudioCount(postID: postID)
}
vm.setHeaderData()
let sb = UIStoryboard(name: K.StoryBoard.audioBooks, bundle: nil)

View File

@@ -195,7 +195,7 @@ class AudioBookHomeVM{
audioListData[showListIndex].markAsFavourite = false
vc.audioListingTableView.reloadRows(at: [IndexPath(row: showListIndex, section: 0)],with: .none)
K.GVar.reloadMyList = true
K.GVar.reloadMyListAudioBooks = true
// // MyList Update
// if MyListDataTemp.shareInstance.isDatafetched{
// if let indexRemove = MyListDataTemp.shareInstance.favListingData?.audioData?.firstIndex(where: {$0.id == postID}){
@@ -211,7 +211,7 @@ class AudioBookHomeVM{
if let continueWatchingIndex = continueWatchingData.firstIndex(where: { $0.id == postID }){
continueWatchingData[continueWatchingIndex].markAsFavourite = false
vc.continueWatchingCV.reloadItems(at: [IndexPath(row: continueWatchingIndex, section: 0)])
K.GVar.reloadMyList = true
K.GVar.reloadMyListAudioBooks = true
// MyList Update
// if MyListDataTemp.shareInstance.isDatafetched{
// if let indexRemove = MyListDataTemp.shareInstance.favListingData?.audioData?.firstIndex(where: {$0.id == postID}){
@@ -228,7 +228,7 @@ class AudioBookHomeVM{
if let showListIndex = audioListData.firstIndex(where: { $0.id == postID }){
audioListData[showListIndex].markAsFavourite = true
vc.audioListingTableView.reloadRows(at: [IndexPath(row: showListIndex, section: 0)],with: .none)
K.GVar.reloadMyList = true
K.GVar.reloadMyListAudioBooks = true
// MyList Update
// if MyListDataTemp.shareInstance.isDatafetched{
// let audioData = audioListData[showListIndex]
@@ -243,7 +243,7 @@ class AudioBookHomeVM{
if let continueWatchingIndex = continueWatchingData.firstIndex(where: { $0.id == postID }){
continueWatchingData[continueWatchingIndex].markAsFavourite = true
vc.continueWatchingCV.reloadItems(at: [IndexPath(row: continueWatchingIndex, section: 0)])
K.GVar.reloadMyList = true
K.GVar.reloadMyListAudioBooks = true
// MyList Update
// if MyListDataTemp.shareInstance.isDatafetched{
// if MyListDataTemp.shareInstance.favListingData?.audioData?.firstIndex(where: {$0.id == postID}) == nil{

View File

@@ -1113,7 +1113,7 @@ Sent to Your Parents Email</string>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="35" translatesAutoresizingMaskIntoConstraints="NO" id="NPA-IJ-SA5">
<rect key="frame" x="30" y="776" width="370" height="102"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="We will send a reset code to their email" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uv4-iY-Z87" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="We will send a reset code to email" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uv4-iY-Z87" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="370" height="17"/>
<fontDescription key="fontDescription" name="Exo2-Regular" family="Exo 2" pointSize="14"/>
<color key="textColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>

View File

@@ -35,9 +35,15 @@ class EmailVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
@IBAction func nextBtnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addOthersCount()
/*
If child registers dont call api to check email, directly hit sendotp and navigate to otp screen
if parent registers check if the email exist or not and then hit sendotp

View File

@@ -28,9 +28,15 @@ class LinkedChildVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
navigationController?.setNavigationBarHidden(true, animated: animated)
// if self.isMovingFromParent {
// // Back button was pressed
// PersistentStorage.shared.addOthersCount()
// }
}
@IBAction func nextBtnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addOthersCount()
let sb = UIStoryboard(name: K.StoryBoard.authenticationSB, bundle: nil)
let vc = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Authentication.userDetailsRegisterVC) as! UserDetailsRegisterVC
self.navigationController?.pushViewController(vc, animated: true)

View File

@@ -30,6 +30,7 @@ class LoginVC: UIViewController {
}
@IBAction func loginBtnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addOthersCount()
guard let userName = userNameTF.text , let pass = passwordTF.text else{return}
/*
@@ -61,16 +62,19 @@ class LoginVC: UIViewController {
}
@IBAction func createAccountBtnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addOthersCount()
let sb = UIStoryboard(name: K.StoryBoard.main, bundle: nil)
let vc = sb.instantiateViewController(withIdentifier: K.StoryBoardID.OnBoarding.selectAgeVC) as! SelectAgeVC
self.navigationController?.pushViewController(vc, animated: true)
}
@IBAction func continueGuestBtnTapped(_ sender: UIButton) {
PersistentStorage.shared.addOthersCount()
vm.guestLogin()
}
@IBAction func forgotPasswordBtnTapped(_ sender: UIButton) {
PersistentStorage.shared.addOthersCount()
let sb = UIStoryboard(name: K.StoryBoard.authenticationSB, bundle: nil)
let vc = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Authentication.resetPassUserNameVC) as! ResetPassUserNameVC
self.navigationController?.pushViewController(vc, animated: true)

View File

@@ -31,9 +31,14 @@ class NewPasswordVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
@IBAction func nextBtnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addOthersCount()
guard let pass = enterNewPasswordTF.text , let confirmPass = confirmPassTF.text else{return}
/*

View File

@@ -45,6 +45,11 @@ class OTPVC : UIViewController{
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
deinit {
@@ -53,10 +58,12 @@ class OTPVC : UIViewController{
// MARK: - Button Tap Handler
@IBAction func nextBtnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addOthersCount()
vm.validateOTP()
}
@IBAction func resendOTPBtnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addOthersCount()
vm.remainingTime = 10 * 60
vm.resendOTP()
}

View File

@@ -29,10 +29,16 @@ class ResetPassUserNameVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
@IBAction func nextBtnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addOthersCount()
/*
Check for username
*/

View File

@@ -28,9 +28,15 @@ class SelectAvatarVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
@IBAction func nextBtnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addOthersCount()
// Check for avatar.
if AuthFunc.shareInstance.regData.avtar == nil || AuthFunc.shareInstance.regData.avtar == ""{
let sb = UIStoryboard(name: K.StoryBoard.customAlerts, bundle: nil)
@@ -63,6 +69,7 @@ extension SelectAvatarVC : UICollectionViewDelegate , UICollectionViewDataSource
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
PersistentStorage.shared.addOthersCount()
AuthFunc.shareInstance.regData.avtar = vm.avatarData[indexPath.row].avatarName
collectionView.reloadData()
}

View File

@@ -36,11 +36,17 @@ class UserDetailsRegisterVC : UIViewController{
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
// MARK: - Button Tap Handler
@IBAction func nextBtnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addOthersCount()
guard let name = enterNameTF.text ,let userName = enterUserNameTF.text , let pass = enterPasswordTF.text else{return}
/*

View File

@@ -60,9 +60,15 @@ class UserIntrestVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
@IBAction func nextBtnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addOthersCount()
let dob = DateFormatterLib.dateModsDate(date: datePicker.date, dateReturnFormat: .yyyy_MM_dd, stringOrDate: .string).0
/*
Append the DOB to RegData
@@ -137,7 +143,7 @@ extension UserIntrestVC : UICollectionViewDelegate , UICollectionViewDataSource{
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
vm.intrestTopics[indexPath.row].isSelected?.toggle()
PersistentStorage.shared.addOthersCount()
//Append remove intrest ID
if let id = vm.intrestTopics[indexPath.row].id{
if let topicID = AuthFunc.shareInstance.regData.interest_topic_id, let index = topicID.firstIndex(of: id){

View File

@@ -47,7 +47,7 @@ class NewPasswordVM{
case 1: // Success
Utilities.dismissProgressHUD()
self.vc.toast(msg: data.message ?? "Unrecognised error" , time: 1) {
UIApplication.setRootView(LoginNavVC.instantiate(from: .AuthenticationSB))
}
default:
Utilities.dismissProgressHUD()

View File

@@ -19,7 +19,7 @@ class ResetPassUserNameVM{
vc.nextBtn.applyGradient(colors: [color1, color2], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0.8, y: 0))
vc.nextBtn.roundCorner()
vc.usernameTF.placeholder = "We will send a reset code to their email".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue)
vc.usernameTF.placeholder = "Please enter you username".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue)
vc.usernameTF.delegate = self.vc
//Adding error view to the name tf

View File

@@ -99,6 +99,7 @@ class UserIntrestVM{
}
@objc func boyBtnTapped() {
PersistentStorage.shared.addOthersCount()
// Apply click effect animation
AuthFunc.shareInstance.regData.gender = 2
UIView.animate(withDuration: 0.1, animations: {
@@ -112,6 +113,7 @@ class UserIntrestVM{
}
@objc func girlBtnTapped() {
PersistentStorage.shared.addOthersCount()
AuthFunc.shareInstance.regData.gender = 1
// Apply click effect animation

View File

@@ -138,23 +138,23 @@
<rect key="frame" x="0.0" y="59" width="414" height="803"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="4FL-Qu-GXb">
<rect key="frame" x="0.0" y="0.0" width="414" height="363"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="364.33333333333331"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Order Summary" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fbh-Ve-yLY" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="5" y="4.9999999999999982" width="404" height="23.333333333333329"/>
<rect key="frame" x="5" y="5" width="404" height="24"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="20"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="qGY-nv-azT">
<rect key="frame" x="5" y="38.333333333333329" width="404" height="99.999999999999986"/>
<rect key="frame" x="5" y="39" width="404" height="100"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="cQ3-vj-QS5"/>
</constraints>
</tableView>
<stackView opaque="NO" contentMode="scaleToFill" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="ZuF-hT-QwS">
<rect key="frame" x="5" y="148.33333333333334" width="404" height="50"/>
<rect key="frame" x="5" y="149" width="404" height="50"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Enter coupon code" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="0cZ-tT-3PH" customClass="TextFieldShadow" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="5" y="0.0" width="294" height="50"/>
@@ -209,14 +209,14 @@
<edgeInsets key="layoutMargins" top="0.0" left="5" bottom="0.0" right="5"/>
</stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0M5-Sk-NNP">
<rect key="frame" x="5" y="208.33333333333331" width="404" height="0.66666666666665719"/>
<rect key="frame" x="5" y="209" width="404" height="0.66666666666665719"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="0.69999999999999996" id="euT-bu-DWE"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Hjo-i3-vzd">
<rect key="frame" x="5" y="219" width="404" height="34.333333333333343"/>
<rect key="frame" x="5" y="219.66666666666669" width="404" height="34.333333333333343"/>
<color key="tintColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="All Offers &amp; Coupons" image="chevron.forward.circle.fill" catalog="system"/>
@@ -226,39 +226,39 @@
</connections>
</button>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" No Coupon Found!" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yYe-w7-xHF" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="5" y="258.33333333333331" width="404" height="0.0"/>
<rect key="frame" x="5" y="259" width="404" height="0.0"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="16"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<tableView hidden="YES" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="kB1-D9-Jpc">
<rect key="frame" x="5" y="258.33333333333331" width="404" height="0.0"/>
<rect key="frame" x="5" y="259" width="404" height="0.0"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" id="Uhk-ez-kna"/>
</constraints>
</tableView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PfV-Yj-8cg">
<rect key="frame" x="5" y="263.33333333333331" width="404" height="0.66666666666668561"/>
<rect key="frame" x="5" y="264" width="404" height="0.66666666666668561"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="0.69999999999999996" id="4xH-CV-oza"/>
</constraints>
</view>
<stackView hidden="YES" opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="IIC-eN-1kV">
<rect key="frame" x="5" y="269" width="404" height="40.666666666666686"/>
<rect key="frame" x="5" y="269.66666666666669" width="404" height="40.666666666666686"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="0fF-q8-366">
<rect key="frame" x="0.0" y="0.0" width="404" height="0.0"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Subtotal: " textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="X02-Xy-T6S" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="78" height="0.0"/>
<rect key="frame" x="0.0" y="0.0" width="82" height="0.0"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rs. 0" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VJO-dL-zw7" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="362.33333333333331" y="0.0" width="41.666666666666686" height="0.0"/>
<rect key="frame" x="363" y="0.0" width="41" height="0.0"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
@@ -269,13 +269,13 @@
<rect key="frame" x="0.0" y="20" width="404" height="0.0"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Discount: " textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SjJ-9G-tNV" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="81.666666666666671" height="0.0"/>
<rect key="frame" x="0.0" y="0.0" width="84" height="0.0"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rs. 0" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Aru-WM-a5c" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="362.33333333333331" y="0.0" width="41.666666666666686" height="0.0"/>
<rect key="frame" x="363" y="0.0" width="41" height="0.0"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
@@ -292,19 +292,19 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="13" translatesAutoresizingMaskIntoConstraints="NO" id="qF1-U6-f3P">
<rect key="frame" x="5" y="274" width="404" height="84"/>
<rect key="frame" x="5" y="274.66666666666669" width="404" height="84.666666666666686"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="YSF-eO-Ree">
<rect key="frame" x="0.0" y="0.0" width="404" height="21"/>
<rect key="frame" x="0.0" y="0.0" width="404" height="21.666666666666668"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Total Amount: " textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mDO-yI-336" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="116.33333333333333" height="21"/>
<rect key="frame" x="0.0" y="0.0" width="122" height="21.666666666666668"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rs. 0" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lH2-35-Ttu" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="362.33333333333331" y="0.0" width="41.666666666666686" height="21"/>
<rect key="frame" x="363" y="0.0" width="41" height="21.666666666666668"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
@@ -312,7 +312,7 @@
</subviews>
</stackView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rp4-qX-3OH" customClass="LocalisedElementsButton" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="34" width="404" height="50"/>
<rect key="frame" x="0.0" y="34.666666666666629" width="404" height="50"/>
<color key="backgroundColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="UFU-ci-N8q">
@@ -388,7 +388,7 @@
</scenes>
<designables>
<designable name="0cZ-tT-3PH">
<size key="intrinsicContentSize" width="186.66666666666666" height="20.333333333333332"/>
<size key="intrinsicContentSize" width="184.33333333333334" height="21"/>
</designable>
</designables>
<resources>
@@ -398,7 +398,7 @@
<color red="0.10599999874830246" green="0.050999999046325684" blue="0.60399997234344482" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<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>
</resources>
</document>

View File

@@ -34,6 +34,13 @@ class CartDataCache{
static let cartBadgeLabel = UILabel()
static let shareInstance = CartDataCache()
func removeAll(){
CartDataCache.addressData.removeAll()
CartDataCache.cartListData.removeAll()
CartDataCache.isFetched = false
CartDataCache.cartBadgeLabel.text = "0"
}
func getCartList(vc : UIViewController, onCompletion : @escaping (Bool) -> Void){
let headers : HTTPHeaders = ["access-token" : AuthFunc.shareInstance.getAccessToken()]

View File

@@ -39,6 +39,10 @@ class CartListVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
override func viewDidDisappear(_ animated: Bool) {
@@ -51,6 +55,8 @@ class CartListVC: UIViewController {
// MARK: - Tap Handler
@IBAction func checkoutBtnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addShopCount(postID: 0)
if AuthFunc.shareInstance.getUserType() == 1{ // Kids cannot purchase goods
// Utilities.alertWithBtn(title: "", msgBody: "Children cannot purchase this product. Please contact your Guardian.", okBtnStr: "OK", vc: self)
let sb = UIStoryboard(name: K.StoryBoard.customAlerts, bundle: nil)
@@ -108,6 +114,9 @@ extension CartListVC : TableViewSRC{
}
private func handleMoveToTrash(indexPath : Int) {
if let postID = CartDataCache.cartListData[indexPath].id{
PersistentStorage.shared.addShopCount(postID: postID)
}
let sb = UIStoryboard(name: K.StoryBoard.customAlerts, bundle: nil)
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.CustomAlerts.yesNoAlertVC) as! YesNoAlertVC
vcPush.mainTitleText = "Alert!"
@@ -118,11 +127,16 @@ extension CartListVC : TableViewSRC{
switch mode{
case .yes:
guard let self else{return}
if let postID = CartDataCache.cartListData[indexPath].id{
PersistentStorage.shared.addShopCount(postID: postID)
}
if let shopMasterID = CartDataCache.cartListData[indexPath].id{
vm.removeItemFromCart(shopMasterID: shopMasterID, index: indexPath)
}
case .no:
print("no")
if let postID = CartDataCache.cartListData[indexPath].id{
PersistentStorage.shared.addShopCount(postID: postID)
}
}
}
vcPush.modalPresentationStyle = .overCurrentContext

View File

@@ -48,6 +48,10 @@ class CartPaymentOptionsVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
override func viewDidDisappear(_ animated: Bool) {
@@ -59,7 +63,7 @@ class CartPaymentOptionsVC: UIViewController {
@IBAction func offerCouponBtnTapped(_ sender: UIButton) {
vm.isExpanded.toggle()
PersistentStorage.shared.addShopCount(postID: 0)
if vm.isExpanded{
sender.setImage(UIImage(systemName: "chevron.down.circle.fill"), for: .normal)
self.couponTableView.isHidden = false
@@ -70,6 +74,7 @@ class CartPaymentOptionsVC: UIViewController {
}
@IBAction func confirmBtnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addShopCount(postID: 0)
let sb = UIStoryboard(name: K.StoryBoard.address, bundle: nil)
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Address.addressListVC) as! AddressListVC
vcPush.vm.couponCodeApplied = vm.couponCodeApplied
@@ -78,6 +83,7 @@ class CartPaymentOptionsVC: UIViewController {
}
@IBAction func applyBtnTapped(_ sender: UIButton) {
PersistentStorage.shared.addShopCount(postID: 0)
if self.couponCodeTF.text == "" {
Utilities.alertWithBtn(title: "", msgBody: "Please enter coupon code", okBtnStr: "OK", vc: self)
return
@@ -120,6 +126,7 @@ extension CartPaymentOptionsVC : TableViewSRC{
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if tableView == couponTableView{
PersistentStorage.shared.addShopCount(postID: 0)
let couponCode = vm.couponData[indexPath.row].couponCode
vm.couponCodeSelected = vm.couponData[indexPath.row].couponCode ?? ""
self.couponCodeTF.text = couponCode

View File

@@ -15,5 +15,9 @@ extension K{
static var topView = TopViewEnum.theme1
static var myListSoftReload = false
static var reloadMyListAudioBooks = false
static var reloadKaraoke = false
static var reloadGames = false
}
}

View File

@@ -8,6 +8,7 @@
import UIKit
import Lottie
import Alamofire
import FirebaseAnalytics
class OnBoardVM{
@@ -133,6 +134,11 @@ class OnBoardVM{
Utilities.dismissProgressHUD()
guard let dataUser = data.data else{return}
if let newGuest = dataUser.newGuest, newGuest == true{
//Fire Analytics
Analytics.logEvent(K.AnalyticsEventKeys.guest_login_iOS, parameters: nil)
}
self.vc.toast(msg: data.message ?? "Unrecognised error" , time: 2) {
let userDataConverted = UserDataDM.ResultData(id: nil, username: dataUser.username, fullname: dataUser.fullname, birthdate: nil, email: nil, avtar: nil, avtarURL: nil, userType: "3", languageMasterID: nil, lastLogin: nil, rememberToken: nil, childDetail: nil, language: nil, alreadyLoggedIn: nil, isDeactive: nil)
AuthFunc.shareInstance.loginDefaults(data: userDataConverted)

View File

@@ -40,6 +40,9 @@ class GamesDetailVC: UIViewController {
@objc func handleTap(_ gesture: UITapGestureRecognizer) {
let location = gesture.location(in: outerView)
if !contentView.frame.contains(location) {
if let postID = gameData?.id{
PersistentStorage.shared.addGamesCount(postID: postID)
}
self.dismiss(animated: true)
}
}
@@ -105,6 +108,9 @@ class GamesDetailVC: UIViewController {
addView.addTapGesture { [weak self] in
guard let self else{return}
if let postID = gameData?.id{
PersistentStorage.shared.addGamesCount(postID: postID)
}
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
if let gameData{
@@ -114,10 +120,11 @@ class GamesDetailVC: UIViewController {
//remove
LikeFavCommonFunc.shareInstance.removeFavourite(postID: showID, postType: postType, categoryID: 0, vc: self) { isDone in
self.gameData?.markAsFavourite = false
if let index = MyListDataTemp.shareInstance.favListingData?.gameData?.firstIndex(where: {$0.id == showID}){
MyListDataTemp.shareInstance.favListingData?.gameData?.remove(at: index)
K.GVar.myListSoftReload = true
}
// if let index = MyListDataTemp.shareInstance.favListingData?.gameData?.firstIndex(where: {$0.id == showID}){
// MyListDataTemp.shareInstance.favListingData?.gameData?.remove(at: index)
// K.GVar.myListSoftReload = true
// }
K.GVar.reloadGames = true
self.delegate?.updateRows(index: self.gameIndex, type: .favourite, isFav: false, isLike: nil, id: showID)
self.initView()
}
@@ -125,10 +132,12 @@ class GamesDetailVC: UIViewController {
//add
LikeFavCommonFunc.shareInstance.addFavourite(postID: showID, postType: postType, categoryID: 0, vc: self) { isDone in
self.gameData?.markAsFavourite = true
if let gameData = self.gameData{
MyListDataTemp.shareInstance.favListingData?.gameData?.append(gameData)
}
K.GVar.myListSoftReload = true
// if let gameData = self.gameData{
// MyListDataTemp.shareInstance.favListingData?.gameData?.append(gameData)
// K.GVar.myListSoftReload = true
// }
K.GVar.reloadGames = true
self.delegate?.updateRows(index: self.gameIndex, type: .favourite, isFav: true, isLike: nil, id: showID)
self.initView()
}
@@ -139,6 +148,9 @@ class GamesDetailVC: UIViewController {
likeView.addTapGesture { [weak self] in
guard let self else{return}
if let postID = gameData?.id{
PersistentStorage.shared.addGamesCount(postID: postID)
}
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
if let gameData{
@@ -184,10 +196,14 @@ class GamesDetailVC: UIViewController {
}
@IBAction func playNowBtnTapped(_ sender: LocalisedElementsButton) {
if let postID = gameData?.id{
PersistentStorage.shared.addGamesCount(postID: postID)
}
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.postID = gameData?.id
vcPush.orientation = self.gameData?.screenOrientation
vcPush.modalTransitionStyle = .crossDissolve
vcPush.modalPresentationStyle = .fullScreen
@@ -195,8 +211,9 @@ class GamesDetailVC: UIViewController {
}
@IBAction func closeBtnTapped(_ sender: UIButton) {
self.dismiss(animated: true) {
if let postID = gameData?.id{
PersistentStorage.shared.addGamesCount(postID: postID)
}
self.dismiss(animated: true)
}
}

View File

@@ -42,6 +42,13 @@ class GamesListVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
if let postID = vm.gameData[vm.indexToLoad].id{
PersistentStorage.shared.addGamesCount(postID: postID)
}
}
}
override func viewDidDisappear(_ animated: Bool) {
@@ -57,10 +64,15 @@ class GamesListVC: UIViewController {
// MARK: - Tap Handler
@IBAction func gameBtnTapped(_ 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
let gameData = vm.gameData[vm.indexToLoad]
if let postID = gameData.id{
PersistentStorage.shared.addGamesCount(postID: postID)
}
vcPush.url = gameData.gameURL
vcPush.orientation = gameData.screenOrientation
vcPush.modalTransitionStyle = .crossDissolve
@@ -69,6 +81,8 @@ class GamesListVC: UIViewController {
}
@IBAction func loadMoreBtnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addOthersCount()
loadMoreBtn.isHidden = true
vm.pageNo += 1
loadMoreActivityIndicator.startAnimating()
@@ -110,7 +124,9 @@ extension GamesListVC : TableViewSRC{
vm.setHeaderData()
let data = vm.gameData[indexPath.row]
if let postID = data.id{
PersistentStorage.shared.addGamesCount(postID: postID)
}
let sb = UIStoryboard(name: K.StoryBoard.Games, bundle: nil)
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Games.gamesDetailVC) as! GamesDetailVC
vcPush.modalPresentationStyle = .overCurrentContext

View File

@@ -12,6 +12,8 @@ class GamesWebViewVC: UIViewController {
var url : String?
var orientation : ScreenOrientation?
var count = 0
var postID : Int?
@IBOutlet weak var webView: WKWebView!
@@ -32,14 +34,18 @@ class GamesWebViewVC: UIViewController {
let link = URL(string: authUrl)!
let request = URLRequest(url: link)
webView.load(request)
webView.addTapGesture { [weak self] in
guard let self else{return}
count += 1
}
}
// func rotateView(to angle: CGFloat) {
// // Apply rotation to the view's transform
// view.transform = CGAffineTransform(rotationAngle: angle)
// }
@IBAction func backBtnTapped(_ sender: UIButton) {
if let postID = self.postID{
PersistentStorage.shared.addGamesCount(postID: postID)
}
let sb = UIStoryboard(name: K.StoryBoard.customAlerts, bundle: nil)
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.CustomAlerts.yesNoAlertVC) as! YesNoAlertVC
vcPush.mainTitleText = "Warning"
@@ -50,6 +56,9 @@ class GamesWebViewVC: UIViewController {
guard let self else{return}
switch mode{
case .yes:
if let postID = self.postID{
PersistentStorage.shared.addGamesCount(postID: postID)
}
if orientation == .landscape{
appDelegate.deviceOrientation = .portrait
let value = UIInterfaceOrientation.portrait.rawValue
@@ -61,6 +70,9 @@ class GamesWebViewVC: UIViewController {
}
case .no:
if let postID = self.postID{
PersistentStorage.shared.addGamesCount(postID: postID)
}
print("no")
}
}

View File

@@ -140,6 +140,9 @@ class GamesListVM{
func updateFavLikes(type : FavCellCLick, index : Int){
let data = gameData[index]
if let postID = data.id{
PersistentStorage.shared.addGamesCount(postID: postID)
}
switch type {
case .favourite:
guard let isFav = data.markAsFavourite ,let postID = data.id,let postType = data.contentMoreDetails?.first?.postType else{return}
@@ -148,7 +151,7 @@ class GamesListVM{
if isDone{
gameData[index].markAsFavourite = false
vc.gamesListingTableView.reloadRows(at: [IndexPath(row: index, section: 0)],with: .none)
K.GVar.reloadMyList = true
K.GVar.reloadGames = true
// MyList Update
// if MyListDataTemp.shareInstance.isDatafetched{
// if let indexRemove = MyListDataTemp.shareInstance.favListingData?.gameData?.firstIndex(where: {$0.id == postID}){
@@ -163,7 +166,7 @@ class GamesListVM{
if isDone{
gameData[index].markAsFavourite = true
vc.gamesListingTableView.reloadRows(at: [IndexPath(row: index, section: 0)],with: .none)
K.GVar.reloadMyList = true
K.GVar.reloadGames = true
// MyList Update
// if MyListDataTemp.shareInstance.isDatafetched{
// let gameData = gameData[index]

View File

@@ -82,6 +82,33 @@ class MyListVC: UIViewController{
vm.getFavouriteListing()
}
if K.GVar.reloadMyListAudioBooks{
MyListDataTemp.shareInstance.updateAudioBooks() { isDone in
if isDone{
self.audioBooksCV.reloadData()
}
}
K.GVar.reloadMyListAudioBooks = false
}
if K.GVar.reloadKaraoke{
MyListDataTemp.shareInstance.updateKaraoke() { isDone in
if isDone{
self.karaokeCV.reloadData()
}
}
K.GVar.reloadKaraoke = false
}
if K.GVar.reloadGames{
MyListDataTemp.shareInstance.updateGames() { isDone in
if isDone{
self.gamesCV.reloadData()
}
}
K.GVar.reloadGames = false
}
if K.GVar.myListSoftReload{
vm.reloadCollections()
vm.checkNil()

View File

@@ -25,7 +25,6 @@ class MyListViewAllVC: UIViewController {
// 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.view.applyGradient(colors: [color1,color2], startPoint: .Point.left.point , endPoint: .Point.right.point)
navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
navigationController?.navigationBar.shadowImage = UIImage()
}

View File

@@ -6,6 +6,7 @@
//
import Foundation
import Alamofire
class MyListDataTemp{
@@ -16,4 +17,121 @@ class MyListDataTemp{
var webSeriesHindi = [FavouriteListingDM.ResultData.ShowDatum]()
var isDatafetched = false
// MARK: - Get Favourite Listing
func updateAudioBooks(onCompletion : @escaping (Bool) -> ()){
if !isDatafetched{
}
let headers : HTTPHeaders = ["Accept-Language" : AuthFunc.shareInstance.languageSelected == .english ? "English" : "Hindi",
"access-token": AuthFunc.shareInstance.getAccessToken()]
let params : Parameters = ["post_type" : 7,
"api_version" : "v2",
"start" : 0,
"limit" : "3",
"category_id" : 0]
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.Home.favourite_listing, method: .post,parameters : params, headers: headers) { [weak self](result : Result<BaseResponseModel<FavouriteListingDM>, NetworkManager.APIError>) in
switch result{
case .success(let data):
switch data.success{
case 0:
Utilities.dismissProgressHUD()
onCompletion(false)
case 1:
Utilities.dismissProgressHUD()
guard let audioData = data.data?.result?.audioData else{
onCompletion(false)
return
}
self?.favListingData?.audioData = audioData
onCompletion(true)
default:
onCompletion(false)
}
case .failure(let error):
print("Audio Error:- ", error)
onCompletion(false)
}
}
}
func updateKaraoke(onCompletion : @escaping (Bool) -> ()){
if !isDatafetched{
}
let headers : HTTPHeaders = ["Accept-Language" : AuthFunc.shareInstance.languageSelected == .english ? "English" : "Hindi",
"access-token": AuthFunc.shareInstance.getAccessToken()]
let params : Parameters = ["post_type" : 8,
"api_version" : "v2",
"start" : 0,
"limit" : "3",
"category_id" : 0]
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.Home.favourite_listing, method: .post,parameters : params, headers: headers) { [weak self](result : Result<BaseResponseModel<FavouriteListingDM>, NetworkManager.APIError>) in
switch result{
case .success(let data):
switch data.success{
case 0:
Utilities.dismissProgressHUD()
onCompletion(false)
case 1:
Utilities.dismissProgressHUD()
guard let singKaraokeData = data.data?.result?.singKaraokeData else{
onCompletion(false)
return
}
self?.favListingData?.singKaraokeData = singKaraokeData
onCompletion(true)
default:
onCompletion(false)
}
case .failure(let error):
print("Audio Error:- ", error)
onCompletion(false)
}
}
}
func updateGames(onCompletion : @escaping (Bool) -> ()){
if !isDatafetched{
}
let headers : HTTPHeaders = ["Accept-Language" : AuthFunc.shareInstance.languageSelected == .english ? "English" : "Hindi",
"access-token": AuthFunc.shareInstance.getAccessToken()]
let params : Parameters = ["post_type" : 6,
"api_version" : "v2",
"start" : 0,
"limit" : "3",
"category_id" : 0]
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.Home.favourite_listing, method: .post,parameters : params, headers: headers) { [weak self](result : Result<BaseResponseModel<FavouriteListingDM>, NetworkManager.APIError>) in
switch result{
case .success(let data):
switch data.success{
case 0:
Utilities.dismissProgressHUD()
onCompletion(false)
case 1:
Utilities.dismissProgressHUD()
guard let gameData = data.data?.result?.gameData else{
onCompletion(false)
return
}
self?.favListingData?.gameData = gameData
onCompletion(true)
default:
onCompletion(false)
}
case .failure(let error):
print("Audio Error:- ", error)
onCompletion(false)
}
}
}
}

View File

@@ -57,6 +57,10 @@ class JWKaraokePlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate
}
@IBAction func startRecordingBtnTapped(_ sender: LocalisedElementsButton) {
if let postID = vm.postID{
PersistentStorage.shared.addKaraokeCount(postID: postID)
}
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
self.playBtn.isEnabled = false
@@ -83,6 +87,9 @@ class JWKaraokePlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate
}
@IBAction func playBtnTapped(_ sender: LocalisedElementsButton) {
if let postID = vm.postID{
PersistentStorage.shared.addKaraokeCount(postID: postID)
}
if !isPlaying {
vm.playMixedAudio()
sender.setTitle("Pause", for: .normal)
@@ -110,19 +117,29 @@ class JWKaraokePlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate
}
@IBAction func downloadRecording(_ sender: LocalisedElementsButton) {
if let postID = vm.postID{
PersistentStorage.shared.addKaraokeCount(postID: postID)
}
print("DownloadRecording")
vm.saveToFilesApp()
}
@IBAction func backBtnTapped(_ sender: UIButton) {
if let postID = vm.postID{
PersistentStorage.shared.addKaraokeCount(postID: postID)
}
self.player.stop()
self.dismiss(animated: true)
}
@IBAction func retryBtnTapped(_ sender: LocalisedElementsButton) {
if let postID = vm.postID{
PersistentStorage.shared.addKaraokeCount(postID: postID)
}
retryKaraokeBtn.isHidden = true
vm.setupKaraoke()
}
// MARK: - JWPlayerViewControllerDelegate
override func jwplayer(_ player: any JWPlayer, didFinishLoadingWithTime loadTime: TimeInterval) {
@@ -174,9 +191,24 @@ class JWKaraokePlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate
print("Buffering Reason:", reason)
}
//When Player is Paused
override func jwplayer(_ player: JWPlayer, didPauseWithReason reason: JWPauseReason) {
super.jwplayer(player, didPauseWithReason: reason)
// Implement custom behavior
if reason == .interaction{
if let postID = vm.postID{
PersistentStorage.shared.addKaraokeCount(postID: postID)
}
}
}
//When Player is Play
override func jwplayer(_ player: JWPlayer, isPlayingWithReason reason: JWPlayReason) {
super.jwplayer(player, isPlayingWithReason: reason)
if reason == .interaction{
if let postID = vm.postID{
PersistentStorage.shared.addKaraokeCount(postID: postID)
}
}
}
}

View File

@@ -54,11 +54,13 @@ class KaraokeDetailsVC: UIViewController {
@objc func handleTap(_ gesture: UITapGestureRecognizer) {
let location = gesture.location(in: outerView)
if !contentView.frame.contains(location) {
if let karaokeData , let postID = karaokeData.id{
PersistentStorage.shared.addKaraokeCount(postID: postID)
}
self.dismiss(animated: true)
}
}
func initView(){
if let karaokeData{
if let url = karaokeData.thumbnailPath{
@@ -126,14 +128,16 @@ class KaraokeDetailsVC: UIViewController {
if let karaokeData{
guard let showID = karaokeData.id, let isFav = karaokeData.markAsFavourite, let postType = karaokeData.contentMoreDetails?.first?.postType else{return}
PersistentStorage.shared.addKaraokeCount(postID: showID)
if isFav {
LikeFavCommonFunc.shareInstance.removeFavourite(postID: showID, postType: postType, categoryID: 0, vc: self) { isDone in
self.karaokeData?.markAsFavourite = false
if let index = MyListDataTemp.shareInstance.favListingData?.singKaraokeData?.firstIndex(where: {$0.id == showID}){
MyListDataTemp.shareInstance.favListingData?.singKaraokeData?.remove(at: index)
K.GVar.myListSoftReload = true
}
// if let index = MyListDataTemp.shareInstance.favListingData?.singKaraokeData?.firstIndex(where: {$0.id == showID}){
// MyListDataTemp.shareInstance.favListingData?.singKaraokeData?.remove(at: index)
// K.GVar.myListSoftReload = true
// }
K.GVar.reloadKaraoke = true
//if coming from mylist
self.delegate?.updateRows(index: self.karaokeIndex, type: .favourite, isFav: false, isLike: nil, id: showID)
@@ -143,10 +147,11 @@ class KaraokeDetailsVC: UIViewController {
LikeFavCommonFunc.shareInstance.addFavourite(postID: showID, postType: postType, categoryID: 0, vc: self) { isDone in
self.karaokeData?.markAsFavourite = true
if let karaokeData = self.karaokeData{
MyListDataTemp.shareInstance.favListingData?.singKaraokeData?.append(karaokeData)
K.GVar.myListSoftReload = true
}
// if let karaokeData = self.karaokeData{
// MyListDataTemp.shareInstance.favListingData?.singKaraokeData?.append(karaokeData)
// K.GVar.myListSoftReload = true
// }
K.GVar.reloadKaraoke = true
//if coming from mylist
self.delegate?.updateRows(index: self.karaokeIndex, type: .favourite, isFav: true, isLike: nil, id: showID)
@@ -163,6 +168,7 @@ class KaraokeDetailsVC: UIViewController {
if let karaokeData{
guard let showID = karaokeData.id, let isLiked = karaokeData.isLiked, let postType = karaokeData.contentMoreDetails?.first?.postType else{return}
PersistentStorage.shared.addKaraokeCount(postID: showID)
if isLiked{
LikeFavCommonFunc.shareInstance.unlikePost(postID: showID, postType: postType, vc: self) { isDone in
@@ -196,7 +202,13 @@ class KaraokeDetailsVC: UIViewController {
}
}
shareView.addTapGesture {
shareView.addTapGesture { [weak self] in
guard let self else{return}
if let karaokeData, let showID = karaokeData.id{
PersistentStorage.shared.addKaraokeCount(postID: showID)
}
if let name = URL(string: "https://apps.apple.com/in/app/woka/id6465305185"), !name.absoluteString.isEmpty {
let objectsToShare = [name]
let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
@@ -217,6 +229,10 @@ class KaraokeDetailsVC: UIViewController {
var itemBuild = JwPlayerItemCreate(url: "")
var mp4URL = String()
guard let postID = karaokeData?.id else{return}
PersistentStorage.shared.addKaraokeCount(postID: postID)
if AuthFunc.shareInstance.getDefaultLanguage() == .english{
if let englishData = karaokeData?.contentMoreDetails?.filter({$0.languageMasterID == 1}).first{
guard let url = englishData.url , let title = englishData.title, let englishMp4URL = englishData.videoUrlHd else{return}
@@ -255,7 +271,7 @@ class KaraokeDetailsVC: UIViewController {
vc.config = config
vc.vm.videoTitle = itemBuild.titles
vc.vm.videoUrl = mp4URL
vc.vm.postID = postID
vc.modalPresentationStyle = .overFullScreen
vc.modalTransitionStyle = .crossDissolve
// vc.documentAudioUrl = url
@@ -275,6 +291,7 @@ class KaraokeDetailsVC: UIViewController {
}
@IBAction func closeBtnTapped(_ sender: UIButton) {
PersistentStorage.shared.addOthersCount()
self.dismiss(animated: true)
}
}

View File

@@ -34,6 +34,7 @@ class KaraokeListingVC: UIViewController {
vm.initView()
navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
navigationController?.navigationBar.shadowImage = UIImage()
}
override func viewWillAppear(_ animated: Bool) {
@@ -45,6 +46,11 @@ class KaraokeListingVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
override func viewDidDisappear(_ animated: Bool) {
@@ -60,11 +66,18 @@ class KaraokeListingVC: UIViewController {
}
@IBAction func loadMoreBtnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addOthersCount()
loadMoreBtn.isHidden = true
vm.pageNo += 1
loadMoreActivityIndicator.startAnimating()
vm.getKaraokeListing(isBtnClick: true)
}
@IBAction func singBtnTapped(_ sender: LocalisedElementsButton) {
if let id = vm.headerData?.id{
PersistentStorage.shared.addKaraokeCount(postID: id)
}
}
}
// MARK: - CollectionView Delegate and Data Source
@@ -84,6 +97,7 @@ extension KaraokeListingVC : CollectionViewSRC{
guard let postID = data.id ,let postType = data.contentMoreDetails?.first?.postType else{return}
let isFav = data.markAsFavourite
let isLiked = data.isLiked
PersistentStorage.shared.addKaraokeCount(postID: postID)
vm.updateFavLikes(type: type, isFav: isFav, isLiked: isLiked, postID: postID, postType: postType)
}
@@ -93,6 +107,9 @@ extension KaraokeListingVC : CollectionViewSRC{
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
let data = vm.continueWatchingData[indexPath.row]
if let id = data.id{
PersistentStorage.shared.addKaraokeCount(postID: id)
}
/*
Updated the top header data
@@ -161,6 +178,8 @@ extension KaraokeListingVC : TableViewSRC{
let isFav = data.markAsFavourite
let isLiked = data.isLiked
PersistentStorage.shared.addKaraokeCount(postID: postID)
vm.updateFavLikes(type: type, isFav: isFav, isLiked: isLiked, postID: postID, postType: postType)
}
return cell
@@ -171,6 +190,9 @@ extension KaraokeListingVC : TableViewSRC{
if vm.karaokeListData.count == 0 {return}
let data = vm.karaokeListData[indexPath.row]
if let id = data.id{
PersistentStorage.shared.addKaraokeCount(postID: id)
}
/*
Updated the top header data
*/

View File

@@ -87,6 +87,9 @@
<integer key="value" value="25"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="singBtnTapped:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="6HL-qZ-aeQ"/>
</connections>
</button>
</subviews>
</stackView>

View File

@@ -19,6 +19,9 @@ class JWKaraokePlayerVM{
var videoTitle : String?
var videoUrl : String?
//for mapping the post
var postID : Int?
//Start and end time for trimming the audio
var startTime : TimeInterval?
var endTime : TimeInterval?

View File

@@ -190,7 +190,7 @@ class KaraokeListingVM{
if let showListIndex = karaokeListData.firstIndex(where: { $0.id == postID }){
karaokeListData[showListIndex].markAsFavourite = false
vc.karaokeListingTableView.reloadRows(at: [IndexPath(row: showListIndex, section: 0)],with: .none)
K.GVar.reloadMyList = true
K.GVar.reloadKaraoke = true
// // MyList Update
// if MyListDataTemp.shareInstance.isDatafetched{
// if let indexRemove = MyListDataTemp.shareInstance.favListingData?.singKaraokeData?.firstIndex(where: {$0.id == postID}){
@@ -207,7 +207,7 @@ class KaraokeListingVM{
if let continueWatchingIndex = continueWatchingData.firstIndex(where: { $0.id == postID }){
continueWatchingData[continueWatchingIndex].markAsFavourite = false
vc.continueWatchingCV.reloadItems(at: [IndexPath(row: continueWatchingIndex, section: 0)])
K.GVar.reloadMyList = true
K.GVar.reloadKaraoke = true
// MyList Update
// if MyListDataTemp.shareInstance.isDatafetched{
// if let indexRemove = MyListDataTemp.shareInstance.favListingData?.singKaraokeData?.firstIndex(where: {$0.id == postID}){
@@ -225,7 +225,7 @@ class KaraokeListingVM{
if let showListIndex = karaokeListData.firstIndex(where: { $0.id == postID }){
karaokeListData[showListIndex].markAsFavourite = true
vc.karaokeListingTableView.reloadRows(at: [IndexPath(row: showListIndex, section: 0)],with: .none)
K.GVar.reloadMyList = true
K.GVar.reloadKaraoke = true
// MyList Update
// if MyListDataTemp.shareInstance.isDatafetched{
// let karaokeData = karaokeListData[showListIndex]
@@ -241,7 +241,7 @@ class KaraokeListingVM{
if let continueWatchingIndex = continueWatchingData.firstIndex(where: { $0.id == postID }){
continueWatchingData[continueWatchingIndex].markAsFavourite = true
vc.continueWatchingCV.reloadItems(at: [IndexPath(row: continueWatchingIndex, section: 0)])
K.GVar.reloadMyList = true
K.GVar.reloadKaraoke = true
// MyList Update
// if MyListDataTemp.shareInstance.isDatafetched{
// // if data is updated for main list this ill not work

View File

@@ -27,7 +27,7 @@
*/
"Forgot your Password?" = "अपना पासवर्ड भूल गए?";
"PLEASE GIVE US YOUR USERNAME" = "कृपया हमें अपना उपयोगकर्ता नाम दें";
"We will send a reset code to their email" = "हम आपके माता-पिता के ईमेल पर एक रीसेट कोड भेजेंगे";
"We will send a reset code to email" = "हम आपके ईमेल पर एक रीसेट कोड भेजेंगे";
/*
Create PAssword VC

View File

@@ -49,17 +49,26 @@ class OnBoardVC: UIViewController {
super.viewWillDisappear(animated)
navigationController?.setNavigationBarHidden(true, animated: animated)
vm.stopBackGroundAnimationJSON()
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
// MARK: - Button Tap Handler
@IBAction func createAccountBtnTapped(_ sender: UIButton) {
PersistentStorage.shared.addOthersCount()
let sb = UIStoryboard(name: K.StoryBoard.main, bundle: nil)
let vc = sb.instantiateViewController(withIdentifier: K.StoryBoardID.OnBoarding.selectAgeVC) as! SelectAgeVC
self.navigationController?.pushViewController(vc, animated: true)
}
@IBAction func loginBtnTapped(_ sender: UIButton) {
PersistentStorage.shared.addOthersCount()
let sb = UIStoryboard(name: K.StoryBoard.authenticationSB, bundle: nil)
let vc = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Authentication.loginVC) as! LoginVC
self.navigationController?.pushViewController(vc, animated: true)
@@ -67,6 +76,7 @@ class OnBoardVC: UIViewController {
@IBAction func guestLoginBtnTapped(_ sender: UIButton) {
PersistentStorage.shared.addOthersCount()
vm.guestLogin()
}

View File

@@ -42,10 +42,11 @@ class SelectAgeVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
// MARK: - Button Tap Handler
}

View File

@@ -32,6 +32,7 @@ class SplashVC: UIViewController {
}
@IBAction func languageBtnTapped(_ sender: UIButton) {
PersistentStorage.shared.addOthersCount()
switch sender{
case hindiBtn:

View File

@@ -10,8 +10,10 @@ import Foundation
struct GuestDataDM: Codable {
var username: String?
var fullname: String?
var newGuest: Bool?
enum CodingKeys: String, CodingKey {
case username, fullname
case newGuest = "new_guest"
}
}

View File

@@ -38,6 +38,7 @@ class SelectAgeVM{
}
@objc func kid() {
PersistentStorage.shared.addOthersCount()
// Apply click effect animation
UIView.animate(withDuration: 0.1, animations: {
self.vc.underAgeView.transform = CGAffineTransform(scaleX: 0.9, y: 0.9)
@@ -51,6 +52,7 @@ class SelectAgeVM{
}
@objc func adult() {
PersistentStorage.shared.addOthersCount()
// Apply click effect animation
UIView.animate(withDuration: 0.1, animations: {
self.vc.aboveAgeView.transform = CGAffineTransform(scaleX: 0.9, y: 0.9)

View File

@@ -16,8 +16,6 @@ class SplashVM{
var player: AVAudioPlayer?
func initView(){
// Analytics.logEvent(K.AnalyticsEventKeys.guest_login_iOS, parameters: nil)
AuthFunc.shareInstance.getStaticURLs()
vc.activityIndicator.hidesWhenStopped = true
let color1 = #colorLiteral(red: 0.144693464, green: 0.1426281333, blue: 0.6686832905, alpha: 1)

View File

@@ -285,6 +285,26 @@ final class PersistentStorage
PersistentStorage.shared.checkIfExist( key: .post_type,clicksData: userClicks)
}
func addKaraokeCount(postID : Int){
let userClicks = UserClickData(clickCounts: 1, categoryId: 0, postId: postID, postType: PostType.karaokeVideo.rawValue)
PersistentStorage.shared.checkIfExist( key: .post_type,clicksData: userClicks)
}
func addAudioCount(postID : Int){
let userClicks = UserClickData(clickCounts: 1, categoryId: 0, postId: postID, postType: PostType.audio.rawValue)
PersistentStorage.shared.checkIfExist( key: .post_type,clicksData: userClicks)
}
func addGamesCount(postID : Int){
let userClicks = UserClickData(clickCounts: 1, categoryId: 0, postId: postID, postType: PostType.game.rawValue)
PersistentStorage.shared.checkIfExist( key: .post_type,clicksData: userClicks)
}
func addShopCount(postID : Int){
let userClicks = UserClickData(clickCounts: 1, categoryId: 0, postId: postID, postType: PostType.shopProduct.rawValue)
PersistentStorage.shared.checkIfExist( key: .post_type,clicksData: userClicks)
}
func addRadioCount(){
guard let postID = AuthFunc.shareInstance.staticURLs?.liveFmData?.id else{return}
let userClicks = UserClickData(clickCounts: 1, categoryId: 0, postId: postID, postType: PostType.FM.rawValue)
@@ -302,8 +322,8 @@ final class PersistentStorage
PersistentStorage.shared.checkIfExist( key: .post_type,clicksData: userClicks)
}
func addWebSeries(catID : Int, postID : Int){
let userClicks = UserClickData(clickCounts: 1, categoryId: catID, postId: postID, postType: PostType.series.rawValue)
func addWebSeries(catID : Int, postID : Int, postType : PostType){
let userClicks = UserClickData(clickCounts: 1, categoryId: catID, postId: postID, postType: postType.rawValue)
PersistentStorage.shared.checkWebSeries(clicksData: userClicks)
}
}

View File

@@ -49,6 +49,10 @@ class ProductDetailsVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
override func viewDidDisappear(_ animated: Bool) {
@@ -63,6 +67,9 @@ class ProductDetailsVC: UIViewController {
}
@IBAction func addToCartBtnTapped(_ sender: LocalisedElementsButton) {
if let postID = vm.productDetails?.id{
PersistentStorage.shared.addShopCount(postID: postID)
}
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
if sender.titleLabel?.text == "Add to Cart"{

View File

@@ -37,6 +37,10 @@ class ShopCategoryVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
override func viewDidDisappear(_ animated: Bool) {
@@ -63,6 +67,10 @@ extension ShopCategoryVC : TableViewSRC{
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let data = vm.categoryData[indexPath.row]
if let catID = data.id{
PersistentStorage.shared.addShopCount(postID: catID)
}
let sb = UIStoryboard(name: K.StoryBoard.shop, bundle: nil)
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Shop.shopProductsVC) as! ShopProductsVC
vcPush.vm.categoryID = data.id

View File

@@ -36,6 +36,10 @@ class ShopListingVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
override func viewDidDisappear(_ animated: Bool) {
@@ -69,6 +73,9 @@ extension ShopListingVC : TableViewSRC{
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if vm.superCatData.count == 0 {return}
let superCatID = vm.superCatData[indexPath.row].id
if let superCatID{
PersistentStorage.shared.addShopCount(postID: superCatID)
}
let sb = UIStoryboard(name: K.StoryBoard.shop, bundle: nil)
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Shop.shopCategoryVC) as! ShopCategoryVC
vcPush.vm.superCatID = superCatID

View File

@@ -40,6 +40,10 @@ class ShopProductsVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
override func viewDidDisappear(_ animated: Bool) {
@@ -92,12 +96,21 @@ extension ShopProductsVC : CollectionViewSRC{
switch collectionView{
case productCV:
let data = vm.shopProductsData[indexPath.row]
if let postID = data.id{
PersistentStorage.shared.addShopCount(postID: postID)
}
let sb = UIStoryboard(name: K.StoryBoard.shop, bundle: nil)
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Shop.productDetailsVC) as! ProductDetailsVC
vcPush.vm.productID = data.id
self.navigationController?.pushViewController(vcPush, animated: true)
case subCategoryCV:
if let selectedSubCategory = vm.subCategoryData[indexPath.row].id{
if selectedSubCategory == -1{
PersistentStorage.shared.addShopCount(postID: 0)
}else{
PersistentStorage.shared.addShopCount(postID: selectedSubCategory)
}
vm.selectedSubCategory = selectedSubCategory
self.subCategoryCV.reloadData()
Utilities.startProgressHUD()

View File

@@ -29,6 +29,7 @@ class ProductDetailsVM{
}
@objc func cartButtonTapped(){
PersistentStorage.shared.addShopCount(postID: 0)
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
let sb = UIStoryboard(name: K.StoryBoard.cart, bundle: nil)

View File

@@ -26,6 +26,8 @@ class ShopCategoryVM{
}
@objc func cartButtonTapped(){
PersistentStorage.shared.addShopCount(postID: 0)
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
let sb = UIStoryboard(name: K.StoryBoard.cart, bundle: nil)

View File

@@ -36,6 +36,7 @@ class ShopListingVM{
}
@objc func cartButtonTapped(){
PersistentStorage.shared.addShopCount(postID: 0)
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
let sb = UIStoryboard(name: K.StoryBoard.cart, bundle: nil)

View File

@@ -31,6 +31,8 @@ class ShopProductsVM{
}
@objc func cartButtonTapped(){
PersistentStorage.shared.addShopCount(postID: 0)
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
let sb = UIStoryboard(name: K.StoryBoard.cart, bundle: nil)

View File

@@ -33,6 +33,10 @@ class MyOrdersVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
override func viewDidDisappear(_ animated: Bool) {
@@ -55,7 +59,7 @@ extension MyOrdersVC : TableViewSRC{
cell.btnTapped = { [weak self] in
guard let self else{return}
PersistentStorage.shared.addShopCount(postID: 0)
let sb = UIStoryboard(name: K.StoryBoard.sideBarNav, bundle: nil)
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.SideBarNav.myOrderDetailsVC) as! MyOrderDetailsVC
let orderID = vm.orderData[indexPath.row].orderID

View File

@@ -59,6 +59,8 @@ class MyOrdersVM{
}
@objc func cartButtonTapped(){
PersistentStorage.shared.addShopCount(postID: 0)
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
let sb = UIStoryboard(name: K.StoryBoard.cart, bundle: nil)

View File

@@ -740,7 +740,6 @@
</buttonConfiguration>
<connections>
<action selector="retryBtnTapped:" destination="GSM-1I-akm" eventType="touchUpInside" id="NLL-cG-WkI"/>
<action selector="retryBtnTapped:" destination="JL8-U7-koy" eventType="touchUpInside" id="RNx-NX-4xp"/>
</connections>
</button>
</subviews>
@@ -1320,10 +1319,10 @@
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemBrownColor">
<color red="0.63529411759999999" green="0.51764705879999995" blue="0.36862745099999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.63529411764705879" green="0.51764705882352946" blue="0.36862745098039218" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemGreenColor">
<color red="0.20392156859999999" green="0.78039215689999997" blue="0.34901960780000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.20392156862745098" green="0.7803921568627451" blue="0.34901960784313724" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>

View File

@@ -69,6 +69,7 @@ class ThemeTwoVC: UIViewController {
}
@IBAction func playTrailer(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addOthersCount()
let item = JwPlayerItemCreate(url: APIEndPoints.StaticURLs.masilaUrl, poster: nil, titles: "Masila")
JWPlayerManager.shared.presentPlayer(from: self, playerItems: [item], contentType: .trailer)
}
@@ -90,18 +91,25 @@ extension ThemeTwoVC : CollectionViewSRC{
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
switch indexPath.row{
case 0:
PersistentStorage.shared.addRadioCount()
vm.checkType(action: .radio)
case 1:
PersistentStorage.shared.addOthersCount()
vm.checkType(action: .liveTV)
case 2:
PersistentStorage.shared.addOthersCount()
vm.checkType(action: .webseries)
case 3:
PersistentStorage.shared.addOthersCount()
vm.checkType(action: .games)
case 4:
PersistentStorage.shared.addOthersCount()
vm.checkType(action: .audioBooks)
case 5:
PersistentStorage.shared.addOthersCount()
vm.checkType(action: .karaoke)
case 6:
PersistentStorage.shared.addOthersCount()
vm.checkType(action: .shop)
default:
break

View File

@@ -40,9 +40,15 @@ class UserNotificationVC: UIViewController {
// Customize the navigation bar's appearance
self.navigationController?.setColor(color: .black)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
@IBAction func retryBtnTapped(_ sender: UIButton) {
PersistentStorage.shared.addOthersCount()
}
}
@@ -62,6 +68,7 @@ extension UserNotificationVC : TableViewSRC{
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
PersistentStorage.shared.addOthersCount()
if let type = vm.userNotification[indexPath.row].postType{
switch type{
case 1,2,3,4:

View File

@@ -40,6 +40,7 @@ class ThemeTwoVM{
handleNotificationCenter()
vc.liveTvView.addTapGesture { [weak self] in
PersistentStorage.shared.addOthersCount()
guard let self else{return}
self.playLiveTV()
}

View File

@@ -32,6 +32,7 @@ class ContinueWatchingVC: UIViewController {
@objc func handleTap(_ gesture: UITapGestureRecognizer) {
let location = gesture.location(in: outerView)
if !contentView.frame.contains(location) {
PersistentStorage.shared.addOthersCount()
self.dismiss(animated: true)
}
}
@@ -64,6 +65,10 @@ class ContinueWatchingVC: UIViewController {
@IBAction func watchBtnTapped(_ sender: LocalisedElementsButton) {
guard let watchData else{return}
if let showID = watchData.id, let catID = self.categoryID{
PersistentStorage.shared.addWebSeries(catID: catID, postID: showID, postType: .episode)
}
var playerItem = JwPlayerItemCreate(url: "", poster: "", titles: "")
playerItem.poster = watchData.thumbnailPath
if AuthFunc.shareInstance.getDefaultLanguage() == .english{
@@ -88,8 +93,7 @@ class ContinueWatchingVC: UIViewController {
}
@IBAction func closeBtnTapped(_ sender: LocalisedElementsButton) {
self.dismiss(animated: true) {
}
PersistentStorage.shared.addOthersCount()
self.dismiss(animated: true)
}
}

View File

@@ -90,9 +90,13 @@ class EpisodeDetailsVC: UIViewController {
@IBAction func closeBtnTapped(_ sender: UIButton) {
self.dismiss(animated: true)
PersistentStorage.shared.addOthersCount()
}
@IBAction func watchBtnTapped(_ sender: LocalisedElementsButton) {
if let episodeData = episodeData, let postID = episodeData.id, let categoryID = (AuthFunc.shareInstance.languageSelected == .english ? 1 : 18){
PersistentStorage.shared.addWebSeries(catID: categoryID, postID: postID, postType: .episode)
}
self.dismiss(animated: true) {
self.onDoneBlock?()
}

View File

@@ -66,6 +66,10 @@ class WebSeriesSeasonVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
override func viewDidDisappear(_ animated: Bool) {
@@ -75,13 +79,16 @@ class WebSeriesSeasonVC: UIViewController {
self.navigationController?.setColor(color: .black)
}
@IBAction func playTrailerBtnTapped(_ sender: LocalisedElementsButton) {
// 1-> english , 18- hindi
var playerItems = [JwPlayerItemCreate]()
guard let seasonData = vm.seasonListingData.filter({$0.id == vm.episodeSelectedCateogory}).first else{return}
var url = String()
guard let englishData = seasonData.seasonMoreDetails?.filter({$0.languageMasterID == 1}).first, let hindiData = seasonData.seasonMoreDetails?.filter({$0.languageMasterID == 2}).first else{return}
if let seasonID = seasonData.id , let catID = vm.categoryID{
PersistentStorage.shared.addWebSeries(catID: catID, postID: seasonID, postType: .season)
}
/*
Based on selected Category language update the url
*/
@@ -104,6 +111,7 @@ class WebSeriesSeasonVC: UIViewController {
}
@IBAction func loadMoreBtnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addOthersCount()
loadMoreBtn.isHidden = true
vm.pageNo += 1
loadMoreActivityIndicator.startAnimating()
@@ -154,6 +162,10 @@ extension WebSeriesSeasonVC : TableViewSRC{
case self.teaserTableView:
let teaserData = vm.teaserData[indexPath.row]
if let showID = teaserData.id, let catID = self.vm.categoryID{
PersistentStorage.shared.addWebSeries(catID: catID, postID: showID, postType: .teaser)
}
guard let englishData = teaserData.contentMoreDetails?.filter({$0.languageMasterID == 1}).first, let hindiData = teaserData.contentMoreDetails?.filter({$0.languageMasterID == 2}).first else{return}
var url = String()
/*
@@ -224,6 +236,11 @@ extension WebSeriesSeasonVC : TableViewSRC{
case self.episodeTableView:
let episodeData = vm.seasonEpisodeData
if let showID = episodeData[indexPath.row].id, let catID = self.vm.categoryID{
PersistentStorage.shared.addWebSeries(catID: catID, postID: showID, postType: .episode)
}
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}
@@ -263,9 +280,15 @@ extension WebSeriesSeasonVC : TableViewSRC{
switch tableView{
case teaserTableView:
let data = vm.teaserData[indexPath.row]
if let showID = data.id, let catID = self.vm.categoryID{
PersistentStorage.shared.addWebSeries(catID: catID, postID: showID, postType: .teaser)
}
vcPush.teaserData = data
default:
let data = vm.seasonEpisodeData[indexPath.row]
if let showID = data.id, let catID = self.vm.categoryID{
PersistentStorage.shared.addWebSeries(catID: catID, postID: showID, postType: .episode)
}
vcPush.episodeData = data
}
vcPush.onDoneBlock = { [weak self] in
@@ -350,6 +373,11 @@ extension WebSeriesSeasonVC : CollectionViewSRC{
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
vm.episodeSelectedCateogory = vm.seasonListingData[indexPath.row].id
if let seasonID = vm.seasonListingData[indexPath.row].id , let catID = vm.categoryID{
PersistentStorage.shared.addWebSeries(catID: catID, postID: seasonID, postType: .season)
}
vm.setSeasonData()
episodeTitle.isHidden = false
episodeTitle.text = ""

View File

@@ -56,6 +56,11 @@ class WebSeriesVC: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: animated)
if self.isMovingFromParent {
// Back button was pressed
PersistentStorage.shared.addOthersCount()
}
}
override func viewDidDisappear(_ animated: Bool) {
@@ -74,20 +79,24 @@ class WebSeriesVC: UIViewController {
@IBAction func playTrailer(_ sender: LocalisedElementsButton) {
let item = JwPlayerItemCreate(url: APIEndPoints.StaticURLs.masilaUrl, poster: nil, titles: "Masila")
JWPlayerManager.shared.presentPlayer(from: self, playerItems: [item], contentType: .trailer)
PersistentStorage.shared.addTrailerCount()
}
@IBAction func expandLanguageTapped(_ sender: UIButton) {
vm.dropDownModule.show()
PersistentStorage.shared.addOthersCount()
self.expandBtn.setImage(UIImage(named: "SupportUpArrow"), for: .normal)
}
@IBAction func loadMoreBtnTapped(_ sender: LocalisedElementsButton) {
PersistentStorage.shared.addOthersCount()
loadMoreBtn.isHidden = true
vm.pageNo += 1
loadMoreActivityIndicator.startAnimating()
if let index = vm.dropDownModule.indexForSelectedRow, let categoryIndex = vm.categoryListingData[index].id{
vm.getShowListing(categoryID: categoryIndex, isBtnClick: true)
}
PersistentStorage.shared.addOthersCount()
}
}
@@ -120,6 +129,10 @@ extension WebSeriesVC : TableViewSRC{
func updateFavLikes(type : FavCellCLick, index : Int){
let data = vm.showData[index]
if let postID = data.id, let categoryID = vm.categoryListingData[vm.dropDownModule.indexForSelectedRow ?? 0].id{
PersistentStorage.shared.addWebSeries(catID: categoryID, postID: postID, postType: .series)
}
let categoryID = vm.categoryListingData[vm.dropDownModule.indexForSelectedRow ?? 0].id ?? 0
switch type {
case .favourite:
@@ -231,6 +244,10 @@ extension WebSeriesVC : TableViewSRC{
if vm.showData.count == 0 {return}
let showData = vm.showData[indexPath.row]
if let postID = showData.id, let categoryID = vm.categoryListingData[vm.dropDownModule.indexForSelectedRow ?? 0].id{
PersistentStorage.shared.addWebSeries(catID: categoryID, postID: postID, postType: .series)
}
let sb = UIStoryboard(name: K.StoryBoard.webSeries, bundle: nil)
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.WebSeries.webSeriesSeasonVC) as! WebSeriesSeasonVC
vcPush.vm.showData = showData
@@ -295,6 +312,10 @@ extension WebSeriesVC : CollectionViewSRC{
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
let data = vm.continueWatchingData[indexPath.row]
if let postID = data.id, let categoryID = vm.categoryListingData[vm.dropDownModule.indexForSelectedRow ?? 0].id{
PersistentStorage.shared.addWebSeries(catID: categoryID, postID: postID, postType: .series)
}
let sb = UIStoryboard(name: K.StoryBoard.webSeries, bundle: nil)
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.WebSeries.continueWatchingVC) as! ContinueWatchingVC
vcPush.modalPresentationStyle = .overCurrentContext

View File

@@ -43,6 +43,7 @@ class WebSeriesSeasonVM{
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}
PersistentStorage.shared.addWebSeries(catID: categoryID, postID: showID, postType: .series)
if isFav {
//remove
@@ -92,6 +93,7 @@ class WebSeriesSeasonVM{
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}
PersistentStorage.shared.addWebSeries(catID: self.categoryID ?? 0, postID: showID, postType: .series)
if isLiked{
LikeFavCommonFunc.shareInstance.unlikePost(postID: showID, postType: postType, vc: self.vc) { isDone in
@@ -139,6 +141,10 @@ class WebSeriesSeasonVM{
}
vc.shareView.addTapGesture {
if let showID = self.showData?.id, let catID = self.categoryID{
PersistentStorage.shared.addWebSeries(catID: catID, postID: showID, postType: .series)
}
if let name = URL(string: "https://apps.apple.com/in/app/woka/id6465305185"), !name.absoluteString.isEmpty {
let objectsToShare = [name]
let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)

View File

@@ -99,10 +99,12 @@ class WebSeriesVM{
// handle if user clicks outside
dropDownModule.cancelAction = { [weak self] in
guard let self else{return}
PersistentStorage.shared.addOthersCount()
vc.expandBtn.setImage(UIImage(named: "SupportBottomArrow"), for: .normal)
}
dropDownModule.selectionAction = { [weak self] (index: Int, item: String) in
PersistentStorage.shared.addOthersCount()
guard let self else{return}
vc.languageLabel.text = item
vc.expandBtn.setImage(UIImage(named: "SupportBottomArrow"), for: .normal)