class Person {
var firstName: String?
var middleName: String?
var lastName: String?
var fullName: String {
get {
return ("\(firstName) \(middleName) \(lastName)")
}
}
init (firstName: String, middleName: String, lastName: String) {
self.firstName = firstName
self.middleName = middleName
self.lastName = lastName
}
}
var person1 = Person(firstName: "23123 ", middleName: " 123123", lastName: "123123 ")
когда мы вызываем person1.fullName нам приходит Optional("23123 ") Optional(" 123123") Optional("123123") нужно не опциональный как это правильно сделать в классе