ads commit

This commit is contained in:
2024-09-25 20:10:31 +05:30
parent 129be7142a
commit e925ec085e
15 changed files with 478 additions and 146 deletions

View File

@@ -20,6 +20,7 @@
520CE6B12C74BB9D00974228 /* AppUpdateVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 520CE6B02C74BB9D00974228 /* AppUpdateVC.swift */; }; 520CE6B12C74BB9D00974228 /* AppUpdateVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 520CE6B02C74BB9D00974228 /* AppUpdateVC.swift */; };
5219C2C22C086D9C00A1DF4D /* DataTypeConversion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5219C2C12C086D9B00A1DF4D /* DataTypeConversion.swift */; }; 5219C2C22C086D9C00A1DF4D /* DataTypeConversion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5219C2C12C086D9B00A1DF4D /* DataTypeConversion.swift */; };
521E5A9D2CA1A5C800AEF131 /* GoogleInterstistialADSetup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 521E5A9C2CA1A5BE00AEF131 /* GoogleInterstistialADSetup.swift */; }; 521E5A9D2CA1A5C800AEF131 /* GoogleInterstistialADSetup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 521E5A9C2CA1A5BE00AEF131 /* GoogleInterstistialADSetup.swift */; };
521E5AA02CA40BED00AEF131 /* JWAdsBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 521E5A9F2CA40BE300AEF131 /* JWAdsBuilder.swift */; };
522242662BFC74380085C632 /* MyListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522242632BFC74380085C632 /* MyListVC.swift */; }; 522242662BFC74380085C632 /* MyListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522242632BFC74380085C632 /* MyListVC.swift */; };
522242682BFC74380085C632 /* TabBarVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522242652BFC74380085C632 /* TabBarVC.swift */; }; 522242682BFC74380085C632 /* TabBarVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522242652BFC74380085C632 /* TabBarVC.swift */; };
5222426A2BFC7AFC0085C632 /* SideMenuVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522242692BFC7AFC0085C632 /* SideMenuVC.swift */; }; 5222426A2BFC7AFC0085C632 /* SideMenuVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522242692BFC7AFC0085C632 /* SideMenuVC.swift */; };
@@ -426,6 +427,7 @@
520CE6B02C74BB9D00974228 /* AppUpdateVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppUpdateVC.swift; sourceTree = "<group>"; }; 520CE6B02C74BB9D00974228 /* AppUpdateVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppUpdateVC.swift; sourceTree = "<group>"; };
5219C2C12C086D9B00A1DF4D /* DataTypeConversion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataTypeConversion.swift; sourceTree = "<group>"; }; 5219C2C12C086D9B00A1DF4D /* DataTypeConversion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataTypeConversion.swift; sourceTree = "<group>"; };
521E5A9C2CA1A5BE00AEF131 /* GoogleInterstistialADSetup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoogleInterstistialADSetup.swift; sourceTree = "<group>"; }; 521E5A9C2CA1A5BE00AEF131 /* GoogleInterstistialADSetup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoogleInterstistialADSetup.swift; sourceTree = "<group>"; };
521E5A9F2CA40BE300AEF131 /* JWAdsBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JWAdsBuilder.swift; sourceTree = "<group>"; };
522242632BFC74380085C632 /* MyListVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyListVC.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>"; }; 522242652BFC74380085C632 /* TabBarVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabBarVC.swift; sourceTree = "<group>"; };
522242692BFC7AFC0085C632 /* SideMenuVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SideMenuVC.swift; sourceTree = "<group>"; }; 522242692BFC7AFC0085C632 /* SideMenuVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SideMenuVC.swift; sourceTree = "<group>"; };
@@ -1745,6 +1747,7 @@
9C27E1612BDB6F0F00EC1DA9 /* Main */ = { 9C27E1612BDB6F0F00EC1DA9 /* Main */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
521E5A9F2CA40BE300AEF131 /* JWAdsBuilder.swift */,
9CDB8C0E2C9D534900C887B2 /* ShareApp.swift */, 9CDB8C0E2C9D534900C887B2 /* ShareApp.swift */,
52AC2D262C29791500337473 /* JWPlayerManager.swift */, 52AC2D262C29791500337473 /* JWPlayerManager.swift */,
52C1A4DF2C05B670007BAA50 /* Delegate */, 52C1A4DF2C05B670007BAA50 /* Delegate */,
@@ -2485,6 +2488,7 @@
52CC4A742C883B3F001BE47C /* AdsDM.swift in Sources */, 52CC4A742C883B3F001BE47C /* AdsDM.swift in Sources */,
527A2BD22C57B40A0080DF9B /* CartDataCache.swift in Sources */, 527A2BD22C57B40A0080DF9B /* CartDataCache.swift in Sources */,
525327D62BFCC23600F64283 /* SideMenuVM.swift in Sources */, 525327D62BFCC23600F64283 /* SideMenuVM.swift in Sources */,
521E5AA02CA40BED00AEF131 /* JWAdsBuilder.swift in Sources */,
525861D22C4FC6C000C33C79 /* CartPaymentOptionsVC.swift in Sources */, 525861D22C4FC6C000C33C79 /* CartPaymentOptionsVC.swift in Sources */,
525861DA2C4FE71100C33C79 /* CouponListDM.swift in Sources */, 525861DA2C4FE71100C33C79 /* CouponListDM.swift in Sources */,
9CBCB2A32BE50C95007D7934 /* ResetPassUserNameVC.swift in Sources */, 9CBCB2A32BE50C95007D7934 /* ResetPassUserNameVC.swift in Sources */,

View File

@@ -0,0 +1,48 @@
//
// JWAdsBuilder.swift
// WOKA
//
// Created by MacBook Pro on 25/09/24.
//
import JWPlayerKit
struct AdBreakItemStruct{
let adUrl : URL
let offset : JWAdOffset
}
class JWAdsBuilder{
static let shareInstace = JWAdsBuilder()
private init(){}
func createAds(adsData : [AdBreakItemStruct]) -> JWAdvertisingConfig?{
var adBreaks = [JWAdBreak]()
for adTags in adsData{
let adBreakBuilder = JWAdBreakBuilder()
.offset(adTags.offset)
.tags([adTags.adUrl])
if let adBreak = try? adBreakBuilder.build() {
adBreaks.append(adBreak)
}
}
let adConfigBuilder = JWImaAdvertisingConfigBuilder()
.schedule(adBreaks)
guard let adConfig = try? adConfigBuilder.build() else {
// Handle build error
return nil
}
return adConfig
}
func generateAdTagUrl(url : String) -> String {
let correlatorValue = Int(Date().timeIntervalSince1970 * 1000)
return "\(url)\(correlatorValue)"
}
}

View File

@@ -12,6 +12,7 @@ enum VideoContentType{
case liveStream case liveStream
case webSeries case webSeries
case trailer case trailer
case masilaSongs
case continueWatching case continueWatching
case audioBooks case audioBooks
case games case games
@@ -46,7 +47,7 @@ class JWPlayerManager {
// } // }
switch contentType{ switch contentType{
case .webSeries,.songs: case .webSeries,.songs, .masilaSongs:
// Iterate over the liveStreamURLs to create JWPlayerItems // Iterate over the liveStreamURLs to create JWPlayerItems
for (index, singleItem) in playerItems.enumerated() { for (index, singleItem) in playerItems.enumerated() {
guard let url = URL(string: singleItem.url) else { guard let url = URL(string: singleItem.url) else {
@@ -110,74 +111,95 @@ class JWPlayerManager {
return return
} }
// Create an ad break for 30% into the video // // Create an ad break for 30% into the video
let adBreakBuilder2 = JWAdBreakBuilder() // let adBreakBuilder2 = JWAdBreakBuilder()
.offset(.from(string: "pre")!) // .offset(.from(string: "pre")!)
//
.tags([URL(string: generateAdTagUrl())!]) // .tags([URL(string: generateAdTagUrl())!])
//
// guard let adBreak2 = try? adBreakBuilder2.build() else {
// print("Ad error 1")
// // Handle build error
// return
// }
//
// // Create an ad break for 30% into the video
// let adBreakBuilder1 = JWAdBreakBuilder()
// .offset(.midroll(percent: 20))
//// .offset(.from(string: "20%")!)
//// .tags([URL(string: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250,728x90&gdfp_req=1&output=vast4&unviewed_position_start=1&env=vp&impl=s&correlator=7898879")!])
// .tags([URL(string: "https://pubads.g.doubleclick.net/gampad/ads?iu=/23204950200/VideoAd&description_url=https%3A%2F%2Fwokaland.com%2F&tfcd=0&npa=0&sz=480x320%7C640x480&ciu_szs=480x320&min_ad_duration=5000&max_ad_duration=20000&gdfp_req=1&unviewed_position_start=1&output=vast&env=vp&impl=s&correlator=")!])
//
// guard let adBreak1 = try? adBreakBuilder1.build() else {
// print("Ad error 2")
// // Handle build error
// return
// }
//
// let adBreakBuilder3 = JWAdBreakBuilder()
// .offset(.midroll(percent: 50))
//// .offset(.from(string: "50%")!)
// .tags([URL(string: "https://pubads.g.doubleclick.net/gampad/live/ads?iu=/23204950200/VideoAd&description_url=https%3A%2F%2Fwokaland.com%2F&tfcd=0&npa=0&ad_type=audio_video&sz=640x480%7C1280x720&gdfp_req=1&unviewed_position_start=1&output=vast&env=vp&impl=s&correlator=&nofb=1")!])
//
// guard let adBreak3 = try? adBreakBuilder3.build() else {
// print("Ad error 2")
// // Handle build error
// return
// }
//
// let adBreakBuilder4 = JWAdBreakBuilder()
// .offset(.midroll(percent: 80))
//// .offset(.from(string: "50%")!)
// .tags([URL(string: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=90")!])
//
// guard let adBreak4 = try? adBreakBuilder4.build() else {
// print("Ad error 2")
// // Handle build error
// return
// }
//
// let adConfigBuilder = JWImaAdvertisingConfigBuilder()
// .schedule([adBreak1,adBreak3, adBreak4])
// guard let adConfig = try? adConfigBuilder.build() else {
//
// // Handle build error
// return
// }
guard let adBreak2 = try? adBreakBuilder2.build() else {
print("Ad error 1")
// Handle build error
return
}
// Create an ad break for 30% into the video
let adBreakBuilder1 = JWAdBreakBuilder()
.offset(.midroll(percent: 20))
// .offset(.from(string: "20%")!)
// .tags([URL(string: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250,728x90&gdfp_req=1&output=vast4&unviewed_position_start=1&env=vp&impl=s&correlator=7898879")!])
.tags([URL(string: "https://pubads.g.doubleclick.net/gampad/ads?iu=/23204950200/VideoAd&description_url=https%3A%2F%2Fwokaland.com%2F&tfcd=0&npa=0&sz=480x320%7C640x480&ciu_szs=480x320&min_ad_duration=5000&max_ad_duration=20000&gdfp_req=1&unviewed_position_start=1&output=vast&env=vp&impl=s&correlator=")!])
guard let adBreak1 = try? adBreakBuilder1.build() else {
print("Ad error 2")
// Handle build error
return
}
let adBreakBuilder3 = JWAdBreakBuilder()
.offset(.midroll(percent: 50))
// .offset(.from(string: "50%")!)
.tags([URL(string: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=60")!])
guard let adBreak3 = try? adBreakBuilder3.build() else {
print("Ad error 2")
// Handle build error
return
}
let adBreakBuilder4 = JWAdBreakBuilder()
.offset(.midroll(percent: 80))
// .offset(.from(string: "50%")!)
.tags([URL(string: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=90")!])
guard let adBreak4 = try? adBreakBuilder4.build() else {
print("Ad error 2")
// Handle build error
return
}
let adConfigBuilder = JWImaAdvertisingConfigBuilder()
.schedule([adBreak1,adBreak3, adBreak4])
guard let adConfig = try? adConfigBuilder.build() else {
// Handle build error
return
}
let finalConfig : JWPlayerConfiguration? let finalConfig : JWPlayerConfiguration?
switch contentType{ switch contentType{
case .audioBooks: case .audioBooks:
let adConfigs = JWAdsBuilder.shareInstace.createAds(adsData: [AdBreakItemStruct(adUrl: URL(string: "https://pubads.g.doubleclick.net/gampad/ads?iu=/23204950200/VideoAd&description_url=https%3A%2F%2Fwokaland.com%2F&tfcd=0&npa=0&ad_type=audio_video&sz=640x480%7C1280x720&gdfp_req=1&unviewed_position_start=1&output=vast&env=vp&impl=s&correlator=")!, offset: .midroll(percent: 40)),
AdBreakItemStruct(adUrl: URL(string: "https://pubads.g.doubleclick.net/gampad/live/ads?iu=/23204950200/VideoAd&description_url=https%3A%2F%2Fwokaland.com%2F&tfcd=0&npa=0&ad_type=audio_video&sz=640x480%7C1280x720&gdfp_req=1&unviewed_position_start=1&output=vast&env=vp&impl=s&correlator=&nofb=1")!, offset: .midroll(percent: 80)),
AdBreakItemStruct(adUrl: URL(string: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=90")!, offset: .midroll(percent: 90))
])
finalConfig = try JWPlayerConfigurationBuilder() finalConfig = try JWPlayerConfigurationBuilder()
.playlist(items: items) .playlist(items: items)
.autostart(true) .autostart(true)
.advertising(adConfigs!)
.build() .build()
case .webSeries: case .webSeries:
//https://pubads.g.doubleclick.net/gampad/ads?iu=/23204950200/VideoAd&description_url=https%3A%2F%2Fwokaland.com%2F&tfcd=0&npa=0&sz=480x320%7C640x480&ciu_szs=480x320&min_ad_duration=5000&max_ad_duration=20000&gdfp_req=1&unviewed_position_start=1&output=vast&env=vp&impl=s&correlator=
let adConfigs = JWAdsBuilder.shareInstace.createAds(adsData: [AdBreakItemStruct(adUrl: URL(string: "https://pubads.g.doubleclick.net/gampad/ads?iu=/23204950200/VideoAd&description_url=https%3A%2F%2Fwokaland.com%2F&tfcd=0&npa=0&ad_type=audio_video&sz=640x480%7C1280x720&gdfp_req=1&unviewed_position_start=1&output=vast&env=vp&impl=s&correlator=")!, offset: .midroll(percent: 40)),
AdBreakItemStruct(adUrl: URL(string: "https://pubads.g.doubleclick.net/gampad/live/ads?iu=/23204950200/VideoAd&description_url=https%3A%2F%2Fwokaland.com%2F&tfcd=0&npa=0&ad_type=audio_video&sz=640x480%7C1280x720&gdfp_req=1&unviewed_position_start=1&output=vast&env=vp&impl=s&correlator=&nofb=1")!, offset: .midroll(percent: 80)),
AdBreakItemStruct(adUrl: URL(string: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=90")!, offset: .midroll(percent: 90))
])
finalConfig = try JWPlayerConfigurationBuilder() finalConfig = try JWPlayerConfigurationBuilder()
.playlist(items: items) .playlist(items: items)
.autostart(false) .autostart(false)
.advertising(adConfig) .advertising(adConfigs!)
.build()
case .masilaSongs:
let adConfigs = JWAdsBuilder.shareInstace.createAds(adsData: [AdBreakItemStruct(adUrl: URL(string: "https://pubads.g.doubleclick.net/gampad/ads?iu=/23204950200/VideoAd&description_url=https%3A%2F%2Fwokaland.com%2F&tfcd=0&npa=0&ad_type=audio_video&sz=640x480%7C1280x720&gdfp_req=1&unviewed_position_start=1&output=vast&env=vp&impl=s&correlator=")!, offset: .preroll())])
finalConfig = try JWPlayerConfigurationBuilder()
.playlist(items: items)
.autostart(true)
.advertising(adConfigs!)
.build() .build()
case .trailer: case .trailer:
finalConfig = try JWPlayerConfigurationBuilder() finalConfig = try JWPlayerConfigurationBuilder()
@@ -219,7 +241,3 @@ class JWPlayerManager {
} }
} }
func generateAdTagUrl() -> String {
let correlatorValue = Int(Date().timeIntervalSince1970 * 1000)
return "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250,728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=\(correlatorValue)"
}

View File

@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import GoogleMobileAds
class ProductDetailsVC: UIViewController { class ProductDetailsVC: UIViewController {
@@ -21,6 +22,7 @@ class ProductDetailsVC: UIViewController {
@IBOutlet weak var noDataStack: UIStackView! @IBOutlet weak var noDataStack: UIStackView!
@IBOutlet weak var retryBtn: UIButton! @IBOutlet weak var retryBtn: UIButton!
@IBOutlet weak var scrollView: UIScrollView! @IBOutlet weak var scrollView: UIScrollView!
@IBOutlet weak var adView: UIView!
var vm = ProductDetailsVM() var vm = ProductDetailsVM()
@@ -133,3 +135,38 @@ extension ProductDetailsVC : UICollectionViewDelegateFlowLayout{
return UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 5) return UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 5)
} }
} }
// MARK: - Google Ad Banner Delegate
extension ProductDetailsVC : GADBannerViewDelegate{
func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
adView.isHidden = false
bannerView.alpha = 0
bannerView.backgroundColor = #colorLiteral(red: 0.01960784314, green: 0, blue: 0.2196078431, alpha: 1)
UIView.animate(withDuration: 0.2, animations: {
bannerView.alpha = 1
})
print("bannerViewDidReceiveAd")
}
func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: Error) {
print("bannerView:didFailToReceiveAdWithError: \(error.localizedDescription)")
}
func bannerViewDidRecordImpression(_ bannerView: GADBannerView) {
print("bannerViewDidRecordImpression")
}
func bannerViewWillPresentScreen(_ bannerView: GADBannerView) {
print("bannerViewWillPresentScreen")
}
func bannerViewWillDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewWillDIsmissScreen")
}
func bannerViewDidDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewDidDismissScreen")
}
}

View File

@@ -6,10 +6,12 @@
// //
import UIKit import UIKit
import GoogleMobileAds
class ShopCategoryVC: UIViewController { class ShopCategoryVC: UIViewController {
@IBOutlet weak var tableView: UITableView! @IBOutlet weak var tableView: UITableView!
@IBOutlet weak var adView: UIView!
var vm = ShopCategoryVM() var vm = ShopCategoryVM()
@@ -78,3 +80,38 @@ extension ShopCategoryVC : TableViewSRC{
self.navigationController?.pushViewController(vcPush, animated: true) self.navigationController?.pushViewController(vcPush, animated: true)
} }
} }
// MARK: - Google Ad Banner Delegate
extension ShopCategoryVC : GADBannerViewDelegate{
func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
adView.isHidden = false
bannerView.alpha = 0
bannerView.backgroundColor = #colorLiteral(red: 0.01960784314, green: 0, blue: 0.2196078431, alpha: 1)
UIView.animate(withDuration: 0.2, animations: {
bannerView.alpha = 1
})
print("bannerViewDidReceiveAd")
}
func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: Error) {
print("bannerView:didFailToReceiveAdWithError: \(error.localizedDescription)")
}
func bannerViewDidRecordImpression(_ bannerView: GADBannerView) {
print("bannerViewDidRecordImpression")
}
func bannerViewWillPresentScreen(_ bannerView: GADBannerView) {
print("bannerViewWillPresentScreen")
}
func bannerViewWillDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewWillDIsmissScreen")
}
func bannerViewDidDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewDidDismissScreen")
}
}

View File

@@ -6,11 +6,13 @@
// //
import UIKit import UIKit
import GoogleMobileAds
class ShopListingVC: UIViewController { class ShopListingVC: UIViewController {
@IBOutlet weak var tableView: UITableView! @IBOutlet weak var tableView: UITableView!
@IBOutlet weak var noDataStack: UIStackView! @IBOutlet weak var noDataStack: UIStackView!
@IBOutlet weak var adView: UIView!
var vm = ShopListingVM() var vm = ShopListingVM()
@@ -140,6 +142,42 @@ extension ShopListingVC : TableViewSRC{
} }
} }
// MARK: - Google Ad Banner Delegate
extension ShopListingVC : GADBannerViewDelegate{
func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
adView.isHidden = false
bannerView.alpha = 0
bannerView.backgroundColor = #colorLiteral(red: 0.01960784314, green: 0, blue: 0.2196078431, alpha: 1)
UIView.animate(withDuration: 0.2, animations: {
bannerView.alpha = 1
})
print("bannerViewDidReceiveAd")
}
func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: Error) {
print("bannerView:didFailToReceiveAdWithError: \(error.localizedDescription)")
}
func bannerViewDidRecordImpression(_ bannerView: GADBannerView) {
print("bannerViewDidRecordImpression")
}
func bannerViewWillPresentScreen(_ bannerView: GADBannerView) {
print("bannerViewWillPresentScreen")
}
func bannerViewWillDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewWillDIsmissScreen")
}
func bannerViewDidDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewDidDismissScreen")
}
}
//extension UIViewController { //extension UIViewController {
// //
// func createCartButton(imageName: String, // func createCartButton(imageName: String,
@@ -202,3 +240,4 @@ extension ShopListingVC : TableViewSRC{
// return customBarButton // return customBarButton
// } // }
//} //}

View File

@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import GoogleMobileAds
class ShopProductsVC: UIViewController { class ShopProductsVC: UIViewController {
@@ -13,6 +14,7 @@ class ShopProductsVC: UIViewController {
@IBOutlet weak var productCV: UICollectionView! @IBOutlet weak var productCV: UICollectionView!
@IBOutlet weak var spinnerView: UIActivityIndicatorView! @IBOutlet weak var spinnerView: UIActivityIndicatorView!
@IBOutlet weak var noDataStack: UIStackView! @IBOutlet weak var noDataStack: UIStackView!
@IBOutlet weak var adView: UIView!
var vm = ShopProductsVM() var vm = ShopProductsVM()
@@ -136,6 +138,42 @@ extension ShopProductsVC : CollectionViewSRC{
} }
} }
// MARK: - Google Ad Banner Delegate
extension ShopProductsVC : GADBannerViewDelegate{
func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
adView.isHidden = false
bannerView.alpha = 0
bannerView.backgroundColor = #colorLiteral(red: 0.01960784314, green: 0, blue: 0.2196078431, alpha: 1)
UIView.animate(withDuration: 0.2, animations: {
bannerView.alpha = 1
})
print("bannerViewDidReceiveAd")
}
func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: Error) {
print("bannerView:didFailToReceiveAdWithError: \(error.localizedDescription)")
}
func bannerViewDidRecordImpression(_ bannerView: GADBannerView) {
print("bannerViewDidRecordImpression")
}
func bannerViewWillPresentScreen(_ bannerView: GADBannerView) {
print("bannerViewWillPresentScreen")
}
func bannerViewWillDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewWillDIsmissScreen")
}
func bannerViewDidDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewDidDismissScreen")
}
}
// MARK: - Collection Flow Layout // MARK: - Collection Flow Layout
extension ShopProductsVC : UICollectionViewDelegateFlowLayout{ extension ShopProductsVC : UICollectionViewDelegateFlowLayout{

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/> <device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/>
<capability name="Named colors" minToolsVersion="9.0"/> <capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/> <capability name="System colors in document resources" minToolsVersion="11.0"/>
@@ -33,10 +33,19 @@
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="OrderBottom" translatesAutoresizingMaskIntoConstraints="NO" id="gRK-pM-dPn"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="OrderBottom" translatesAutoresizingMaskIntoConstraints="NO" id="gRK-pM-dPn">
<rect key="frame" x="0.0" y="557.33333333333337" width="393" height="294.66666666666663"/> <rect key="frame" x="0.0" y="557.33333333333337" width="393" height="294.66666666666663"/>
</imageView> </imageView>
<tableView 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="UPY-aY-67P"> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="0T0-og-fKw">
<rect key="frame" x="0.0" y="59" width="393" height="793"/> <rect key="frame" x="0.0" y="59" width="393" height="793"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <subviews>
</tableView> <tableView 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="UPY-aY-67P">
<rect key="frame" x="0.0" y="0.0" width="393" height="793"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tableView>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Q5q-qZ-0pW">
<rect key="frame" x="0.0" y="0.0" width="393" height="100"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
</subviews>
</stackView>
<stackView hidden="YES" opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="gea-3i-ZQC"> <stackView hidden="YES" opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="gea-3i-ZQC">
<rect key="frame" x="84.666666666666686" y="339.66666666666669" width="224" height="198.00000000000006"/> <rect key="frame" x="84.666666666666686" y="339.66666666666669" width="224" height="198.00000000000006"/>
<subviews> <subviews>
@@ -78,22 +87,24 @@
<viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/> <viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints> <constraints>
<constraint firstItem="0T0-og-fKw" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" id="6tA-Vc-Q1p"/>
<constraint firstAttribute="bottom" secondItem="zhb-Th-KAe" secondAttribute="bottom" id="7W2-OK-8w8"/> <constraint firstAttribute="bottom" secondItem="zhb-Th-KAe" secondAttribute="bottom" id="7W2-OK-8w8"/>
<constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="UPY-aY-67P" secondAttribute="trailing" id="7iM-GP-HTA"/>
<constraint firstItem="zhb-Th-KAe" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" id="B7w-Dx-USZ"/> <constraint firstItem="zhb-Th-KAe" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" id="B7w-Dx-USZ"/>
<constraint firstItem="UPY-aY-67P" firstAttribute="top" secondItem="vDu-zF-Fre" secondAttribute="top" id="Hyn-4V-Bfy"/>
<constraint firstItem="gea-3i-ZQC" firstAttribute="centerY" secondItem="vDu-zF-Fre" secondAttribute="centerY" id="I79-Uk-5rM"/> <constraint firstItem="gea-3i-ZQC" firstAttribute="centerY" secondItem="vDu-zF-Fre" secondAttribute="centerY" id="I79-Uk-5rM"/>
<constraint firstItem="gRK-pM-dPn" firstAttribute="leading" secondItem="5EZ-qb-Rvc" secondAttribute="leading" id="ICF-iB-ed7"/> <constraint firstItem="gRK-pM-dPn" firstAttribute="leading" secondItem="5EZ-qb-Rvc" secondAttribute="leading" id="ICF-iB-ed7"/>
<constraint firstAttribute="bottom" secondItem="0T0-og-fKw" secondAttribute="bottom" id="Iwd-hS-OQl"/>
<constraint firstItem="gea-3i-ZQC" firstAttribute="centerX" secondItem="vDu-zF-Fre" secondAttribute="centerX" id="QvE-Uh-qgY"/> <constraint firstItem="gea-3i-ZQC" firstAttribute="centerX" secondItem="vDu-zF-Fre" secondAttribute="centerX" id="QvE-Uh-qgY"/>
<constraint firstAttribute="trailing" secondItem="gRK-pM-dPn" secondAttribute="trailing" id="Zyn-bA-Fdh"/> <constraint firstAttribute="trailing" secondItem="gRK-pM-dPn" secondAttribute="trailing" id="Zyn-bA-Fdh"/>
<constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="0T0-og-fKw" secondAttribute="trailing" id="bJ1-ws-Upf"/>
<constraint firstItem="zhb-Th-KAe" firstAttribute="top" secondItem="vDu-zF-Fre" secondAttribute="top" id="bqB-3f-7QW"/> <constraint firstItem="zhb-Th-KAe" firstAttribute="top" secondItem="vDu-zF-Fre" secondAttribute="top" id="bqB-3f-7QW"/>
<constraint firstAttribute="bottom" secondItem="gRK-pM-dPn" secondAttribute="bottom" id="d2i-QF-oQ4"/> <constraint firstAttribute="bottom" secondItem="gRK-pM-dPn" secondAttribute="bottom" id="d2i-QF-oQ4"/>
<constraint firstItem="UPY-aY-67P" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" id="dTK-fu-JTe"/> <constraint firstItem="0T0-og-fKw" firstAttribute="top" secondItem="vDu-zF-Fre" secondAttribute="top" id="oMU-gg-b5a"/>
<constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="zhb-Th-KAe" secondAttribute="trailing" id="pxo-3d-4Ob"/> <constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="zhb-Th-KAe" secondAttribute="trailing" id="pxo-3d-4Ob"/>
<constraint firstAttribute="bottom" secondItem="UPY-aY-67P" secondAttribute="bottom" id="vt7-RK-kbR"/> <constraint firstItem="Q5q-qZ-0pW" firstAttribute="height" secondItem="5EZ-qb-Rvc" secondAttribute="height" multiplier="0.117371" id="vQp-tN-58N"/>
</constraints> </constraints>
</view> </view>
<connections> <connections>
<outlet property="adView" destination="Q5q-qZ-0pW" id="Od5-Ki-IPT"/>
<outlet property="noDataStack" destination="gea-3i-ZQC" id="ZvA-OA-Dzi"/> <outlet property="noDataStack" destination="gea-3i-ZQC" id="ZvA-OA-Dzi"/>
<outlet property="tableView" destination="UPY-aY-67P" id="hxW-SC-cSS"/> <outlet property="tableView" destination="UPY-aY-67P" id="hxW-SC-cSS"/>
</connections> </connections>
@@ -111,26 +122,40 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="OrderBottom" translatesAutoresizingMaskIntoConstraints="NO" id="DtQ-TG-hwD"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="OrderBottom" translatesAutoresizingMaskIntoConstraints="NO" id="DtQ-TG-hwD">
<rect key="frame" x="0.0" y="523.33333333333337" width="393" height="294.66666666666663"/> <rect key="frame" x="0.0" y="-269.66666666666663" width="393" height="294.66666666666663"/>
</imageView> </imageView>
<tableView 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="NEV-vt-kk0"> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="JOc-da-KgM">
<rect key="frame" x="0.0" y="59" width="393" height="793"/> <rect key="frame" x="0.0" y="59" width="393" height="0.0"/>
<color key="backgroundColor" red="0.82745098039999998" green="0.93725490199999995" blue="0.97254901959999995" alpha="1" colorSpace="calibratedRGB"/> <subviews>
</tableView> <tableView 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="NEV-vt-kk0">
<rect key="frame" x="0.0" y="0.0" width="393" height="0.0"/>
<color key="backgroundColor" red="0.82745098039999998" green="0.93725490199999995" blue="0.97254901959999995" alpha="1" colorSpace="calibratedRGB"/>
</tableView>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="eJP-tZ-U4b">
<rect key="frame" x="0.0" y="0.0" width="393" height="7"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="IH1-wm-lv7"/>
</constraints>
</view>
</subviews>
</stackView>
</subviews> </subviews>
<viewLayoutGuide key="safeArea" id="34g-eG-JoV"/> <viewLayoutGuide key="safeArea" id="34g-eG-JoV"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints> <constraints>
<constraint firstItem="34g-eG-JoV" firstAttribute="trailing" secondItem="NEV-vt-kk0" secondAttribute="trailing" id="4IY-xc-RF2"/> <constraint firstItem="JOc-da-KgM" firstAttribute="top" secondItem="34g-eG-JoV" secondAttribute="top" id="9vb-G4-WfC"/>
<constraint firstItem="34g-eG-JoV" firstAttribute="bottom" secondItem="DtQ-TG-hwD" secondAttribute="bottom" id="B5X-cq-xSL"/> <constraint firstItem="34g-eG-JoV" firstAttribute="bottom" secondItem="DtQ-TG-hwD" secondAttribute="bottom" id="B5X-cq-xSL"/>
<constraint firstAttribute="bottom" secondItem="NEV-vt-kk0" secondAttribute="bottom" id="BVA-9I-H8Z"/> <constraint firstItem="JOc-da-KgM" firstAttribute="leading" secondItem="34g-eG-JoV" secondAttribute="leading" id="NNc-eR-qsb"/>
<constraint firstItem="NEV-vt-kk0" firstAttribute="top" secondItem="34g-eG-JoV" secondAttribute="top" id="D6B-YT-I5F"/> <constraint firstAttribute="bottom" secondItem="JOc-da-KgM" secondAttribute="bottom" id="V3I-qD-WwC"/>
<constraint firstItem="eJP-tZ-U4b" firstAttribute="height" secondItem="t2V-lq-AGt" secondAttribute="height" multiplier="0.117371" id="YKi-mU-V0m"/>
<constraint firstItem="JOc-da-KgM" firstAttribute="trailing" secondItem="34g-eG-JoV" secondAttribute="trailing" id="kDJ-wv-BIm"/>
<constraint firstAttribute="trailing" secondItem="DtQ-TG-hwD" secondAttribute="trailing" id="mta-ZU-MYK"/> <constraint firstAttribute="trailing" secondItem="DtQ-TG-hwD" secondAttribute="trailing" id="mta-ZU-MYK"/>
<constraint firstItem="DtQ-TG-hwD" firstAttribute="leading" secondItem="t2V-lq-AGt" secondAttribute="leading" id="qrD-CC-Y5b"/> <constraint firstItem="DtQ-TG-hwD" firstAttribute="leading" secondItem="t2V-lq-AGt" secondAttribute="leading" id="qrD-CC-Y5b"/>
<constraint firstItem="NEV-vt-kk0" firstAttribute="leading" secondItem="34g-eG-JoV" secondAttribute="leading" id="r5B-c2-2FG"/>
</constraints> </constraints>
</view> </view>
<connections> <connections>
<outlet property="adView" destination="eJP-tZ-U4b" id="BcQ-Bh-KG7"/>
<outlet property="tableView" destination="NEV-vt-kk0" id="TGI-27-jrC"/> <outlet property="tableView" destination="NEV-vt-kk0" id="TGI-27-jrC"/>
</connections> </connections>
</viewController> </viewController>
@@ -150,13 +175,66 @@
<rect key="frame" x="0.0" y="59" width="393" height="793"/> <rect key="frame" x="0.0" y="59" width="393" height="793"/>
<color key="backgroundColor" red="0.82745098039999998" green="0.93725490199999995" blue="0.97254901959999995" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.82745098039999998" green="0.93725490199999995" blue="0.97254901959999995" alpha="1" colorSpace="calibratedRGB"/>
</view> </view>
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="medium" translatesAutoresizingMaskIntoConstraints="NO" id="Q7V-p9-fqq">
<rect key="frame" x="186.66666666666666" y="798" width="20" height="20"/>
<color key="color" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</activityIndicatorView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="OrderBottom" translatesAutoresizingMaskIntoConstraints="NO" id="03T-HE-97c"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="OrderBottom" translatesAutoresizingMaskIntoConstraints="NO" id="03T-HE-97c">
<rect key="frame" x="0.0" y="557.33333333333337" width="393" height="294.66666666666663"/> <rect key="frame" x="0.0" y="557.33333333333337" width="393" height="294.66666666666663"/>
</imageView> </imageView>
<stackView hidden="YES" opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="3kd-PT-FOP">
<rect key="frame" x="0.0" y="377.66666666666669" width="393" height="241.00000000000006"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="SupportGirlImage" translatesAutoresizingMaskIntoConstraints="NO" id="zin-kU-oRx">
<rect key="frame" x="0.0" y="0.0" width="393" height="166"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="No Data Found!" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ls4-iL-Xeg" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="175.99999999999994" width="393" height="24"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="20"/>
<color key="textColor" name="TextDarkBlue"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="QCZ-bP-hGX">
<rect key="frame" x="0.0" y="209.99999999999994" width="393" height="31"/>
<color key="tintColor" name="TextDarkBlue"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Retry?">
<fontDescription key="titleFontDescription" name="Exo2-Bold" family="Exo 2" pointSize="14"/>
</buttonConfiguration>
<connections>
<action selector="retryBtnTapped:" destination="kU5-IV-9fW" eventType="touchUpInside" id="6se-m0-BIY"/>
<action selector="retryBtnTapped:" destination="50W-Kn-pPe" eventType="touchUpInside" id="Efd-q1-lYh"/>
</connections>
</button>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="ZzE-T4-HYp" userLabel="ContentStack">
<rect key="frame" x="0.0" y="144" width="393" height="708"/>
<subviews>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="hin-ei-TV5">
<rect key="frame" x="0.0" y="0.0" width="393" height="678"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="MDX-db-Lz1">
<size key="itemSize" width="128" height="128"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
<cells/>
</collectionView>
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="medium" translatesAutoresizingMaskIntoConstraints="NO" id="Sr3-9L-8Fz">
<rect key="frame" x="0.0" y="688" width="393" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="4bZ-Eh-Yno"/>
</constraints>
<color key="color" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</activityIndicatorView>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="OHh-gC-1V1">
<rect key="frame" x="0.0" y="708" width="393" height="100"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="lBm-68-JUi"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</stackView>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="ibd-Ky-5QZ"> <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="ibd-Ky-5QZ">
<rect key="frame" x="10" y="69" width="383" height="60"/> <rect key="frame" x="10" y="69" width="383" height="60"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -171,77 +249,42 @@
</collectionViewFlowLayout> </collectionViewFlowLayout>
<cells/> <cells/>
</collectionView> </collectionView>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="qrc-nF-3bM">
<rect key="frame" x="0.0" y="144" width="393" height="654"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="Akd-Zt-0d3">
<size key="itemSize" width="128" height="128"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
<cells/>
</collectionView>
<stackView hidden="YES" opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="fZ1-nH-ZAg">
<rect key="frame" x="113.66666666666669" y="318" width="166" height="241"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="SupportGirlImage" translatesAutoresizingMaskIntoConstraints="NO" id="Ri6-KR-VYL">
<rect key="frame" x="0.0" y="0.0" width="166" height="166"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="No Data Found!" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mTY-wM-gmw" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="176" width="166" height="24"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="20"/>
<color key="textColor" name="TextDarkBlue"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="a9p-0d-Xbb">
<rect key="frame" x="0.0" y="210" width="166" height="31"/>
<color key="tintColor" name="TextDarkBlue"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Retry?">
<fontDescription key="titleFontDescription" name="Exo2-Bold" family="Exo 2" pointSize="14"/>
</buttonConfiguration>
<connections>
<action selector="retryBtnTapped:" destination="kU5-IV-9fW" eventType="touchUpInside" id="66A-Oc-nwA"/>
<action selector="retryBtnTapped:" destination="50W-Kn-pPe" eventType="touchUpInside" id="Sfk-Hg-Axg"/>
</connections>
</button>
</subviews>
</stackView>
</subviews> </subviews>
<viewLayoutGuide key="safeArea" id="EEU-2F-lPA"/> <viewLayoutGuide key="safeArea" id="EEU-2F-lPA"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints> <constraints>
<constraint firstItem="03T-HE-97c" firstAttribute="leading" secondItem="EEU-2F-lPA" secondAttribute="leading" id="CpK-v3-Qcu"/> <constraint firstItem="ZzE-T4-HYp" firstAttribute="trailing" secondItem="EEU-2F-lPA" secondAttribute="trailing" id="2Vg-Z5-qiJ"/>
<constraint firstItem="Q7V-p9-fqq" firstAttribute="top" secondItem="qrc-nF-3bM" secondAttribute="bottom" id="HWr-qX-XVw"/> <constraint firstItem="ZzE-T4-HYp" firstAttribute="leading" secondItem="EEU-2F-lPA" secondAttribute="leading" id="2lw-fJ-dUv"/>
<constraint firstItem="EEU-2F-lPA" firstAttribute="bottom" secondItem="Q7V-p9-fqq" secondAttribute="bottom" id="PNe-VO-dMU"/> <constraint firstItem="3kd-PT-FOP" firstAttribute="leading" secondItem="EEU-2F-lPA" secondAttribute="leading" id="CE5-R0-xNG"/>
<constraint firstItem="fZ1-nH-ZAg" firstAttribute="centerY" secondItem="EEU-2F-lPA" secondAttribute="centerY" id="Sel-0y-Uha"/> <constraint firstItem="EEU-2F-lPA" firstAttribute="trailing" secondItem="3kd-PT-FOP" secondAttribute="trailing" id="CwP-3o-fkv"/>
<constraint firstAttribute="bottom" secondItem="ZzE-T4-HYp" secondAttribute="bottom" id="IN5-0y-F3R"/>
<constraint firstAttribute="trailing" secondItem="03T-HE-97c" secondAttribute="trailing" id="JDD-fl-tqc"/>
<constraint firstItem="03T-HE-97c" firstAttribute="leading" secondItem="EEU-2F-lPA" secondAttribute="leading" id="KUx-kz-pc7"/>
<constraint firstItem="03T-HE-97c" firstAttribute="trailing" secondItem="EEU-2F-lPA" secondAttribute="trailing" id="Nxy-l1-wKb"/>
<constraint firstAttribute="bottom" secondItem="03T-HE-97c" secondAttribute="bottom" id="OZn-H9-JGD"/>
<constraint firstItem="ZzE-T4-HYp" firstAttribute="top" secondItem="ibd-Ky-5QZ" secondAttribute="bottom" constant="15" id="R3d-g2-czC"/>
<constraint firstItem="3kd-PT-FOP" firstAttribute="centerX" secondItem="ZzE-T4-HYp" secondAttribute="centerX" id="SCd-Ty-VLm"/>
<constraint firstItem="Fdg-SY-oNd" firstAttribute="top" secondItem="EEU-2F-lPA" secondAttribute="top" id="SpN-9a-czs"/> <constraint firstItem="Fdg-SY-oNd" firstAttribute="top" secondItem="EEU-2F-lPA" secondAttribute="top" id="SpN-9a-czs"/>
<constraint firstItem="EEU-2F-lPA" firstAttribute="trailing" secondItem="Fdg-SY-oNd" secondAttribute="trailing" id="W91-7B-A8x"/> <constraint firstItem="EEU-2F-lPA" firstAttribute="trailing" secondItem="Fdg-SY-oNd" secondAttribute="trailing" id="W91-7B-A8x"/>
<constraint firstItem="Q7V-p9-fqq" firstAttribute="centerX" secondItem="EEU-2F-lPA" secondAttribute="centerX" id="dxD-a5-NbF"/> <constraint firstItem="3kd-PT-FOP" firstAttribute="centerY" secondItem="ZzE-T4-HYp" secondAttribute="centerY" id="aSa-5t-t5c"/>
<constraint firstAttribute="bottom" secondItem="Fdg-SY-oNd" secondAttribute="bottom" id="ftY-Br-VBe"/> <constraint firstAttribute="bottom" secondItem="Fdg-SY-oNd" secondAttribute="bottom" id="ftY-Br-VBe"/>
<constraint firstItem="ibd-Ky-5QZ" firstAttribute="leading" secondItem="EEU-2F-lPA" secondAttribute="leading" constant="10" id="gOk-Il-uBj"/> <constraint firstItem="ibd-Ky-5QZ" firstAttribute="leading" secondItem="EEU-2F-lPA" secondAttribute="leading" constant="10" id="gOk-Il-uBj"/>
<constraint firstItem="ibd-Ky-5QZ" firstAttribute="top" secondItem="EEU-2F-lPA" secondAttribute="top" constant="10" id="gvR-Eu-UvL"/> <constraint firstItem="ibd-Ky-5QZ" firstAttribute="top" secondItem="EEU-2F-lPA" secondAttribute="top" constant="10" id="gvR-Eu-UvL"/>
<constraint firstItem="EEU-2F-lPA" firstAttribute="trailing" secondItem="qrc-nF-3bM" secondAttribute="trailing" id="jAR-uY-cKV"/>
<constraint firstItem="qrc-nF-3bM" firstAttribute="top" secondItem="ibd-Ky-5QZ" secondAttribute="bottom" constant="15" id="jFK-oJ-8HO"/>
<constraint firstItem="Fdg-SY-oNd" firstAttribute="leading" secondItem="EEU-2F-lPA" secondAttribute="leading" id="q1i-Vc-6Pq"/> <constraint firstItem="Fdg-SY-oNd" firstAttribute="leading" secondItem="EEU-2F-lPA" secondAttribute="leading" id="q1i-Vc-6Pq"/>
<constraint firstItem="fZ1-nH-ZAg" firstAttribute="centerX" secondItem="EEU-2F-lPA" secondAttribute="centerX" id="ss4-2Y-yT0"/>
<constraint firstItem="03T-HE-97c" firstAttribute="trailing" secondItem="EEU-2F-lPA" secondAttribute="trailing" id="ttW-dy-Pb4"/>
<constraint firstItem="EEU-2F-lPA" firstAttribute="trailing" secondItem="ibd-Ky-5QZ" secondAttribute="trailing" id="uiq-HX-kWV"/> <constraint firstItem="EEU-2F-lPA" firstAttribute="trailing" secondItem="ibd-Ky-5QZ" secondAttribute="trailing" id="uiq-HX-kWV"/>
<constraint firstItem="qrc-nF-3bM" firstAttribute="leading" secondItem="EEU-2F-lPA" secondAttribute="leading" id="uux-x1-sEU"/>
<constraint firstAttribute="bottom" secondItem="03T-HE-97c" secondAttribute="bottom" id="wMq-xo-NyQ"/>
</constraints> </constraints>
</view> </view>
<connections> <connections>
<outlet property="noDataStack" destination="fZ1-nH-ZAg" id="f96-BI-pgI"/> <outlet property="adView" destination="OHh-gC-1V1" id="13C-hJ-Ejz"/>
<outlet property="productCV" destination="qrc-nF-3bM" id="0dx-wj-O2z"/> <outlet property="noDataStack" destination="3kd-PT-FOP" id="ARc-SM-nSP"/>
<outlet property="spinnerView" destination="Q7V-p9-fqq" id="34Z-yw-ohr"/> <outlet property="productCV" destination="hin-ei-TV5" id="aXR-Pz-vHE"/>
<outlet property="spinnerView" destination="Sr3-9L-8Fz" id="eEe-RQ-dKH"/>
<outlet property="subCategoryCV" destination="ibd-Ky-5QZ" id="0j8-y0-HeP"/> <outlet property="subCategoryCV" destination="ibd-Ky-5QZ" id="0j8-y0-HeP"/>
</connections> </connections>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="P44-mc-g6G" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="P44-mc-g6G" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="503" y="-35"/> <point key="canvasLocation" x="501.52671755725191" y="-35.211267605633807"/>
</scene> </scene>
<!--Product DetailsVC--> <!--Product DetailsVC-->
<scene sceneID="xRv-dP-yoU"> <scene sceneID="xRv-dP-yoU">
@@ -284,7 +327,7 @@
<rect key="frame" x="0.0" y="557.33333333333337" width="393" height="294.66666666666663"/> <rect key="frame" x="0.0" y="557.33333333333337" width="393" height="294.66666666666663"/>
</imageView> </imageView>
<scrollView hidden="YES" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wxy-J9-S7w"> <scrollView hidden="YES" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wxy-J9-S7w">
<rect key="frame" x="0.0" y="59" width="393" height="759"/> <rect key="frame" x="0.0" y="59" width="393" height="793"/>
<subviews> <subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="14" translatesAutoresizingMaskIntoConstraints="NO" id="2Hi-i7-d5A"> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="14" translatesAutoresizingMaskIntoConstraints="NO" id="2Hi-i7-d5A">
<rect key="frame" x="0.0" y="0.0" width="393" height="422"/> <rect key="frame" x="0.0" y="0.0" width="393" height="422"/>
@@ -410,35 +453,43 @@
</stackView> </stackView>
</subviews> </subviews>
<constraints> <constraints>
<constraint firstAttribute="bottom" secondItem="2Hi-i7-d5A" secondAttribute="bottom" id="9mF-gp-qig"/> <constraint firstItem="2Hi-i7-d5A" firstAttribute="leading" secondItem="wxy-J9-S7w" secondAttribute="leading" id="2IU-9w-gFe"/>
<constraint firstAttribute="bottom" secondItem="2Hi-i7-d5A" secondAttribute="bottom" id="7Gr-es-IA5"/>
<constraint firstItem="2Hi-i7-d5A" firstAttribute="width" secondItem="3Kq-bf-nlH" secondAttribute="width" id="E4t-bO-D9a"/> <constraint firstItem="2Hi-i7-d5A" firstAttribute="width" secondItem="3Kq-bf-nlH" secondAttribute="width" id="E4t-bO-D9a"/>
<constraint firstItem="2Hi-i7-d5A" firstAttribute="leading" secondItem="fDN-IE-ujI" secondAttribute="leading" id="Qc8-PA-ErK"/> <constraint firstItem="2Hi-i7-d5A" firstAttribute="leading" secondItem="fDN-IE-ujI" secondAttribute="leading" id="Qc8-PA-ErK"/>
<constraint firstItem="fDN-IE-ujI" firstAttribute="trailing" secondItem="2Hi-i7-d5A" secondAttribute="trailing" id="iAp-oy-kPc"/> <constraint firstItem="fDN-IE-ujI" firstAttribute="trailing" secondItem="2Hi-i7-d5A" secondAttribute="trailing" id="iAp-oy-kPc"/>
<constraint firstAttribute="trailing" secondItem="2Hi-i7-d5A" secondAttribute="trailing" id="kqD-79-jGt"/>
<constraint firstItem="2Hi-i7-d5A" firstAttribute="top" secondItem="wxy-J9-S7w" secondAttribute="top" id="rFi-wx-fQQ"/> <constraint firstItem="2Hi-i7-d5A" firstAttribute="top" secondItem="wxy-J9-S7w" secondAttribute="top" id="rFi-wx-fQQ"/>
</constraints> </constraints>
<viewLayoutGuide key="contentLayoutGuide" id="3Kq-bf-nlH"/> <viewLayoutGuide key="contentLayoutGuide" id="3Kq-bf-nlH"/>
<viewLayoutGuide key="frameLayoutGuide" id="fDN-IE-ujI"/> <viewLayoutGuide key="frameLayoutGuide" id="fDN-IE-ujI"/>
</scrollView> </scrollView>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5An-pm-UM9">
<rect key="frame" x="0.0" y="376" width="393" height="100"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
</subviews> </subviews>
<viewLayoutGuide key="safeArea" id="lMc-y6-eRf"/> <viewLayoutGuide key="safeArea" id="lMc-y6-eRf"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints> <constraints>
<constraint firstItem="wxy-J9-S7w" firstAttribute="top" secondItem="lMc-y6-eRf" secondAttribute="top" id="0Dw-gY-fwD"/>
<constraint firstItem="Sf0-tQ-I1Z" firstAttribute="top" secondItem="lMc-y6-eRf" secondAttribute="top" id="4eA-Ne-ylA"/> <constraint firstItem="Sf0-tQ-I1Z" firstAttribute="top" secondItem="lMc-y6-eRf" secondAttribute="top" id="4eA-Ne-ylA"/>
<constraint firstItem="PDw-D2-MIm" firstAttribute="centerY" secondItem="lMc-y6-eRf" secondAttribute="centerY" id="4rO-nR-njd"/> <constraint firstItem="PDw-D2-MIm" firstAttribute="centerY" secondItem="lMc-y6-eRf" secondAttribute="centerY" id="4rO-nR-njd"/>
<constraint firstItem="11o-Wz-oVy" firstAttribute="leading" secondItem="lMc-y6-eRf" secondAttribute="leading" id="5aK-8E-8eP"/> <constraint firstItem="11o-Wz-oVy" firstAttribute="leading" secondItem="lMc-y6-eRf" secondAttribute="leading" id="5aK-8E-8eP"/>
<constraint firstAttribute="bottom" secondItem="Sf0-tQ-I1Z" secondAttribute="bottom" id="6SO-op-X8q"/> <constraint firstAttribute="bottom" secondItem="Sf0-tQ-I1Z" secondAttribute="bottom" id="6SO-op-X8q"/>
<constraint firstAttribute="bottom" secondItem="wxy-J9-S7w" secondAttribute="bottom" id="8A4-20-vMN"/>
<constraint firstItem="Sf0-tQ-I1Z" firstAttribute="leading" secondItem="lMc-y6-eRf" secondAttribute="leading" id="CvR-51-mma"/> <constraint firstItem="Sf0-tQ-I1Z" firstAttribute="leading" secondItem="lMc-y6-eRf" secondAttribute="leading" id="CvR-51-mma"/>
<constraint firstAttribute="bottom" secondItem="11o-Wz-oVy" secondAttribute="bottom" id="IUM-Qf-wbF"/> <constraint firstAttribute="bottom" secondItem="11o-Wz-oVy" secondAttribute="bottom" id="IUM-Qf-wbF"/>
<constraint firstItem="wxy-J9-S7w" firstAttribute="bottom" secondItem="lMc-y6-eRf" secondAttribute="bottom" id="Msc-lZ-XZ1"/> <constraint firstItem="wxy-J9-S7w" firstAttribute="trailing" secondItem="lMc-y6-eRf" secondAttribute="trailing" id="LV1-iI-0I6"/>
<constraint firstItem="wxy-J9-S7w" firstAttribute="trailing" secondItem="lMc-y6-eRf" secondAttribute="trailing" id="PHj-gT-GZ1"/>
<constraint firstItem="11o-Wz-oVy" firstAttribute="trailing" secondItem="lMc-y6-eRf" secondAttribute="trailing" id="TWL-yC-bnk"/> <constraint firstItem="11o-Wz-oVy" firstAttribute="trailing" secondItem="lMc-y6-eRf" secondAttribute="trailing" id="TWL-yC-bnk"/>
<constraint firstItem="wxy-J9-S7w" firstAttribute="leading" secondItem="lMc-y6-eRf" secondAttribute="leading" id="X4E-Gc-aRw"/>
<constraint firstItem="PDw-D2-MIm" firstAttribute="centerX" secondItem="lMc-y6-eRf" secondAttribute="centerX" id="gM9-yg-ZFf"/> <constraint firstItem="PDw-D2-MIm" firstAttribute="centerX" secondItem="lMc-y6-eRf" secondAttribute="centerX" id="gM9-yg-ZFf"/>
<constraint firstItem="wxy-J9-S7w" firstAttribute="leading" secondItem="lMc-y6-eRf" secondAttribute="leading" id="ikg-2w-U5Z"/>
<constraint firstItem="wxy-J9-S7w" firstAttribute="top" secondItem="lMc-y6-eRf" secondAttribute="top" id="kqX-6Z-Rcn"/>
<constraint firstItem="lMc-y6-eRf" firstAttribute="trailing" secondItem="Sf0-tQ-I1Z" secondAttribute="trailing" id="rNS-vr-yQK"/> <constraint firstItem="lMc-y6-eRf" firstAttribute="trailing" secondItem="Sf0-tQ-I1Z" secondAttribute="trailing" id="rNS-vr-yQK"/>
</constraints> </constraints>
</view> </view>
<connections> <connections>
<outlet property="adView" destination="5An-pm-UM9" id="U7v-fZ-Fa8"/>
<outlet property="addToCartBtn" destination="ahD-zd-wgq" id="q5Z-e2-ik2"/> <outlet property="addToCartBtn" destination="ahD-zd-wgq" id="q5Z-e2-ik2"/>
<outlet property="categoryName" destination="pXa-BI-1Vq" id="ZOJ-87-NoN"/> <outlet property="categoryName" destination="pXa-BI-1Vq" id="ZOJ-87-NoN"/>
<outlet property="noDataStack" destination="PDw-D2-MIm" id="E88-iq-agZ"/> <outlet property="noDataStack" destination="PDw-D2-MIm" id="E88-iq-agZ"/>

View File

@@ -7,6 +7,7 @@
import UIKit import UIKit
import Alamofire import Alamofire
import GoogleMobileAds
class ProductDetailsVM{ class ProductDetailsVM{
@@ -15,6 +16,7 @@ class ProductDetailsVM{
var productDetails : ShopProductsListingDM.ResultData? var productDetails : ShopProductsListingDM.ResultData?
var productID : Int? var productID : Int?
var cartButton: UIBarButtonItem! var cartButton: UIBarButtonItem!
var bottomBanner = GADBannerView()
func initView(){ func initView(){
addGradient() addGradient()
@@ -26,6 +28,22 @@ class ProductDetailsVM{
if let productID { if let productID {
self.getProductDetails(productID: productID) self.getProductDetails(productID: productID)
} }
/*
If ads found then only load it or else directly append the data and reload
*/
if let adsData = AuthFunc.shareInstance.adsData{
// check if ads data contains ad for webseries
if let shopSuperCatAd = adsData.result?.filter({$0.slug == AdsEnum.shop_super_category.rawValue}).first{
if shopSuperCatAd.googleAd != nil{
//setup google banner ads.
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2, execute: { [weak self] in
guard let self else{return}
AdReusable.sharedInstance.setupBannerAd(bannerView: self.bottomBanner, in: vc.adView, adUnitID: K.GoogleAdIDs.themeTwo, viewController: self.vc)
})
}
}
}
} }
@objc func cartButtonTapped(){ @objc func cartButtonTapped(){

View File

@@ -7,6 +7,7 @@
import UIKit import UIKit
import Alamofire import Alamofire
import GoogleMobileAds
class ShopCategoryVM{ class ShopCategoryVM{
@@ -15,6 +16,7 @@ class ShopCategoryVM{
var categoryData = [ShopCategoryDM.ResultData]() var categoryData = [ShopCategoryDM.ResultData]()
var cartButton: UIBarButtonItem! var cartButton: UIBarButtonItem!
var bottomBanner = GADBannerView()
func initView(){ func initView(){
setupCell() setupCell()
@@ -83,6 +85,19 @@ class ShopCategoryVM{
guard let data = data.data?.result else{return} guard let data = data.data?.result else{return}
self.categoryData = data self.categoryData = data
self.vc.tableView.reloadData() self.vc.tableView.reloadData()
/*
If ads found then only load it or else directly append the data and reload
*/
if let adsData = AuthFunc.shareInstance.adsData{
// check if ads data contains ad for webseries
if let shopSuperCatAd = adsData.result?.filter({$0.slug == AdsEnum.shop_super_category.rawValue}).first{
if shopSuperCatAd.googleAd != nil{
//setup google banner ads.
AdReusable.sharedInstance.setupBannerAd(bannerView: self.bottomBanner, in: vc.adView, adUnitID: K.GoogleAdIDs.themeTwo, viewController: self.vc, height: 8, width: 15)
}
}
}
default: default:
Utilities.dismissProgressHUD() Utilities.dismissProgressHUD()
break break

View File

@@ -7,12 +7,14 @@
import UIKit import UIKit
import Alamofire import Alamofire
import GoogleMobileAds
class ShopListingVM{ class ShopListingVM{
weak var vc : ShopListingVC! weak var vc : ShopListingVC!
var superCatData = [ShopSuperCategoryDM.ResultData]() var superCatData = [ShopSuperCategoryDM.ResultData]()
var cartButton: UIBarButtonItem! var cartButton: UIBarButtonItem!
var bottomBanner = GADBannerView()
func initView(){ func initView(){
setupCell() setupCell()
@@ -89,10 +91,15 @@ class ShopListingVM{
*/ */
if let adsData = AuthFunc.shareInstance.adsData{ if let adsData = AuthFunc.shareInstance.adsData{
// check if ads data contains ad for webseries // check if ads data contains ad for webseries
if let shopSuperCatAd = adsData.result?.filter({$0.slug == AdsEnum.shop_super_category.rawValue}).first, let bannerImage = shopSuperCatAd.advertisement?.bannerImage{ if let shopSuperCatAd = adsData.result?.filter({$0.slug == AdsEnum.shop_super_category.rawValue}).first{
self.superCatData.append(ShopSuperCategoryDM.ResultData(id: shopSuperCatAd.advertisement?.id, superCategoryName: shopSuperCatAd.advertisement?.title, superCategoryThumbnail: bannerImage,isAD: true)) if let bannerImage = shopSuperCatAd.advertisement?.bannerImage{
}else{ // check if google ads self.superCatData.append(ShopSuperCategoryDM.ResultData(id: shopSuperCatAd.advertisement?.id, superCategoryName: shopSuperCatAd.advertisement?.title, superCategoryThumbnail: bannerImage,isAD: true))
}else{ // check if google ads
if shopSuperCatAd.googleAd != nil{
//setup google banner ads.
AdReusable.sharedInstance.setupBannerAd(bannerView: self.bottomBanner, in: vc.adView, adUnitID: K.GoogleAdIDs.themeTwo, viewController: self.vc, height: 8, width: 15)
}
}
} }
} }

View File

@@ -7,6 +7,7 @@
import Foundation import Foundation
import Alamofire import Alamofire
import GoogleMobileAds
class ShopProductsVM{ class ShopProductsVM{
@@ -21,6 +22,7 @@ class ShopProductsVM{
var pageNo = 0 var pageNo = 0
var stopFetch = false var stopFetch = false
var cartButton: UIBarButtonItem! var cartButton: UIBarButtonItem!
var bottomBanner = GADBannerView()
func initView(){ func initView(){
getCategory() getCategory()
@@ -168,6 +170,19 @@ class ShopProductsVM{
} }
self.vc.navigationController?.pushViewController(vcPush, animated: true) self.vc.navigationController?.pushViewController(vcPush, animated: true)
} }
/*
If ads found then only load it or else directly append the data and reload
*/
if let adsData = AuthFunc.shareInstance.adsData{
// check if ads data contains ad for webseries
if let shopSuperCatAd = adsData.result?.filter({$0.slug == AdsEnum.shop_super_category.rawValue}).first{
if shopSuperCatAd.googleAd != nil{
//setup google banner ads.
AdReusable.sharedInstance.setupBannerAd(bannerView: self.bottomBanner, in: vc.adView, adUnitID: K.GoogleAdIDs.themeTwo, viewController: self.vc, height: 8, width: 15)
}
}
}
default: default:
Utilities.dismissProgressHUD() Utilities.dismissProgressHUD()
vc.spinnerView.stopAnimating() vc.spinnerView.stopAnimating()

View File

@@ -303,7 +303,7 @@ class PlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate {
// player.nextUpPlaylistIndex = videoIndex ?? 0 // player.nextUpPlaylistIndex = videoIndex ?? 0
// player.next() // player.next()
// } // }
case .trailer,.songs: case .trailer,.songs, .masilaSongs:
break break
case .continueWatching,.audioBooks, .games: case .continueWatching,.audioBooks, .games:
player.seek(to: 0) player.seek(to: 0)

View File

@@ -572,7 +572,7 @@ class ThemeOneVM{
// .preload(JWPreload(rawValue: 20) ?? .none) // .preload(JWPreload(rawValue: 20) ?? .none)
.autostart(true) .autostart(true)
.advertising(adConfig) .advertising(adConfig)
.playerId("X57dFDmV") // .playerId("X57dFDmV")
.build() .build()
vc.config = config vc.config = config

View File

@@ -226,11 +226,14 @@ extension WebSeriesSeasonVC : TableViewSRC{
} }
} }
if let selectedMediaType = self.vm.seasonListingData.filter({$0.id == self.vm.episodeSelectedCateogory!}).first, selectedMediaType.mediaType?.lowercased() == "songs"{
JWPlayerManager.shared.presentPlayer(from: self, playerItems: playerItems, startIndex: indexPath.row, contentType: .masilaSongs, videoIDs: videoIDs,catID: vm.categoryID)
return
}
JWPlayerManager.shared.presentPlayer(from: self, playerItems: playerItems, startIndex: indexPath.row, contentType: .webSeries, videoIDs: videoIDs, catID: vm.categoryID) JWPlayerManager.shared.presentPlayer(from: self, playerItems: playerItems, startIndex: indexPath.row, contentType: .webSeries, videoIDs: videoIDs, catID: vm.categoryID)
default: default:
break break
} }
} }
return cell return cell
@@ -248,6 +251,8 @@ extension WebSeriesSeasonVC : TableViewSRC{
} }
vcPush.teaserData = data vcPush.teaserData = data
default: default:
let selectedMediaType = vm.seasonListingData.filter({$0.id == vm.episodeSelectedCateogory!}).first
print(selectedMediaType?.mediaType)
let data = vm.seasonEpisodeData[indexPath.row] let data = vm.seasonEpisodeData[indexPath.row]
if let showID = data.id, let catID = self.vm.categoryID{ if let showID = data.id, let catID = self.vm.categoryID{
PersistentStorage.shared.addWebSeries(catID: catID, postID: showID, postType: .episode) PersistentStorage.shared.addWebSeries(catID: catID, postID: showID, postType: .episode)