Files
Woka_Native_iOS/WOKA/Theme/Controller/ThemeOneVC.swift
BilalKhanWDI 86bd90db31 - Created an extension to handle the rootview.
- Added localisation to theme 1, also updated the English localisation for reversing the language
- Added localisation to the sidebar. Also handled the live language change with the help of observers
- Integrated GetUserData API at splash.
- Added the login NAv. Now if user will logout he will be redirected to the login Screen.
- Added Activity Indicator on the splash to handle the getuserdata.
- Added Guest Login To home.
2024-05-28 19:47:51 +05:30

81 lines
2.4 KiB
Swift

//
// ThemeOneVC.swift
// WOKA
//
// Created by Bilal on 03/05/2024.
//
import UIKit
class ThemeOneVC: UIViewController {
@IBOutlet weak var gradientView: UIView!
@IBOutlet weak var cloud2: UIImageView!
@IBOutlet weak var cloud1: UIImageView!
@IBOutlet weak var liveTVView: UIView!
@IBOutlet weak var liveTvPlayer: UIView!
@IBOutlet weak var homeGrass: UIImageView!
@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var welcomeLabel: LocalisedElementsLabel!
@IBOutlet weak var HelloLabel: LocalisedElementsLabel!
@IBOutlet weak var avatarImage: UIImageView!
@IBOutlet weak var webSeriesView: UIStackView!
@IBOutlet var star: [UIImageView]!
@IBOutlet weak var moonImage: UIImageView!
var timer: Timer?
var vm = ThemeOneVM()
weak var delegate: ChildViewControllerDelegate?
deinit{
timer?.invalidate()
// Removing observers
NotificationCenter.default.removeObserver(self, name: UIApplication.didEnterBackgroundNotification, object: nil)
NotificationCenter.default.removeObserver(self, name: UIApplication.willEnterForegroundNotification, object: nil)
NotificationCenter.default.removeObserver(self, name: NSNotification.Name(rawValue: K.NotificationCenterReloads.reloadTheme), object: nil)
}
override func viewDidLoad() {
super.viewDidLoad()
vm.vc = self
vm.initView()
}
// Define a function to customize tab bar item icon size
func customizeTabBarItemIconSize() {
// Get a reference to the tab bar controller
if let tabBarController = self.tabBarController {
// Loop through each tab bar item
for item in tabBarController.tabBar.items! {
// Adjust the image insets to increase the icon size
item.imageInsets = UIEdgeInsets(top: 2, left: -5, bottom: -8, right: -5)
item.titlePositionAdjustment.vertical = CGFloat(8)
}
}
}
@IBAction func barButtonTapped(_ sender: UIButton) {
self.sideMenuController?.revealMenu()
}
}
class NavigationController: UINavigationController {
open override var childForStatusBarHidden: UIViewController? {
return self.topViewController
}
open override var childForStatusBarStyle: UIViewController? {
return self.topViewController
}
}