Initial Commit
This commit is contained in:
84
WOKA/OnBoarding Module/ViewModel/SelectAgeVM.swift
Normal file
84
WOKA/OnBoarding Module/ViewModel/SelectAgeVM.swift
Normal file
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// SelectAgeVM.swift
|
||||
// WOKA
|
||||
//
|
||||
// Created by Bilal on 26/04/2024.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class SelectAgeVM{
|
||||
|
||||
weak var vc : SelectAgeVC!
|
||||
|
||||
func initData(){
|
||||
vc.underAgeView.roundCorner(radius: 25)
|
||||
vc.aboveAgeView.roundCorner(radius: 25)
|
||||
|
||||
// Add tap gesture recognizer to the view
|
||||
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(kid))
|
||||
vc.underAgeView.addGestureRecognizer(tapGesture)
|
||||
|
||||
// Add tap gesture recognizer to the view
|
||||
let tapGesture2 = UITapGestureRecognizer(target: self, action: #selector(adult))
|
||||
vc.aboveAgeView.addGestureRecognizer(tapGesture2)
|
||||
|
||||
vc.privacyLabel.text = "We Value Your Privacy".localized(loc: K.GVar.localized)
|
||||
vc.magicNoLabel.text = "16 IS THE MAGIC NUMBER".localized(loc: K.GVar.localized)
|
||||
vc.yearsLabel.text = "YEARS".localized(loc: K.GVar.localized)
|
||||
vc.iAmAboveLabel.text = "I AM".localized(loc: K.GVar.localized)
|
||||
vc.iAmUnderLabel.text = "I AM".localized(loc: K.GVar.localized)
|
||||
vc.underLabel.text = "UNDER".localized(loc: K.GVar.localized)
|
||||
vc.aboveLabel.text = "ABOVE".localized(loc: K.GVar.localized)
|
||||
vc.numberText.text = "16".localized(loc: K.GVar.localized)
|
||||
vc.underTextLabel.text = "We will need your parent’s email so they can verify and agree to create an account.".localized(loc: K.GVar.localized)
|
||||
vc.aboveTextLabel.text = "Above 16 users will be registered as a guardian with additional content.".localized(loc: K.GVar.localized)
|
||||
|
||||
self.vc.wokaLogoTopSpacing.constant = CheckPhoneHomeBtnOrNotch.shareInstance.topConstriant()
|
||||
}
|
||||
|
||||
@objc func kid() {
|
||||
// Apply click effect animation
|
||||
UIView.animate(withDuration: 0.1, animations: {
|
||||
self.vc.underAgeView.transform = CGAffineTransform(scaleX: 0.9, y: 0.9)
|
||||
}) { _ in
|
||||
UIView.animate(withDuration: 0.1) {
|
||||
self.vc.underAgeView.transform = .identity
|
||||
}
|
||||
}
|
||||
AuthFunc.shareInstance.userType = .kid
|
||||
pushToEmail()
|
||||
}
|
||||
|
||||
@objc func adult() {
|
||||
// Apply click effect animation
|
||||
UIView.animate(withDuration: 0.1, animations: {
|
||||
self.vc.aboveAgeView.transform = CGAffineTransform(scaleX: 0.9, y: 0.9)
|
||||
}) { _ in
|
||||
UIView.animate(withDuration: 0.1) {
|
||||
self.vc.aboveAgeView.transform = .identity
|
||||
}
|
||||
}
|
||||
AuthFunc.shareInstance.userType = .adult
|
||||
pushToEmail()
|
||||
}
|
||||
|
||||
private func pushToEmail(){
|
||||
let sb = UIStoryboard(name: K.StoryBoard.authenticationSB, bundle: nil)
|
||||
let vc = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Authentication.emailVC) as! EmailVC
|
||||
self.vc.navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extension String {
|
||||
|
||||
var localized: String {
|
||||
return NSLocalizedString(self, tableName: nil, bundle: Bundle.main, value: "", comment: "")
|
||||
}
|
||||
|
||||
|
||||
func localizedWithComment(comment:String) -> String {
|
||||
return NSLocalizedString(self, tableName: nil, bundle: Bundle.main, value: "", comment: comment)
|
||||
}
|
||||
}
|
||||
38
WOKA/OnBoarding Module/ViewModel/SplashVM.swift
Normal file
38
WOKA/OnBoarding Module/ViewModel/SplashVM.swift
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// 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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user