fixed registeration issue for guardian
This commit is contained in:
@@ -113,7 +113,7 @@ class UserDetailsRegisterVC : UIViewController{
|
||||
|
||||
let sb = UIStoryboard(name: K.StoryBoard.authenticationSB, bundle: nil)
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ class UserIntrestVC: UIViewController {
|
||||
// }
|
||||
|
||||
// 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{
|
||||
let sb = UIStoryboard(name: K.StoryBoard.customAlerts, bundle: nil)
|
||||
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.CustomAlerts.alertCustomVC) as! AlertCustomVC
|
||||
@@ -105,7 +105,6 @@ class UserIntrestVC: UIViewController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Check for DOB.
|
||||
if AuthFunc.shareInstance.regData.birthdate == nil{
|
||||
let sb = UIStoryboard(name: K.StoryBoard.customAlerts, bundle: nil)
|
||||
|
||||
@@ -94,7 +94,7 @@ class SelectAvatarVM{
|
||||
/*
|
||||
Set UserType
|
||||
*/
|
||||
if createChildAccount != nil{
|
||||
if createChildAccount == true{
|
||||
AuthFunc.shareInstance.regData.user_type = "1"
|
||||
/*
|
||||
In Add child will be 1
|
||||
|
||||
@@ -28,16 +28,28 @@ class UserIntrestVM{
|
||||
/*
|
||||
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.maximumDate = Calendar.current.date(byAdding: .year, value: -16, to: Date())
|
||||
vc.boyText.text = "MALE".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{
|
||||
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.boyText.text = "BOY".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"
|
||||
@@ -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.roundCorner()
|
||||
|
||||
|
||||
// Add tap gesture recognizer to the view
|
||||
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(boyBtnTapped))
|
||||
vc.boyView.addGestureRecognizer(tapGesture)
|
||||
@@ -66,20 +77,6 @@ class UserIntrestVM{
|
||||
let tapGesture2 = UITapGestureRecognizer(target: self, action: #selector(girlBtnTapped))
|
||||
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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user