- Added a star above the grass and added it to the animation. - Woke Client call 1:15 - 1:40 - Added Sidebar theme clicks and added userdefaults with checks for default loading. Also added to logout - Handled the Theme change from sidebar, also handled the default theme selected and loading it at the time of startup - Fixed issue of sidebar showing up, left side blacktint was not coming. It was the issue of ViewLifeCycle - Theme 2 Explore woka items size ratio updated for auto layouts - Worked on RootView Navigation.
49 lines
1.5 KiB
Swift
49 lines
1.5 KiB
Swift
//
|
|
// SplashVM.swift
|
|
// WOKA
|
|
//
|
|
// Created by MacBook Pro on 25/04/24.
|
|
//
|
|
|
|
import UIKit
|
|
import AVFoundation
|
|
|
|
class SplashVM{
|
|
|
|
weak var vc : SplashVC!
|
|
var player: AVAudioPlayer?
|
|
|
|
func playSplashSound() {
|
|
guard let path = Bundle.main.path(forResource: K.StaticFilesString.wokaSplashSound, ofType:"m4a") else {
|
|
return }
|
|
let url = URL(fileURLWithPath: path)
|
|
|
|
do {
|
|
player = try AVAudioPlayer(contentsOf: url)
|
|
player?.play()
|
|
|
|
} catch let error {
|
|
print(error.localizedDescription)
|
|
}
|
|
}
|
|
|
|
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()
|
|
}
|
|
|
|
func selectTheme(){
|
|
let theme = UserDefaults.standard.string(forKey: K.UserDefaultsStruct.themeDefault)
|
|
if theme != nil{
|
|
(theme == ThemeSelect.theme1.rawValue) ? (AuthFunc.shareInstance.selectedTheme = .theme1) : (AuthFunc.shareInstance.selectedTheme = .theme2)
|
|
}else{
|
|
AuthFunc.shareInstance.selectedTheme = .theme1
|
|
}
|
|
}
|
|
}
|