diff --git a/WOKA.xcodeproj/project.pbxproj b/WOKA.xcodeproj/project.pbxproj index b605ed5..89d7cf8 100644 --- a/WOKA.xcodeproj/project.pbxproj +++ b/WOKA.xcodeproj/project.pbxproj @@ -148,7 +148,6 @@ 52A6DCC92C4F906900F63C51 /* CartListingDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DCC82C4F906900F63C51 /* CartListingDM.swift */; }; 52A6DCCC2C4F929B00F63C51 /* CartListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DCCA2C4F929B00F63C51 /* CartListCell.swift */; }; 52A6DCCD2C4F929B00F63C51 /* CartListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 52A6DCCB2C4F929B00F63C51 /* CartListCell.xib */; }; - 52A8C9902C75B91F00AAE156 /* WOKA.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 52A8C98E2C75B91F00AAE156 /* WOKA.xcdatamodeld */; }; 52A981CE2C1AFE66000E0BEC /* FavouriteListingDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A981CD2C1AFE66000E0BEC /* FavouriteListingDM.swift */; }; 52A981D02C1AFEE8000E0BEC /* MyListVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A981CF2C1AFEE8000E0BEC /* MyListVM.swift */; }; 52A981D72C1B0E27000E0BEC /* FavouriteCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A981D52C1B0E27000E0BEC /* FavouriteCell.swift */; }; @@ -316,6 +315,7 @@ 9C85A9EF2C5CE1060031C365 /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = 9C85A9EE2C5CE1060031C365 /* FirebaseAnalytics */; }; 9C85A9F12C5CE1060031C365 /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = 9C85A9F02C5CE1060031C365 /* FirebaseCrashlytics */; }; 9C85A9F32C5CE1060031C365 /* FirebasePerformance in Frameworks */ = {isa = PBXBuildFile; productRef = 9C85A9F22C5CE1060031C365 /* FirebasePerformance */; }; + 9C8A13122C7655570000058C /* WOKA.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 9C8A13102C7655570000058C /* WOKA.xcdatamodeld */; }; 9C8C4FAE2C1315410017DD3B /* WebViewVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C8C4FAD2C1315410017DD3B /* WebViewVC.swift */; }; 9C8C4FB02C1328060017DD3B /* Disclaimer.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 9C8C4FAF2C1328060017DD3B /* Disclaimer.rtf */; }; 9C9BE46E2C663B1600C48D6A /* JWKaraokePlayerVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C9BE46D2C663B1600C48D6A /* JWKaraokePlayerVM.swift */; }; @@ -545,7 +545,6 @@ 52A6DCC82C4F906900F63C51 /* CartListingDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CartListingDM.swift; sourceTree = ""; }; 52A6DCCA2C4F929B00F63C51 /* CartListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CartListCell.swift; sourceTree = ""; }; 52A6DCCB2C4F929B00F63C51 /* CartListCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CartListCell.xib; sourceTree = ""; }; - 52A8C98F2C75B91F00AAE156 /* WOKA.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = WOKA.xcdatamodel; sourceTree = ""; }; 52A981CD2C1AFE66000E0BEC /* FavouriteListingDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavouriteListingDM.swift; sourceTree = ""; }; 52A981CF2C1AFEE8000E0BEC /* MyListVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyListVM.swift; sourceTree = ""; }; 52A981D52C1B0E27000E0BEC /* FavouriteCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavouriteCell.swift; sourceTree = ""; }; @@ -703,6 +702,7 @@ 9C834EDB2C1C26CD00B29A9C /* HtmlText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HtmlText.swift; sourceTree = ""; }; 9C8446862C40FC6E003E3E53 /* AVPlayerTesting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AVPlayerTesting.swift; sourceTree = ""; }; 9C85A9EB2C5CD5CD0031C365 /* MyListDataTemp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyListDataTemp.swift; sourceTree = ""; }; + 9C8A13112C7655570000058C /* WOKA.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = WOKA.xcdatamodel; sourceTree = ""; }; 9C8C4FAD2C1315410017DD3B /* WebViewVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebViewVC.swift; sourceTree = ""; }; 9C8C4FAF2C1328060017DD3B /* Disclaimer.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = Disclaimer.rtf; sourceTree = ""; }; 9C9BE46D2C663B1600C48D6A /* JWKaraokePlayerVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JWKaraokePlayerVM.swift; sourceTree = ""; }; @@ -944,7 +944,7 @@ 9C535DC82C00C34000DA6DCD /* Theme */, 52DAC6462C21761700E2F85B /* WebSeries */, 9C834ED92C1C20EC00B29A9C /* WOKA.entitlements */, - 52A8C98E2C75B91F00AAE156 /* WOKA.xcdatamodeld */, + 9C8A13102C7655570000058C /* WOKA.xcdatamodeld */, 52ACC1292C610EC900791528 /* PersistentStorage.swift */, ); path = WOKA; @@ -2460,7 +2460,7 @@ 52ACC1262C610CBC00791528 /* UserClicks+CoreDataProperties.swift in Sources */, 9CBCB29D2BE4D6BB007D7934 /* LoginVM.swift in Sources */, 52BBFCB42C5275E100F7D0D1 /* AddressListVM.swift in Sources */, - 52A8C9902C75B91F00AAE156 /* WOKA.xcdatamodeld in Sources */, + 9C8A13122C7655570000058C /* WOKA.xcdatamodeld in Sources */, 524C42312C0499560016A11C /* NotificationCenterReloads.swift in Sources */, 9C8C4FAE2C1315410017DD3B /* WebViewVC.swift in Sources */, 52BBFCB62C52764B00F7D0D1 /* AddressListDM.swift in Sources */, @@ -2766,7 +2766,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = WOKA/WOKA.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 6; + CURRENT_PROJECT_VERSION = 7; DEVELOPMENT_TEAM = 4S9A74ZB6H; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; @@ -2805,7 +2805,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = WOKA/WOKA.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 6; + CURRENT_PROJECT_VERSION = 7; DEVELOPMENT_TEAM = 4S9A74ZB6H; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; @@ -3096,14 +3096,14 @@ /* End XCSwiftPackageProductDependency section */ /* Begin XCVersionGroup section */ - 52A8C98E2C75B91F00AAE156 /* WOKA.xcdatamodeld */ = { + 9C8A13102C7655570000058C /* WOKA.xcdatamodeld */ = { isa = XCVersionGroup; children = ( - 52A8C98F2C75B91F00AAE156 /* WOKA.xcdatamodel */, + 9C8A13112C7655570000058C /* WOKA.xcdatamodel */, ); - currentVersion = 52A8C98F2C75B91F00AAE156 /* WOKA.xcdatamodel */; + currentVersion = 9C8A13112C7655570000058C /* WOKA.xcdatamodel */; name = WOKA.xcdatamodeld; - path = /Users/macbookpro/Desktop/WOKA/WOKA/WOKA.xcdatamodeld; + path = /Users/bilal/Desktop/woka_native_ios_swift/WOKA/WOKA.xcdatamodeld; sourceTree = ""; versionGroupType = wrapper.xcdatamodel; }; diff --git a/WOKA/Authentication/Base.lproj/AuthenticationSB.storyboard b/WOKA/Authentication/Base.lproj/AuthenticationSB.storyboard index 996c0fc..bad7a52 100644 --- a/WOKA/Authentication/Base.lproj/AuthenticationSB.storyboard +++ b/WOKA/Authentication/Base.lproj/AuthenticationSB.storyboard @@ -1496,17 +1496,17 @@ Sent to Your Parent’s Email - + - + - + - + @@ -1534,10 +1534,10 @@ Sent to Your Parent’s Email - + + + @@ -149,6 +175,7 @@ + @@ -158,6 +185,7 @@ + @@ -165,6 +193,7 @@ + diff --git a/WOKA/Shop/ViewModel/ShopProductsVM.swift b/WOKA/Shop/ViewModel/ShopProductsVM.swift index fcefbc0..d272ea4 100644 --- a/WOKA/Shop/ViewModel/ShopProductsVM.swift +++ b/WOKA/Shop/ViewModel/ShopProductsVM.swift @@ -78,14 +78,14 @@ class ShopProductsVM{ Error */ Utilities.dismissProgressHUD() - Utilities.alertWithBtnCompletion(title: "Error", msgBody: data.message ?? K.ConstantString.unRecognised, okBtnStr: "Retry?", vc: self.vc) { isDone in - if isDone{ - self.getCategory() - } - } + self.vc.toast(msg: data.message ?? K.ConstantString.unRecognised, time: 1.5) + self.vc.noDataStack.isHidden = false case 1: Utilities.dismissProgressHUD() - guard let data = data.data?.result else{return} + guard let data = data.data?.result else{ + self.vc.noDataStack.isHidden = false + return + } self.subCategoryData.append(ShopSubCategoryDM.ResultData(id: -1, categoryMasterID: 0, subCategoryName: " All ", subCategoryThumbnail: "")) self.subCategoryData.append(contentsOf: data) self.selectedSubCategory = -1 @@ -94,6 +94,7 @@ class ShopProductsVM{ Utilities.startProgressHUD() self.getShopProducts(subCategoryID: subCatID) } + self.vc.noDataStack.isHidden = true default: Utilities.dismissProgressHUD() break @@ -104,11 +105,8 @@ class ShopProductsVM{ return } Utilities.dismissProgressHUD() - Utilities.alertWithBtnCompletion(title: "Error", msgBody: error.localizedDescription, okBtnStr: "Retry?", vc: self.vc) { isDone in - if isDone{ - self.getCategory() - } - } + self.vc.toast(msg: error.localizedDescription, time: 1.5) + self.vc.noDataStack.isHidden = false } } } diff --git a/WOKA/Theme/Controller/PlayerVC.swift b/WOKA/Theme/Controller/PlayerVC.swift index 19c33af..6b4faef 100644 --- a/WOKA/Theme/Controller/PlayerVC.swift +++ b/WOKA/Theme/Controller/PlayerVC.swift @@ -38,6 +38,17 @@ class PlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate{ override var shouldAutorotate: Bool { return true } + + override var prefersStatusBarHidden: Bool { + if #available(iOS 16.0, *) { + // Code for iOS 16.0 and above + return false + } else { + // Fallback code for earlier iOS versions + return true + } + + } override func viewDidLoad() { super.viewDidLoad() @@ -45,25 +56,32 @@ class PlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate{ self.delegate = self vm.vc = self vm.initView() -// rotateView(to: .pi / 2) // Example: 90 degrees rotation //bring back button to the front self.view.bringSubviewToFront(backButton) NotificationCenter.default.addObserver(self, selector: #selector(appDidEnterBackground), name: UIApplication.didEnterBackgroundNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(appWillEnterForeground), name: UIApplication.willEnterForegroundNotification, object: nil) } - -// func rotateView(to angle: CGFloat) { -// // Apply rotation to the view's transform -// view.transform = CGAffineTransform(rotationAngle: angle) -// } + + // for ios 15 and below + func rotateView(to angle: CGFloat) { + // Apply rotation to the view's transform + view.transform = CGAffineTransform(rotationAngle: angle) + } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - appDelegate.deviceOrientation = .landscapeRight - let value = UIInterfaceOrientation.landscapeRight.rawValue - UIDevice.current.setValue(value, forKey: "orientation") - + if #available(iOS 16.0, *) { + // Code for iOS 15.0 and above + print("Running on iOS 15.0 or later") + appDelegate.deviceOrientation = .landscapeRight + let value = UIInterfaceOrientation.landscapeRight.rawValue + UIDevice.current.setValue(value, forKey: "orientation") + } else { + // Fallback code for earlier iOS versions + rotateView(to: .pi / 2) // Example: 90 degrees rotation + print("Running on a version earlier than iOS 15.0") + } //Disable Picture in Picture playerView.allowsPictureInPicturePlayback = false @@ -380,11 +398,19 @@ extension PlayerVC { func playerViewControllerDidDismissFullScreen(_ controller: JWPlayerViewController) { print("playerViewControllerDidDismissFullScreen") - appDelegate.deviceOrientation = .portrait vm.updateClicks() - let value = UIInterfaceOrientation.portrait.rawValue - UIDevice.current.setValue(value, forKey: "orientation") - UIViewController.attemptRotationToDeviceOrientation() + + if #available(iOS 16.0, *) { + // Code for iOS 16.0 and above + appDelegate.deviceOrientation = .portrait + let value = UIInterfaceOrientation.portrait.rawValue + UIDevice.current.setValue(value, forKey: "orientation") + UIViewController.attemptRotationToDeviceOrientation() + } else { + // Fallback code for earlier iOS versions + self.dismiss(animated: true) + } + } } diff --git a/WOKA/Theme/Controller/ThemeOneVC.swift b/WOKA/Theme/Controller/ThemeOneVC.swift index c36177c..eca8ed9 100644 --- a/WOKA/Theme/Controller/ThemeOneVC.swift +++ b/WOKA/Theme/Controller/ThemeOneVC.swift @@ -85,7 +85,6 @@ class ThemeOneVC: UIViewController { // PersistentStorage.shared.deleteData() // PersistentStorage.shared.retrieveData() vm.setupAvPlayer() - } override func viewWillAppear(_ animated: Bool) { @@ -101,9 +100,13 @@ class ThemeOneVC: UIViewController { } override func viewDidAppear(_ animated: Bool) { - vm.shouldAnimate = true K.GVar.topView = .theme1 - vm.moveLiveTVView() + + vm.shouldAnimate = true + DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { [weak self] in + guard let self else{return} + vm.moveLiveTVView() + } if let player = vm.avPlayer{ player.play() } diff --git a/WOKA/Theme/Controller/UserNotificationVC.swift b/WOKA/Theme/Controller/UserNotificationVC.swift index 63c13b4..d3400a2 100644 --- a/WOKA/Theme/Controller/UserNotificationVC.swift +++ b/WOKA/Theme/Controller/UserNotificationVC.swift @@ -49,6 +49,8 @@ class UserNotificationVC: UIViewController { @IBAction func retryBtnTapped(_ sender: UIButton) { PersistentStorage.shared.addOthersCount() + Utilities.startProgressHUD() + vm.getUserNotification() } } diff --git a/WOKA/Theme/ViewModel/PlayerVM.swift b/WOKA/Theme/ViewModel/PlayerVM.swift index e1cadb4..bcc4e69 100644 --- a/WOKA/Theme/ViewModel/PlayerVM.swift +++ b/WOKA/Theme/ViewModel/PlayerVM.swift @@ -117,12 +117,19 @@ class PlayerVM{ if vc.contentType == .liveStream{ self.vc.dismissTapped?() } - appDelegate.deviceOrientation = .portrait updateClicks() + + if #available(iOS 16.0, *) { + // Code for iOS 15.0 and above + appDelegate.deviceOrientation = .portrait + let value = UIInterfaceOrientation.portrait.rawValue + UIDevice.current.setValue(value, forKey: "orientation") + UIViewController.attemptRotationToDeviceOrientation() + } else { + // Fallback code for earlier iOS versions + self.vc.dismiss(animated: true) + } - let value = UIInterfaceOrientation.portrait.rawValue - UIDevice.current.setValue(value, forKey: "orientation") - UIViewController.attemptRotationToDeviceOrientation() } func updateClicks(){ diff --git a/WOKA/Theme/ViewModel/ThemeOneVM.swift b/WOKA/Theme/ViewModel/ThemeOneVM.swift index 6c00959..49b9764 100644 --- a/WOKA/Theme/ViewModel/ThemeOneVM.swift +++ b/WOKA/Theme/ViewModel/ThemeOneVM.swift @@ -338,12 +338,15 @@ class ThemeOneVM{ } func moveLiveTVView() { + guard shouldAnimate else { self.centerLiveTVViewHorizontally() return - } // Stop animating if shouldAnimate is false + } + + // Stop animating if shouldAnimate is false guard let vc = self.vc else { return } // Ensure the view controller is available - UIView.animate(withDuration: 6, delay: 0, options: [.allowUserInteraction], animations: { [weak self] in + UIView.animate(withDuration: 8, delay: 0, options: [.allowUserInteraction], animations: { [weak self] in guard let self = self else { return } let margin: CGFloat = 30 let screenWidth = vc.view.frame.width @@ -473,12 +476,14 @@ class ThemeOneVM{ } func tapped(){ - Timer.scheduledTimer(withTimeInterval: 0.2, repeats: false) { _ in + DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { [weak self] in + guard let self else{return} + isMovingRight = false self.avPlayer.play() self.moveLiveTVView() self.vc.liveTvPlayer.layoutIfNeeded() } - print("Sadasd") + print("Player Will Exit") } func startLiveStream(){