- added api for fetching the episode as per the selected category

- made the category collection cells dynamic
- handled the category selection will call the episode api
- solved activity indicator view at the splash start-up
- handled the app lifecycle for live tv app going in foreground and background
- handled play pause while the live tv view apperas and disappears
- Made the likes and favourites dynamic on episode screen
This commit is contained in:
Bilal
2024-06-21 19:35:40 +05:30
parent 95495dc414
commit 1f650bd2b7
20 changed files with 559 additions and 168 deletions

View File

@@ -42,15 +42,6 @@ class SplashVC: UIViewController {
AuthFunc.shareInstance.languageSelected = .english
}
// let sb1 = UIStoryboard(name: "Home", bundle: nil)
// let vc1 = sb1.instantiateViewController(withIdentifier: "SideMenu") as! SideMenuController
// self.navigationController?.pushViewController(vc1, animated: true)
// UIApplication.setRootView(SideMenuController.instantiate(from: .Home))
//
// return
let sb = UIStoryboard(name: K.StoryBoard.main, bundle: nil)
let vc = sb.instantiateViewController(withIdentifier: K.StoryBoardID.OnBoarding.onBoardVC) as! OnBoardVC
@@ -59,10 +50,6 @@ class SplashVC: UIViewController {
transition.duration = 0.3 // Set the duration of the animation
transition.type = CATransitionType.fade // Set the type of animation to fade
// Optionally, set other properties such as timing function, subtype, etc.
// transition.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
// transition.subtype = CATransitionSubtype.fromTop
// Get the navigation controller
guard let navigationController = navigationController else { return }

View File

@@ -14,6 +14,25 @@ class SplashVM{
weak var vc : SplashVC!
var player: AVAudioPlayer?
func initView(){
vc.activityIndicator.hidesWhenStopped = true
let color1 = #colorLiteral(red: 0.144693464, green: 0.1426281333, blue: 0.6686832905, alpha: 1)
let color2 = #colorLiteral(red: 0.4862745098, green: 0.1960784314, blue: 0.7019607843, alpha: 1)
vc.hindiBtn.applyGradient(colors: [color1, color2], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0, y: 0.8))
vc.englishBtn.applyGradient(colors: [color1, color2], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0, y: 0.8))
vc.hindiBtn.roundCorner()
vc.englishBtn.roundCorner()
selectTheme()
// check if user has selected the default language
if let language = AuthFunc.shareInstance.getDefaultLanguage(){
AuthFunc.shareInstance.languageSelected = language
}else{
AuthFunc.shareInstance.setDefaultLanguage(language: .english)
}
}
// Play initial sound
func playSplashSound() {
guard let path = Bundle.main.path(forResource: K.StaticFilesString.wokaSplashSound, ofType:"m4a") else {
return }
@@ -28,24 +47,6 @@ class SplashVM{
}
}
func initView(){
let color1 = #colorLiteral(red: 0.144693464, green: 0.1426281333, blue: 0.6686832905, alpha: 1)
let color2 = #colorLiteral(red: 0.4862745098, green: 0.1960784314, blue: 0.7019607843, alpha: 1)
vc.hindiBtn.applyGradient(colors: [color1, color2], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0, y: 0.8))
vc.englishBtn.applyGradient(colors: [color1, color2], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0, y: 0.8))
vc.hindiBtn.roundCorner()
vc.englishBtn.roundCorner()
selectTheme()
vc.activityIndicator.stopAnimating()
// check if user has selected the default language
if let language = AuthFunc.shareInstance.getDefaultLanguage(){
AuthFunc.shareInstance.languageSelected = language
}else{
AuthFunc.shareInstance.setDefaultLanguage(language: .english)
}
}
func selectTheme(){
let theme = UserDefaults.standard.string(forKey: K.UserDefaultsStruct.themeDefault)
if theme != nil{
@@ -55,6 +56,8 @@ class SplashVM{
}
}
// MARK: - Get the user data if loginned
func getUserData(){
if AuthFunc.shareInstance.getUserType() == 3{
//setusertype
@@ -98,6 +101,7 @@ class SplashVM{
}
}
// handling activity indicator
func startStopIndicator(start : Bool , hide : Bool = false){
if hide{
vc.activityIndicator.stopAnimating()