I am trying to pass the instance of a created user onto to another view controller. The problem is the user that is passed over depends on type of user is selected. What I mean is I have created many sub-class of the main class User. So for example: Guest, VIP, Child etc and so when an instance is created on first page it is the sub class for that user that is created. I cannot get my head around how I pass the user to the second view controller without the second view controller user property being set to Type User. The problem is type User does not have all properties that sub classes have so in second page I am unable to access all properties that a sub class might have. This is example how I currently have it set:

**First screen / view controller**

```
var entrantData: People? 
var entrantSelected: EntrantType = .none

@IBAction func generatePass(_ sender: UIButton) {
    do{
switch entrantSelected {
        case .freechildguest: entrantData = try Child(dateOfBirth: "\(dobTextField.text!)")
        case .classicguest: entrantData = ClassicGuest()
        case .maintenance: entrantData = try Maintenance(NameAddress(firstName: firstNameTextField.text, lastName: lastNameTextField.text, streetAddress: streetAddressTextField.text, city: cityTextField.text, state: stateTextField.text, zipCode: zipCodeTextField.text, entrantType: .maintenance))
        default: break 
        }
} catch let error {
        showAlert(title: "Error", message: "\(error)")
}

}

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    if let destViewController = segue.destination as? TicketViewController {
        destViewController.dataFromForm = entrantData 
    }
}

```

**Second screen / view controller**

```
class TicketViewController: UIViewController {
var dataFromForm: People?

```

So in second View controller I now have the user data in dataFromForm but I want it to be in its sub class so I can get its properties that are only divided in its sub class. E.g. maintenance user has firstname property that child and classicGuest do not.

I suppose I could create all properties that sub class use in the User super class but I feel that defeats the point creating sub classes that have their own unique properties.