Files
Woka_Native_iOS/WOKA/Main/AuthFunc/AuthFunc.swift
BilalKhanWDI 33180a55ab - Icon setup on home screen in auto layout
- Added the LiveTv Moving View. Converted the timer into animation for the moving view.
- Made a Enum with custom functions to handle the time.
- Added logic to handle the dark grass for night time
- Rescaled the home grass so dark grass and light grass has identical dimensions
- Handled the night mode with white text for clear text
2024-05-23 19:27:34 +05:30

73 lines
1.8 KiB
Swift

//
// AuthFunc.swift
// WOKA
//
// Created by Bilal on 26/04/2024.
//
import Foundation
import AVFoundation
import UIKit
class AuthFunc{
/**
This is not for external use!
This should only be used for login, registration, Auth Process process & userData Extraction.
*/
var player: AVQueuePlayer?
var playerLooper: AVPlayerLooper?
var userType = UserType.adult
var languageSelected = LocalizedEnum.english
var authID = String()
var authPass = String()
//This is temporary variable. Make it emtpy when the registration is finished.
var regData = UserRegPostModel()
// Singleton instance of AuthFunc
static let shareInstance = AuthFunc()
//Handling Time Changes on Home
var timePeriods = [TimePeriod]()
// Returns the device's UUID
func getDeviceUUID() -> String{
/*
UIDevice.current.name // e.g. "My iPhone"
UIDevice.current.model // e.g. @"iPhone", @"iPod touch"
UIDevice.current.localizedModel // localized version of model
UIDevice.current.systemName // e.g. @"iOS"
UIDevice.current.systemVersion // e.g. @"15.5"
*/
return UIDevice.current.identifierForVendor!.uuidString
}
// Sets authentication ID and password from the app's info dictionary
func setAuthIDPass(){
if let id = Bundle.main.infoDictionary?["API_KEY_ID"] as? String{
authID = id
}
if let pass = Bundle.main.infoDictionary?["API_KEY_PASS"] as? String{
authPass = pass
}
}
}
// MARK: - Language Enum
enum LocalizedEnum : String , CaseIterable{
case hindi = "hi"
case english = "en"
}
// MARK: - Enum representing different user types
enum UserType {
case adult
case kid
}