how to read these three type of data on swift I want to assign these three variables to labels. How do I do it?


    class Student{
        let nubmers: [phone_number]? 
        let bday: DOB?
        let gender: Gender?

        init(numbers:[phone_number],bday:DOB, gender:Gender){
            self.nubmers = []
            self.bday = bday
            self.gender = gender

enum Gender{
    case Male
    case Female
    case Unspecific


import Foundation
    struct phone_number {
        var number:String!


import Foundation

struct DOB {
    let year:Int!
    let month:Int!
    let day:Int!

insert data like this? Is it correct?

let student1 = Student(
            numbers: [phone_number(number: "0773024962")],
            bday: DOB(year:1996,month:01,day:13),
            gender: Gender.Male)

I want to read like this //Error

func setStudent(student: Student){
        label.text = numbers.number
        label.text = student.bday
         label.text = student.gender

Related posts

Recent Viewed