diff --git a/WOKA/Assets/Assets.xcassets/Menu/HomeIcon.imageset/Contents.json b/WOKA/Assets/Assets.xcassets/Home/Cloud1.imageset/Contents.json similarity index 69% rename from WOKA/Assets/Assets.xcassets/Menu/HomeIcon.imageset/Contents.json rename to WOKA/Assets/Assets.xcassets/Home/Cloud1.imageset/Contents.json index 1a9d1e9..e242eb0 100644 --- a/WOKA/Assets/Assets.xcassets/Menu/HomeIcon.imageset/Contents.json +++ b/WOKA/Assets/Assets.xcassets/Home/Cloud1.imageset/Contents.json @@ -1,17 +1,15 @@ { "images" : [ { - "filename" : "icons8-home.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "icons8-home@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "icons8-home@3x.png", + "filename" : "cloud1.png", "idiom" : "universal", "scale" : "3x" } diff --git a/WOKA/Assets/Assets.xcassets/Home/Cloud1.imageset/cloud1.png b/WOKA/Assets/Assets.xcassets/Home/Cloud1.imageset/cloud1.png new file mode 100644 index 0000000..de5b2ae Binary files /dev/null and b/WOKA/Assets/Assets.xcassets/Home/Cloud1.imageset/cloud1.png differ diff --git a/WOKA/Assets/Assets.xcassets/Home/Cloud2.imageset/Contents.json b/WOKA/Assets/Assets.xcassets/Home/Cloud2.imageset/Contents.json new file mode 100644 index 0000000..cff03d6 --- /dev/null +++ b/WOKA/Assets/Assets.xcassets/Home/Cloud2.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "cloud2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WOKA/Assets/Assets.xcassets/Home/Cloud2.imageset/cloud2.png b/WOKA/Assets/Assets.xcassets/Home/Cloud2.imageset/cloud2.png new file mode 100644 index 0000000..5fc5dd5 Binary files /dev/null and b/WOKA/Assets/Assets.xcassets/Home/Cloud2.imageset/cloud2.png differ diff --git a/WOKA/Assets/Assets.xcassets/Home/Contents.json b/WOKA/Assets/Assets.xcassets/Home/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/WOKA/Assets/Assets.xcassets/Home/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WOKA/Assets/Assets.xcassets/Menu/HeartIcon.imageset/Contents.json b/WOKA/Assets/Assets.xcassets/Home/HeartIcon.imageset/Contents.json similarity index 100% rename from WOKA/Assets/Assets.xcassets/Menu/HeartIcon.imageset/Contents.json rename to WOKA/Assets/Assets.xcassets/Home/HeartIcon.imageset/Contents.json diff --git a/WOKA/Assets/Assets.xcassets/Home/HeartIcon.imageset/icons8-heart.png b/WOKA/Assets/Assets.xcassets/Home/HeartIcon.imageset/icons8-heart.png new file mode 100644 index 0000000..35b0bea Binary files /dev/null and b/WOKA/Assets/Assets.xcassets/Home/HeartIcon.imageset/icons8-heart.png differ diff --git a/WOKA/Assets/Assets.xcassets/Home/HeartIcon.imageset/icons8-heart@2x.png b/WOKA/Assets/Assets.xcassets/Home/HeartIcon.imageset/icons8-heart@2x.png new file mode 100644 index 0000000..0452ebf Binary files /dev/null and b/WOKA/Assets/Assets.xcassets/Home/HeartIcon.imageset/icons8-heart@2x.png differ diff --git a/WOKA/Assets/Assets.xcassets/Home/HeartIcon.imageset/icons8-heart@3x.png b/WOKA/Assets/Assets.xcassets/Home/HeartIcon.imageset/icons8-heart@3x.png new file mode 100644 index 0000000..7521a70 Binary files /dev/null and b/WOKA/Assets/Assets.xcassets/Home/HeartIcon.imageset/icons8-heart@3x.png differ diff --git a/WOKA/Assets/Assets.xcassets/Home/HomeGrass.imageset/Contents.json b/WOKA/Assets/Assets.xcassets/Home/HomeGrass.imageset/Contents.json new file mode 100644 index 0000000..3496a3a --- /dev/null +++ b/WOKA/Assets/Assets.xcassets/Home/HomeGrass.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Shop@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WOKA/Assets/Assets.xcassets/Home/HomeGrass.imageset/Shop@3x.png b/WOKA/Assets/Assets.xcassets/Home/HomeGrass.imageset/Shop@3x.png new file mode 100644 index 0000000..75dd4f1 Binary files /dev/null and b/WOKA/Assets/Assets.xcassets/Home/HomeGrass.imageset/Shop@3x.png differ diff --git a/WOKA/Assets/Assets.xcassets/Home/HomeIcon.imageset/Contents.json b/WOKA/Assets/Assets.xcassets/Home/HomeIcon.imageset/Contents.json new file mode 100644 index 0000000..566802c --- /dev/null +++ b/WOKA/Assets/Assets.xcassets/Home/HomeIcon.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "HomeIcon.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "HomeIcon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "HomeIcon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WOKA/Assets/Assets.xcassets/Home/HomeIcon.imageset/HomeIcon.png b/WOKA/Assets/Assets.xcassets/Home/HomeIcon.imageset/HomeIcon.png new file mode 100644 index 0000000..d0eb7c9 Binary files /dev/null and b/WOKA/Assets/Assets.xcassets/Home/HomeIcon.imageset/HomeIcon.png differ diff --git a/WOKA/Assets/Assets.xcassets/Home/HomeIcon.imageset/HomeIcon@2x.png b/WOKA/Assets/Assets.xcassets/Home/HomeIcon.imageset/HomeIcon@2x.png new file mode 100644 index 0000000..9295692 Binary files /dev/null and b/WOKA/Assets/Assets.xcassets/Home/HomeIcon.imageset/HomeIcon@2x.png differ diff --git a/WOKA/Assets/Assets.xcassets/Home/HomeIcon.imageset/HomeIcon@3x.png b/WOKA/Assets/Assets.xcassets/Home/HomeIcon.imageset/HomeIcon@3x.png new file mode 100644 index 0000000..21cd672 Binary files /dev/null and b/WOKA/Assets/Assets.xcassets/Home/HomeIcon.imageset/HomeIcon@3x.png differ diff --git a/WOKA/Assets/Assets.xcassets/Home/WebSeries.imageset/Contents.json b/WOKA/Assets/Assets.xcassets/Home/WebSeries.imageset/Contents.json new file mode 100644 index 0000000..754d6f2 --- /dev/null +++ b/WOKA/Assets/Assets.xcassets/Home/WebSeries.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Web Series.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Web Series@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Web Series@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WOKA/Assets/Assets.xcassets/Home/WebSeries.imageset/Web Series.png b/WOKA/Assets/Assets.xcassets/Home/WebSeries.imageset/Web Series.png new file mode 100644 index 0000000..2a5bde9 Binary files /dev/null and b/WOKA/Assets/Assets.xcassets/Home/WebSeries.imageset/Web Series.png differ diff --git a/WOKA/Assets/Assets.xcassets/Home/WebSeries.imageset/Web Series@2x.png b/WOKA/Assets/Assets.xcassets/Home/WebSeries.imageset/Web Series@2x.png new file mode 100644 index 0000000..4c17540 Binary files /dev/null and b/WOKA/Assets/Assets.xcassets/Home/WebSeries.imageset/Web Series@2x.png differ diff --git a/WOKA/Assets/Assets.xcassets/Home/WebSeries.imageset/Web Series@3x.png b/WOKA/Assets/Assets.xcassets/Home/WebSeries.imageset/Web Series@3x.png new file mode 100644 index 0000000..d82ceb3 Binary files /dev/null and b/WOKA/Assets/Assets.xcassets/Home/WebSeries.imageset/Web Series@3x.png differ diff --git a/WOKA/Assets/Assets.xcassets/Menu/HeartIcon.imageset/icons8-heart.png b/WOKA/Assets/Assets.xcassets/Menu/HeartIcon.imageset/icons8-heart.png deleted file mode 100644 index 1fdee7e..0000000 Binary files a/WOKA/Assets/Assets.xcassets/Menu/HeartIcon.imageset/icons8-heart.png and /dev/null differ diff --git a/WOKA/Assets/Assets.xcassets/Menu/HeartIcon.imageset/icons8-heart@2x.png b/WOKA/Assets/Assets.xcassets/Menu/HeartIcon.imageset/icons8-heart@2x.png deleted file mode 100644 index 52e26c8..0000000 Binary files a/WOKA/Assets/Assets.xcassets/Menu/HeartIcon.imageset/icons8-heart@2x.png and /dev/null differ diff --git a/WOKA/Assets/Assets.xcassets/Menu/HeartIcon.imageset/icons8-heart@3x.png b/WOKA/Assets/Assets.xcassets/Menu/HeartIcon.imageset/icons8-heart@3x.png deleted file mode 100644 index c555e9f..0000000 Binary files a/WOKA/Assets/Assets.xcassets/Menu/HeartIcon.imageset/icons8-heart@3x.png and /dev/null differ diff --git a/WOKA/Assets/Assets.xcassets/Menu/HomeIcon.imageset/icons8-home.png b/WOKA/Assets/Assets.xcassets/Menu/HomeIcon.imageset/icons8-home.png deleted file mode 100644 index 4f230ed..0000000 Binary files a/WOKA/Assets/Assets.xcassets/Menu/HomeIcon.imageset/icons8-home.png and /dev/null differ diff --git a/WOKA/Assets/Assets.xcassets/Menu/HomeIcon.imageset/icons8-home@2x.png b/WOKA/Assets/Assets.xcassets/Menu/HomeIcon.imageset/icons8-home@2x.png deleted file mode 100644 index 572e462..0000000 Binary files a/WOKA/Assets/Assets.xcassets/Menu/HomeIcon.imageset/icons8-home@2x.png and /dev/null differ diff --git a/WOKA/Assets/Assets.xcassets/Menu/HomeIcon.imageset/icons8-home@3x.png b/WOKA/Assets/Assets.xcassets/Menu/HomeIcon.imageset/icons8-home@3x.png deleted file mode 100644 index fab0c05..0000000 Binary files a/WOKA/Assets/Assets.xcassets/Menu/HomeIcon.imageset/icons8-home@3x.png and /dev/null differ diff --git a/WOKA/Home/Controller/HomeVC.swift b/WOKA/Home/Controller/HomeVC.swift index 7a24286..6dbf080 100644 --- a/WOKA/Home/Controller/HomeVC.swift +++ b/WOKA/Home/Controller/HomeVC.swift @@ -9,10 +9,50 @@ import UIKit class HomeVC: UIViewController { + @IBOutlet weak var gradientView: UIView! + @IBOutlet weak var cloud2: UIImageView! + @IBOutlet weak var cloud1: UIImageView! + + var isMovingRight = false // Flag to track the direction of movement + override func viewDidLoad() { super.viewDidLoad() +// let color1 = #colorLiteral(red: 0.3490196078, green: 0.8156862745, blue: 0.9960784314, alpha: 1) +// let color2 = #colorLiteral(red: 0.6901960784, green: 0.2745098039, blue: 0.7568627451, alpha: 1) +// gradientView.applyGradient(colors: [color1, color2], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0.8, y: 0)) // Do any additional setup after loading the view. - customizeTabBarItemIconSize() +// customizeTabBarItemIconSize() +// moveIt(cloud2,10) + moveView() + } + + func moveView() { + UIView.animate(withDuration: 23, delay: 0, options: [.autoreverse], animations: { + if self.isMovingRight { + print("right") + self.cloud2.center.x += 140 // Move to the right + self.cloud1.center.x -= 140 // Move to the right + } else { + print("left") + self.cloud2.center.x -= 140 // Move to the left + self.cloud1.center.x += 140 // Move to the left + } + }, completion: { _ in + self.isMovingRight.toggle() // Toggle the direction for the next iteration + self.moveView() // Recursively call moveView to create a continuous animation + }) + } + + func moveIt(_ imageView: UIImageView,_ speed:CGFloat) { + let speeds = speed + let imageSpeed = speeds / view.frame.size.width + let averageSpeed = (view.frame.size.width - imageView.frame.origin.x) * imageSpeed + UIView.animate(withDuration: TimeInterval(averageSpeed), delay: 0.0, options: .curveLinear, animations: { + imageView.frame.origin.x = self.view.frame.size.width + }, completion: { (_) in + imageView.frame.origin.x = -imageView.frame.size.width + self.moveIt(imageView,speeds) + }) } // Define a function to customize tab bar item icon size diff --git a/WOKA/Home/Home.storyboard b/WOKA/Home/Home.storyboard index 9f1785a..10b1d65 100644 --- a/WOKA/Home/Home.storyboard +++ b/WOKA/Home/Home.storyboard @@ -404,6 +404,23 @@ + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + - + @@ -447,10 +491,15 @@ + + + + + - + @@ -589,13 +638,16 @@ + + - - + + + - + diff --git a/WOKA/OnBoarding Module/Controller/SplashVC.swift b/WOKA/OnBoarding Module/Controller/SplashVC.swift index 5905e12..732f9cd 100644 --- a/WOKA/OnBoarding Module/Controller/SplashVC.swift +++ b/WOKA/OnBoarding Module/Controller/SplashVC.swift @@ -29,11 +29,11 @@ class SplashVC: UIViewController { } @IBAction func languageBtnTapped(_ sender: UIButton) { -// let sb1 = UIStoryboard(name: "Home", bundle: nil) -// let vc1 = sb1.instantiateViewController(withIdentifier: "SideMenu") as! SideMenuController -// self.navigationController?.pushViewController(vc1, animated: true) -// -// return + let sb1 = UIStoryboard(name: "Home", bundle: nil) + let vc1 = sb1.instantiateViewController(withIdentifier: "SideMenu") as! SideMenuController + self.navigationController?.pushViewController(vc1, animated: true) + + return switch sender{ case hindiBtn: AuthFunc.shareInstance.languageSelected = .hindi diff --git a/WOKA/TabBar & SideMenu/TabBarVC.swift b/WOKA/TabBar & SideMenu/TabBarVC.swift index ce807e6..8233409 100644 --- a/WOKA/TabBar & SideMenu/TabBarVC.swift +++ b/WOKA/TabBar & SideMenu/TabBarVC.swift @@ -11,21 +11,43 @@ class TabBarVC: UITabBarController { var upperLineView: UIView! let spacing: CGFloat = 12 - + var customTabBarView = UIView(frame: .zero) + override func viewDidLoad() { super.viewDidLoad() self.delegate = self customizeTabBarItemFont() - UITabBar.appearance().tintColor = #colorLiteral(red: 0.0349480696, green: 0.0643344149, blue: 0.4407724142, alpha: 1) -// UITabBar.appearance().unselectedItemTintColor = #colorLiteral(red: 0.0349480696, green: 0.0643344149, blue: 0.4407724142, alpha: 1) - UITabBar.appearance().unselectedItemTintColor = #colorLiteral(red: 0.501960814, green: 0.501960814, blue: 0.501960814, alpha: 1) + // UITabBar.appearance().tintColor = #colorLiteral(red: 0.0349480696, green: 0.0643344149, blue: 0.4407724142, alpha: 1) + //// UITabBar.appearance().unselectedItemTintColor = #colorLiteral(red: 0.0349480696, green: 0.0643344149, blue: 0.4407724142, alpha: 1) + // UITabBar.appearance().unselectedItemTintColor = #colorLiteral(red: 0.501960814, green: 0.501960814, blue: 0.501960814, alpha: 1) + + self.setupTabBarUI() + self.addCustomTabBarView() } override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() - tabBar.frame.size.height = 95 - tabBar.frame.origin.y = view.frame.height - 95 + if hasTopNotch{ + tabBar.frame.size.height = 95 + tabBar.frame.origin.y = view.frame.height - 95 + }else{ + tabBar.frame.size.height = 80 + tabBar.frame.origin.y = view.frame.height - 80 + } + + } + + 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) + } + } } // function to set tab bar item font @@ -38,30 +60,82 @@ class TabBarVC: UITabBarController { } // 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: 4, left: 0, bottom: -8, right: 0) - } +// 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: 4, left: 0, bottom: -8, right: 0) +// } +// } +// } + + ///Add tabbar item indicator uper line + // func addTabbarIndicatorView(index: Int, isFirstTime: Bool = false){ + // guard let tabView = tabBar.items?[index].value(forKey: "view") as? UIView else { + // return + // } + // if !isFirstTime{ + // upperLineView.removeFromSuperview() + // } + // upperLineView = UIView(frame: CGRect(x: tabView.frame.minX + spacing, y: tabView.frame.minY + 0.1, width: tabView.frame.size.width - spacing * 2, height: 4)) + // upperLineView.backgroundColor = UIColor.systemPink + // tabBar.addSubview(upperLineView) + // } + + // MARK: Private methods + + private func setupCustomTabBarFrame() { + let height = self.view.safeAreaInsets.bottom + 64 + + var tabFrame = self.tabBar.frame + tabFrame.size.height = height + tabFrame.origin.y = self.view.frame.size.height - height + + self.tabBar.frame = tabFrame + self.tabBar.setNeedsLayout() + self.tabBar.layoutIfNeeded() + customTabBarView.frame = tabBar.frame + } + + private func setupTabBarUI() { + // Setup your colors and corner radius + self.tabBar.backgroundColor = UIColor.white + self.tabBar.layer.cornerRadius = 15 + self.tabBar.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] + self.tabBar.backgroundColor = .white + self.tabBar.tintColor = #colorLiteral(red: 0.0349480696, green: 0.0643344149, blue: 0.4407724142, alpha: 1) + self.tabBar.unselectedItemTintColor = #colorLiteral(red: 0.501960814, green: 0.501960814, blue: 0.501960814, alpha: 1) + + // Remove the line + if #available(iOS 13.0, *) { + let appearance = self.tabBar.standardAppearance + appearance.shadowImage = nil + appearance.shadowColor = nil + self.tabBar.standardAppearance = appearance + } else { + self.tabBar.shadowImage = UIImage() + self.tabBar.backgroundImage = UIImage() } } - ///Add tabbar item indicator uper line -// func addTabbarIndicatorView(index: Int, isFirstTime: Bool = false){ -// guard let tabView = tabBar.items?[index].value(forKey: "view") as? UIView else { -// return -// } -// if !isFirstTime{ -// upperLineView.removeFromSuperview() -// } -// upperLineView = UIView(frame: CGRect(x: tabView.frame.minX + spacing, y: tabView.frame.minY + 0.1, width: tabView.frame.size.width - spacing * 2, height: 4)) -// upperLineView.backgroundColor = UIColor.systemPink -// tabBar.addSubview(upperLineView) -// } - + private func addCustomTabBarView() { + self.customTabBarView.frame = tabBar.frame + + self.customTabBarView.backgroundColor = .white + self.customTabBarView.layer.cornerRadius = 30 + self.customTabBarView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] + + self.customTabBarView.layer.masksToBounds = false + self.customTabBarView.layer.shadowColor = UIColor.red.withAlphaComponent(0.8).cgColor + self.customTabBarView.layer.shadowOffset = CGSize(width: -4, height: -6) + self.customTabBarView.layer.shadowOpacity = 0.5 + self.customTabBarView.layer.shadowRadius = 20 + + self.view.addSubview(customTabBarView) + self.view.bringSubviewToFront(self.tabBar) + } } extension TabBarVC: UITabBarControllerDelegate { @@ -69,7 +143,7 @@ extension TabBarVC: UITabBarControllerDelegate { // Implement the tabBarController(_:didSelect:) method to handle tab changes func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) { // This method will be called whenever a tab is selected - // Do something based on the selected index + // Do something based on the selected index print("Selected tab index: \(tabBarController.selectedIndex)") if tabBarController.selectedIndex == 1{ @@ -92,3 +166,11 @@ extension TabBarVC: UITabBarControllerDelegate { return true } } + + +var hasTopNotch: Bool { + if #available(iOS 11.0, tvOS 11.0, *) { + return UIApplication.shared.keyWindow?.safeAreaInsets.top ?? 0 > 20 + } + return false +}