Do you write the code like this in SWIFT?

Member

sadie.beer

by sadie.beer , in category: Swift , 2 months ago

Do you write the code like this in SWIFT? 😃

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class AccountItem {
    
    var companyName: String
    let name: String
    let number: String
    let balance: String?

    
    init(_ companyName: String, _ name: String, _ number: String, _ balance: String?, showCompanyName: Bool?) {
      
        if(showCompanyName == true){
            self.companyName = companyName
        }
        else
        {
            self.companyName = ""
        }
        self.name = name
        self.number = number
        self.balance = balance

    }
}


Facebook Twitter LinkedIn Telegram Whatsapp Pocket

no answers