fixed registeration issue for guardian

This commit is contained in:
2024-08-27 19:21:17 +05:30
parent 27bfd6f032
commit 34889292e8
4 changed files with 16 additions and 20 deletions

View File

@@ -113,7 +113,7 @@ class UserDetailsRegisterVC : UIViewController{
let sb = UIStoryboard(name: K.StoryBoard.authenticationSB, bundle: nil) let sb = UIStoryboard(name: K.StoryBoard.authenticationSB, bundle: nil)
let vc = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Authentication.userIntrestVC) as! UserIntrestVC let vc = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Authentication.userIntrestVC) as! UserIntrestVC
// vc.vm.createChildAccount = true vc.vm.createChildAccount = self.vm.createChildAccount ?? false
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
} }

View File

@@ -90,7 +90,7 @@ class UserIntrestVC: UIViewController {
// } // }
// Check for Intrest. // Check for Intrest.
if AuthFunc.shareInstance.userType == .kid || vm.createChildAccount != nil{ if AuthFunc.shareInstance.userType == .kid || vm.createChildAccount == true{
if AuthFunc.shareInstance.regData.interest_topic_id == nil || AuthFunc.shareInstance.regData.interest_topic_id?.count == 0{ if AuthFunc.shareInstance.regData.interest_topic_id == nil || AuthFunc.shareInstance.regData.interest_topic_id?.count == 0{
let sb = UIStoryboard(name: K.StoryBoard.customAlerts, bundle: nil) let sb = UIStoryboard(name: K.StoryBoard.customAlerts, bundle: nil)
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.CustomAlerts.alertCustomVC) as! AlertCustomVC let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.CustomAlerts.alertCustomVC) as! AlertCustomVC
@@ -105,7 +105,6 @@ class UserIntrestVC: UIViewController {
} }
} }
// Check for DOB. // Check for DOB.
if AuthFunc.shareInstance.regData.birthdate == nil{ if AuthFunc.shareInstance.regData.birthdate == nil{
let sb = UIStoryboard(name: K.StoryBoard.customAlerts, bundle: nil) let sb = UIStoryboard(name: K.StoryBoard.customAlerts, bundle: nil)

View File

@@ -94,7 +94,7 @@ class SelectAvatarVM{
/* /*
Set UserType Set UserType
*/ */
if createChildAccount != nil{ if createChildAccount == true{
AuthFunc.shareInstance.regData.user_type = "1" AuthFunc.shareInstance.regData.user_type = "1"
/* /*
In Add child will be 1 In Add child will be 1

View File

@@ -28,16 +28,28 @@ class UserIntrestVM{
/* /*
Setting the minimum and maximum date as per user type Setting the minimum and maximum date as per user type
*/ */
if AuthFunc.shareInstance.userType == .adult && createChildAccount == nil{ if AuthFunc.shareInstance.userType == .adult && createChildAccount == false{
vc.datePicker.minimumDate = Calendar.current.date(byAdding: .year, value: -150, to: Date()) vc.datePicker.minimumDate = Calendar.current.date(byAdding: .year, value: -150, to: Date())
vc.datePicker.maximumDate = Calendar.current.date(byAdding: .year, value: -16, to: Date()) vc.datePicker.maximumDate = Calendar.current.date(byAdding: .year, value: -16, to: Date())
vc.boyText.text = "MALE".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) vc.boyText.text = "MALE".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue)
vc.GirlText.text = "FEMALE".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) vc.GirlText.text = "FEMALE".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue)
/*
If user type is adult then no need to show intrest
*/
self.vc.intrestStackView.isHidden = true
self.vc.selectAsManyYouWant.isHidden = true
}else{ }else{
vc.datePicker.minimumDate = Calendar.current.date(byAdding: .year, value: -16, to: Date()) vc.datePicker.minimumDate = Calendar.current.date(byAdding: .year, value: -16, to: Date())
vc.datePicker.maximumDate = Calendar.current.date(byAdding: .year, value: -3, to: Date()) vc.datePicker.maximumDate = Calendar.current.date(byAdding: .year, value: -3, to: Date())
vc.boyText.text = "BOY".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) vc.boyText.text = "BOY".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue)
vc.GirlText.text = "GIRL".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) vc.GirlText.text = "GIRL".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue)
/*
If user type is child get the intrest and show all
*/
setupCell()
getIntrests()
} }
vc.fullName.text = (AuthFunc.shareInstance.regData.full_name != nil && AuthFunc.shareInstance.regData.full_name != "") ? AuthFunc.shareInstance.regData.full_name : "Guardian" vc.fullName.text = (AuthFunc.shareInstance.regData.full_name != nil && AuthFunc.shareInstance.regData.full_name != "") ? AuthFunc.shareInstance.regData.full_name : "Guardian"
@@ -57,7 +69,6 @@ class UserIntrestVM{
vc.nextBtn.applyGradient(colors: [color1, color2], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0.8, y: 0)) vc.nextBtn.applyGradient(colors: [color1, color2], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0.8, y: 0))
vc.nextBtn.roundCorner() vc.nextBtn.roundCorner()
// Add tap gesture recognizer to the view // Add tap gesture recognizer to the view
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(boyBtnTapped)) let tapGesture = UITapGestureRecognizer(target: self, action: #selector(boyBtnTapped))
vc.boyView.addGestureRecognizer(tapGesture) vc.boyView.addGestureRecognizer(tapGesture)
@@ -66,20 +77,6 @@ class UserIntrestVM{
let tapGesture2 = UITapGestureRecognizer(target: self, action: #selector(girlBtnTapped)) let tapGesture2 = UITapGestureRecognizer(target: self, action: #selector(girlBtnTapped))
vc.girlView.addGestureRecognizer(tapGesture2) vc.girlView.addGestureRecognizer(tapGesture2)
if AuthFunc.shareInstance.userType == .adult && createChildAccount == nil{
/*
If user type is adult then no need to show intrest
*/
self.vc.intrestStackView.isHidden = true
self.vc.selectAsManyYouWant.isHidden = true
}else{
/*
If user type is child get the intrest and show all
*/
setupCell()
getIntrests()
}
/* /*
Setup Gender Stack for selection Setup Gender Stack for selection
*/ */