- Added placeholder handling for sdwebimage theme one avatar
- Fixed the issue of loading indicator not showing in episode listing
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
523ED2752BDA2BC900CFED02 /* WOKATests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 523ED2742BDA2BC900CFED02 /* WOKATests.swift */; };
|
||||
523ED27F2BDA2BC900CFED02 /* WOKAUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 523ED27E2BDA2BC900CFED02 /* WOKAUITests.swift */; };
|
||||
523ED2812BDA2BC900CFED02 /* WOKAUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 523ED2802BDA2BC900CFED02 /* WOKAUITestsLaunchTests.swift */; };
|
||||
52423CD12CB6A8A900623CA7 /* CheckReachability.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52423CD02CB6A8A300623CA7 /* CheckReachability.swift */; };
|
||||
5242FE592C24203E0086A86D /* WebSeriesSeasonVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5242FE582C24203E0086A86D /* WebSeriesSeasonVC.swift */; };
|
||||
5242FE5B2C24317A0086A86D /* WebSeriesSeasonVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5242FE5A2C24317A0086A86D /* WebSeriesSeasonVM.swift */; };
|
||||
524612032C64E89E001DA728 /* MyListViewAllVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 524612022C64E89E001DA728 /* MyListViewAllVM.swift */; };
|
||||
@@ -451,6 +452,7 @@
|
||||
523ED27A2BDA2BC900CFED02 /* WOKAUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WOKAUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
523ED27E2BDA2BC900CFED02 /* WOKAUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WOKAUITests.swift; sourceTree = "<group>"; };
|
||||
523ED2802BDA2BC900CFED02 /* WOKAUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WOKAUITestsLaunchTests.swift; sourceTree = "<group>"; };
|
||||
52423CD02CB6A8A300623CA7 /* CheckReachability.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckReachability.swift; sourceTree = "<group>"; };
|
||||
5242FE582C24203E0086A86D /* WebSeriesSeasonVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebSeriesSeasonVC.swift; sourceTree = "<group>"; };
|
||||
5242FE5A2C24317A0086A86D /* WebSeriesSeasonVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebSeriesSeasonVM.swift; sourceTree = "<group>"; };
|
||||
524612022C64E89E001DA728 /* MyListViewAllVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyListViewAllVM.swift; sourceTree = "<group>"; };
|
||||
@@ -1523,6 +1525,7 @@
|
||||
52C8B0512BDA4B51003B51D0 /* Helpers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
52423CD02CB6A8A300623CA7 /* CheckReachability.swift */,
|
||||
5282DB2D2C981E9300465BA1 /* AdResuable */,
|
||||
5201D4272C7F22DD008E3211 /* Network */,
|
||||
9CDAEB0F2C53F12800890C47 /* Shadows */,
|
||||
@@ -2586,6 +2589,7 @@
|
||||
52ACC1252C610CBC00791528 /* UserClicks+CoreDataClass.swift in Sources */,
|
||||
52ACC1262C610CBC00791528 /* UserClicks+CoreDataProperties.swift in Sources */,
|
||||
9CBCB29D2BE4D6BB007D7934 /* LoginVM.swift in Sources */,
|
||||
52423CD12CB6A8A900623CA7 /* CheckReachability.swift in Sources */,
|
||||
52BBFCB42C5275E100F7D0D1 /* AddressListVM.swift in Sources */,
|
||||
524C42312C0499560016A11C /* NotificationCenterReloads.swift in Sources */,
|
||||
9C8C4FAE2C1315410017DD3B /* WebViewVC.swift in Sources */,
|
||||
|
||||
@@ -87,6 +87,11 @@ class AudioBookHomeVC: UIViewController {
|
||||
}
|
||||
|
||||
@IBAction func loadMoreBtn(_ sender: LocalisedElementsButton) {
|
||||
PersistentStorage.shared.addOthersCount()
|
||||
if CheckReachability.reachability?.isReachable == false{
|
||||
self.toast(msg: K.ConstantString.noInternet , time: 2)
|
||||
return
|
||||
}
|
||||
loadMoreBtn.isHidden = true
|
||||
vm.pageNo += 1
|
||||
loadMoreActivityIndicator.startAnimating()
|
||||
|
||||
@@ -112,7 +112,10 @@ class GamesListVC: UIViewController {
|
||||
|
||||
@IBAction func loadMoreBtnTapped(_ sender: LocalisedElementsButton) {
|
||||
PersistentStorage.shared.addOthersCount()
|
||||
|
||||
if CheckReachability.reachability?.isReachable == false{
|
||||
self.toast(msg: K.ConstantString.noInternet , time: 2)
|
||||
return
|
||||
}
|
||||
loadMoreBtn.isHidden = true
|
||||
vm.pageNo += 1
|
||||
loadMoreActivityIndicator.startAnimating()
|
||||
|
||||
11
WOKA/Helpers/CheckReachability.swift
Normal file
11
WOKA/Helpers/CheckReachability.swift
Normal file
@@ -0,0 +1,11 @@
|
||||
//
|
||||
// CheckReachability.swift
|
||||
// WOKA
|
||||
//
|
||||
// Created by MacBook Pro on 09/10/24.
|
||||
//
|
||||
import Alamofire
|
||||
|
||||
class CheckReachability{
|
||||
static var reachability = NetworkReachabilityManager()
|
||||
}
|
||||
@@ -8,36 +8,68 @@
|
||||
import UIKit
|
||||
import SDWebImage
|
||||
|
||||
enum ImageType{
|
||||
case homeAvatar
|
||||
case none
|
||||
}
|
||||
extension UIImageView {
|
||||
|
||||
func imageURL(_ url: String, color : UIColor = UIColor.black) {
|
||||
func imageURL(_ url: String, color : UIColor = UIColor.appColor(.TextDarkBlue)!, type : ImageType = .none) {
|
||||
let customIndicator = SDWebImageActivityIndicator.medium
|
||||
customIndicator.indicatorView.color = color
|
||||
self.sd_imageIndicator = customIndicator
|
||||
|
||||
let activityIndicator = UIActivityIndicatorView(style: .medium)
|
||||
activityIndicator.tintColor = UIColor.darkGray
|
||||
activityIndicator.color = color
|
||||
activityIndicator.frame = CGRect(x: 0, y: 0, width: 64, height: 64)
|
||||
activityIndicator.hidesWhenStopped = true
|
||||
DispatchQueue.main.async {
|
||||
activityIndicator.startAnimating()
|
||||
self.sd_setImage(with: URL(string: url.replacingOccurrences(of: " ", with: "%20"))) { [weak self] (image, error, cacheType, url) in
|
||||
if error != nil{
|
||||
// do a placeholder image here
|
||||
guard let self else{return}
|
||||
handlePlaceHolder(type: type)
|
||||
}
|
||||
}
|
||||
}
|
||||
activityIndicator.translatesAutoresizingMaskIntoConstraints = true
|
||||
|
||||
// activityIndicator.center = CGPoint(x: self.frame.size.width / 2, y: self.frame.size.height / 2)
|
||||
activityIndicator.center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds))
|
||||
|
||||
// bottom is for resizing the indicator to be perfect in center
|
||||
activityIndicator.autoresizingMask = (UIView.AutoresizingMask(rawValue: UIView.AutoresizingMask.RawValue(UInt8(UIView.AutoresizingMask.flexibleRightMargin.rawValue) | UInt8(UIView.AutoresizingMask.flexibleLeftMargin.rawValue) | UInt8(UIView.AutoresizingMask.flexibleBottomMargin.rawValue) | UInt8(UIView.AutoresizingMask.flexibleTopMargin.rawValue))))
|
||||
//Update the placeholder images respective to the type
|
||||
func handlePlaceHolder(type : ImageType){
|
||||
switch type{
|
||||
case .homeAvatar:
|
||||
self.image = UIImage(named: "DefaultAvatar")
|
||||
case .none:
|
||||
self.image = UIImage(named: "WokaLogo")
|
||||
|
||||
self.addSubview(activityIndicator)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
self.sd_setImage(with: URL(string: url.replacingOccurrences(of: " ", with: "%20"))) { (image, error, cacheType, url) in
|
||||
//Old Detained Code
|
||||
// func imageURL(_ url: String, color : UIColor = UIColor.black) {
|
||||
//
|
||||
// let activityIndicator = UIActivityIndicatorView(style: .medium)
|
||||
// activityIndicator.tintColor = UIColor.darkGray
|
||||
// activityIndicator.color = color
|
||||
// activityIndicator.frame = CGRect(x: 0, y: 0, width: 64, height: 64)
|
||||
// activityIndicator.hidesWhenStopped = true
|
||||
// DispatchQueue.main.async {
|
||||
// activityIndicator.startAnimating()
|
||||
// }
|
||||
// activityIndicator.translatesAutoresizingMaskIntoConstraints = true
|
||||
//
|
||||
// // activityIndicator.center = CGPoint(x: self.frame.size.width / 2, y: self.frame.size.height / 2)
|
||||
// activityIndicator.center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds))
|
||||
//
|
||||
// // bottom is for resizing the indicator to be perfect in center
|
||||
// activityIndicator.autoresizingMask = (UIView.AutoresizingMask(rawValue: UIView.AutoresizingMask.RawValue(UInt8(UIView.AutoresizingMask.flexibleRightMargin.rawValue) | UInt8(UIView.AutoresizingMask.flexibleLeftMargin.rawValue) | UInt8(UIView.AutoresizingMask.flexibleBottomMargin.rawValue) | UInt8(UIView.AutoresizingMask.flexibleTopMargin.rawValue))))
|
||||
//
|
||||
// self.addSubview(activityIndicator)
|
||||
//
|
||||
// self.sd_setImage(with: URL(string: url.replacingOccurrences(of: " ", with: "%20"))) { (image, error, cacheType, url) in
|
||||
//// activityIndicator.stopAnimating()
|
||||
// DispatchQueue.main.async {
|
||||
// activityIndicator.stopAnimating()
|
||||
DispatchQueue.main.async {
|
||||
activityIndicator.stopAnimating()
|
||||
// activityIndicator.removeFromSuperview()
|
||||
}
|
||||
}
|
||||
}
|
||||
//// activityIndicator.removeFromSuperview()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
extension UIButton {
|
||||
|
||||
@@ -87,6 +87,10 @@ class KaraokeListingVC: UIViewController {
|
||||
|
||||
@IBAction func loadMoreBtnTapped(_ sender: LocalisedElementsButton) {
|
||||
PersistentStorage.shared.addOthersCount()
|
||||
if CheckReachability.reachability?.isReachable == false{
|
||||
self.toast(msg: K.ConstantString.noInternet , time: 2)
|
||||
return
|
||||
}
|
||||
loadMoreBtn.isHidden = true
|
||||
vm.pageNo += 1
|
||||
loadMoreActivityIndicator.startAnimating()
|
||||
|
||||
@@ -9,6 +9,15 @@ import UIKit
|
||||
|
||||
extension AuthFunc{
|
||||
|
||||
/// This function will make predefined time sets for handling UI updates.
|
||||
///
|
||||
///
|
||||
///
|
||||
/// Usage:
|
||||
///
|
||||
/// Used to initialize the timings set for the theme 1 bakground update.
|
||||
///
|
||||
/// - Returns: Nothing.
|
||||
func initTimePeriods(){
|
||||
// Define the time periods
|
||||
let morning = TimePeriod.morning(
|
||||
|
||||
@@ -52,7 +52,5 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
PersistentStorage.shared.checkLastSync()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<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.33333333333326" width="393" height="294.66666666666674"/>
|
||||
<rect key="frame" x="0.0" y="523.33333333333337" width="393" height="294.66666666666663"/>
|
||||
</imageView>
|
||||
<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"/>
|
||||
@@ -290,15 +290,15 @@
|
||||
<scene sceneID="xRv-dP-yoU">
|
||||
<objects>
|
||||
<viewController storyboardIdentifier="ProductDetailsVC" id="50W-Kn-pPe" customClass="ProductDetailsVC" customModule="WOKA" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" ambiguous="YES" id="NNP-0A-zEH">
|
||||
<view key="view" contentMode="scaleToFill" id="NNP-0A-zEH">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Sf0-tQ-I1Z">
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Sf0-tQ-I1Z">
|
||||
<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"/>
|
||||
</view>
|
||||
<stackView hidden="YES" opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="PDw-D2-MIm">
|
||||
<stackView hidden="YES" opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="PDw-D2-MIm">
|
||||
<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="fqC-iZ-FnK">
|
||||
@@ -323,14 +323,14 @@
|
||||
</button>
|
||||
</subviews>
|
||||
</stackView>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" image="OrderBottom" translatesAutoresizingMaskIntoConstraints="NO" id="11o-Wz-oVy">
|
||||
<rect key="frame" x="0.0" y="557.33333333333348" width="393" height="294.66666666666663"/>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="OrderBottom" translatesAutoresizingMaskIntoConstraints="NO" id="11o-Wz-oVy">
|
||||
<rect key="frame" x="0.0" y="557.33333333333337" width="393" height="294.66666666666663"/>
|
||||
</imageView>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="3" translatesAutoresizingMaskIntoConstraints="NO" id="o04-js-Fsc">
|
||||
<rect key="frame" x="0.0" y="59" width="393" height="759"/>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="3" translatesAutoresizingMaskIntoConstraints="NO" id="o04-js-Fsc">
|
||||
<rect key="frame" x="0.0" y="59" width="393" height="793"/>
|
||||
<subviews>
|
||||
<scrollView hidden="YES" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wxy-J9-S7w">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="0.0"/>
|
||||
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wxy-J9-S7w">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="690"/>
|
||||
<subviews>
|
||||
<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"/>
|
||||
@@ -391,7 +391,7 @@
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="249" verticalHuggingPriority="251" horizontalCompressionResistancePriority="749" text="" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pXa-BI-1Vq">
|
||||
<rect key="frame" x="134.66666666666663" y="0.0" width="238.33333333333337" height="0.0"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<color key="textColor" name="ImageDarkBlue"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
@@ -407,7 +407,6 @@
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="249" verticalHuggingPriority="251" horizontalCompressionResistancePriority="749" text="" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iAp-gN-dq2">
|
||||
<rect key="frame" x="64.666666666666657" y="0.0" width="308.33333333333337" height="0.0"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" name="ImageDarkBlue"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
@@ -467,8 +466,8 @@
|
||||
<viewLayoutGuide key="contentLayoutGuide" id="3Kq-bf-nlH"/>
|
||||
<viewLayoutGuide key="frameLayoutGuide" id="fDN-IE-ujI"/>
|
||||
</scrollView>
|
||||
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5An-pm-UM9">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="759"/>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5An-pm-UM9">
|
||||
<rect key="frame" x="0.0" y="693" width="393" height="100"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</view>
|
||||
</subviews>
|
||||
|
||||
@@ -53,7 +53,7 @@ class ShopListingCell: UITableViewCell {
|
||||
}
|
||||
|
||||
if let url = data.superCategoryThumbnail{
|
||||
self.cellImage.imageURL(url, color: .black)
|
||||
self.cellImage.imageURL(url)
|
||||
}
|
||||
self.cellTitle.text = data.superCategoryName
|
||||
self.layoutIfNeeded()
|
||||
|
||||
@@ -22,6 +22,6 @@ class ShopProductImageCell: UICollectionViewCell {
|
||||
}
|
||||
|
||||
func setData(image : String){
|
||||
productImage.imageURL(image, color: UIColor.appColor(.TextDarkBlue)!)
|
||||
productImage.imageURL(image)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class ShopProductsCell: UICollectionViewCell {
|
||||
self.productPrice.text = data.productPrice
|
||||
|
||||
if let url = data.shopImage?.first{
|
||||
self.productImage.imageURL(url, color: .black)
|
||||
self.productImage.imageURL(url)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,10 @@
|
||||
<rect key="frame" x="119.5" y="53" width="175" height="103.5"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Boy" translatesAutoresizingMaskIntoConstraints="NO" id="o2x-QJ-V9A">
|
||||
<rect key="frame" x="63" y="0.0" width="49.5" height="50"/>
|
||||
<rect key="frame" x="62.5" y="0.0" width="50" height="50"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" secondItem="o2x-QJ-V9A" secondAttribute="height" multiplier="1:1" id="aAG-v7-Ds9"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="JE2-1V-ByS">
|
||||
<rect key="frame" x="35.5" y="55" width="104.5" height="24"/>
|
||||
@@ -1383,6 +1386,7 @@
|
||||
<rect key="frame" x="15" y="235" width="344" height="236.5"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<color key="textColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
|
||||
</textView>
|
||||
</subviews>
|
||||
|
||||
@@ -104,11 +104,13 @@ class ThemeOneVC: UIViewController {
|
||||
K.GVar.topView = .theme1
|
||||
|
||||
vm.shouldAnimate = true
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { [weak self] in
|
||||
|
||||
Timer.scheduledTimer(withTimeInterval: 1.3, repeats: false) { [weak self] _ in
|
||||
guard let self else{return}
|
||||
vm.moveLiveTVView()
|
||||
vm.moveCloudView()
|
||||
}
|
||||
|
||||
if let player = vm.avPlayer{
|
||||
player.play()
|
||||
}
|
||||
|
||||
@@ -50,30 +50,44 @@ class ThemeOneVM{
|
||||
}
|
||||
|
||||
func initView(){
|
||||
// Update user Data on UI
|
||||
setUserData()
|
||||
|
||||
GoogleInterstistialADSetup.shareInstance.setupGoogleIntersitialAD()
|
||||
// requestIDFA()
|
||||
|
||||
//Initialize the time persiods for handling the time.
|
||||
AuthFunc.shareInstance.initTimePeriods()
|
||||
|
||||
// start the time for moitoring time change.
|
||||
startInitialTimer()
|
||||
|
||||
// moveCloudView()
|
||||
//Handle tap gesutres
|
||||
handleTaps()
|
||||
setUserData()
|
||||
|
||||
//Add notification center for app lifecycle and more
|
||||
handleNotificationCenter()
|
||||
|
||||
//add tap gesutre to the moving live tv
|
||||
addTapGestureToMovingView()
|
||||
|
||||
vc.nameLabel.setContentHuggingPriority(.fittingSizeLevel, for: .horizontal)
|
||||
vc.nameLabel.setContentCompressionResistancePriority(.fittingSizeLevel, for: .horizontal)
|
||||
|
||||
// This will monitor the time and update the bakground color and stars as per the timeline.
|
||||
handleBackground()
|
||||
|
||||
// Set initial small scale in viewDidLoad
|
||||
self.vc.allIconView.transform = CGAffineTransform(scaleX: 0.5, y: 0.5) // Set initial scale to 50% of original size
|
||||
|
||||
// Perform the animation after the view has been laid out
|
||||
UIView.animate(withDuration: 0.7, delay: 0, options: [], animations: {
|
||||
self.vc.allIconView.transform = CGAffineTransform.identity // Reset the transform to original size
|
||||
}, completion: {_ in
|
||||
})
|
||||
|
||||
|
||||
// Check for local ads.
|
||||
if let adsData = AuthFunc.shareInstance.adsData{
|
||||
// check if ads data contains ad for webseries
|
||||
if let themeOneAd = adsData.result?.filter({$0.slug == AdsEnum.themeOne.rawValue}).first, let bannerImage = themeOneAd.advertisement?.bannerImage{
|
||||
@@ -86,9 +100,13 @@ class ThemeOneVM{
|
||||
private func handleNotificationCenter(){
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(appDidEnterBackground), name: UIApplication.didEnterBackgroundNotification, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(appWillEnterForeground), name: UIApplication.willEnterForegroundNotification, object: nil)
|
||||
|
||||
// NotificationCenter.default.addObserver(self, selector: #selector(appDidEnterBackground), name: UIApplication.willResignActiveNotification, object: nil)
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(self.themeOnePush(notification:)), name: NSNotification.Name(rawValue: K.NotificationCenterReloads.themeOnePush), object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(self.reloadTheme), name: NSNotification.Name(rawValue: K.NotificationCenterReloads.reloadTheme), object: nil)
|
||||
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleRouteChange(_:)), name: AVAudioSession.routeChangeNotification, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(languageDidChange), name: .languageDidChange, object: nil)
|
||||
|
||||
@@ -98,25 +116,6 @@ class ThemeOneVM{
|
||||
@objc private func languageDidChange() {
|
||||
print("Language Change")
|
||||
}
|
||||
// @objc func showOfflineDeviceUI(notification: Notification) {
|
||||
// if NetworkMonitor.shared.isConnected {
|
||||
// NetworkMonitor.shared.stopMonitoring()
|
||||
// guard let avPlayer else{return}
|
||||
// DispatchQueue.main.async { [weak self] in
|
||||
// guard let self else{return}
|
||||
// if avPlayer.currentItem == nil || avPlayer.currentItem?.status == .failed {
|
||||
// print("Player was Nil")
|
||||
// setupAvPlayer()
|
||||
// } else {
|
||||
// print("Player is not Nil")
|
||||
// setupAvPlayer()
|
||||
// }
|
||||
// }
|
||||
// print("Connected")
|
||||
// } else {
|
||||
// print("Not connected")
|
||||
// }
|
||||
// }
|
||||
|
||||
@objc func handleRouteChange(_ notification: Notification) {
|
||||
guard let userInfo = notification.userInfo,
|
||||
@@ -175,8 +174,7 @@ class ThemeOneVM{
|
||||
}
|
||||
|
||||
if let avatar = data.avtarURL{
|
||||
vc.avatarImage.imageURL(avatar)
|
||||
// vc.avatarImage.imageURL("https://wokaland.com/secret-panel-10102023/hidden-admin-portal-20092023/storage/app/public/uploads/avtar/avatar2.png?d=1716889852")
|
||||
self.vc.avatarImage.imageURL(avatar, color: .white, type: .homeAvatar)
|
||||
}else{
|
||||
vc.avatarImage.image = UIImage(named: "DefaultAvatar")
|
||||
}
|
||||
@@ -458,9 +456,9 @@ class ThemeOneVM{
|
||||
}, completion: { [weak self] _ in
|
||||
guard let self = self else { return }
|
||||
self.isMovingRight.toggle() // Toggle the direction for the next iteration
|
||||
DispatchQueue.main.async { // Ensure the recursive call is made on the main thread
|
||||
// DispatchQueue.main.async { // Ensure the recursive call is made on the main thread
|
||||
self.moveLiveTVView() // Recursively call moveLiveTVView to create a continuous animation
|
||||
}
|
||||
// }
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -270,8 +270,7 @@ class ThemeTwoVM{
|
||||
}
|
||||
|
||||
if let avatar = data.avtarURL{
|
||||
// vc.avatarImage.imageURL("https://wokaland.com/secret-panel-10102023/hidden-admin-portal-20092023/storage/app/public/uploads/avtar/avatar2.png?d=1716889852")
|
||||
vc.avatarImage.imageURL(avatar)
|
||||
vc.avatarImage.imageURL(avatar,color: .white, type: .homeAvatar)
|
||||
}else{
|
||||
vc.avatarImage.image = UIImage(named: "DefaultAvatar")
|
||||
}
|
||||
|
||||
@@ -115,6 +115,10 @@ class WebSeriesSeasonVC: UIViewController {
|
||||
|
||||
@IBAction func loadMoreBtnTapped(_ sender: LocalisedElementsButton) {
|
||||
PersistentStorage.shared.addOthersCount()
|
||||
if CheckReachability.reachability?.isReachable == false{
|
||||
self.toast(msg: K.ConstantString.noInternet , time: 2)
|
||||
return
|
||||
}
|
||||
loadMoreBtn.isHidden = true
|
||||
vm.pageNo += 1
|
||||
loadMoreActivityIndicator.startAnimating()
|
||||
@@ -141,9 +145,9 @@ extension WebSeriesSeasonVC : TableViewSRC{
|
||||
}
|
||||
}
|
||||
|
||||
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
|
||||
return 100
|
||||
}
|
||||
// func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
|
||||
// return 100
|
||||
// }
|
||||
|
||||
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: K.CellIdentifier.WebSeries.webSeriesEpisodeCell) as! WebSeriesEpisodeCell
|
||||
|
||||
@@ -137,13 +137,17 @@ class WebSeriesVC: UIViewController {
|
||||
|
||||
@IBAction func loadMoreBtnTapped(_ sender: LocalisedElementsButton) {
|
||||
PersistentStorage.shared.addOthersCount()
|
||||
if CheckReachability.reachability?.isReachable == false{
|
||||
self.toast(msg: K.ConstantString.noInternet , time: 2)
|
||||
return
|
||||
}
|
||||
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()
|
||||
// PersistentStorage.shared.addOthersCount()
|
||||
}
|
||||
|
||||
@IBAction func retryBtnTapped(_ sender: LocalisedElementsButton) {
|
||||
|
||||
@@ -33,7 +33,7 @@ class WebSeriesCell: UICollectionViewCell {
|
||||
self.episodeSeason.text = seasonNumer + "-" + episodeNumer
|
||||
|
||||
if let url = data.thumbnailPath{
|
||||
cellImage.imageURL(url , color: .black)
|
||||
cellImage.imageURL(url , color: UIColor.appColor(.TextDarkBlue)!)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.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.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"/>
|
||||
<dependencies>
|
||||
<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="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
@@ -33,6 +33,7 @@
|
||||
<rect key="frame" x="8" y="13.666666666666671" width="120" height="71"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="120" id="EpM-Fv-rvr"/>
|
||||
<constraint firstAttribute="height" constant="71" id="dMn-dV-BzJ"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
|
||||
Reference in New Issue
Block a user