I am begging to learn swift and I bought an app on the appStore called CODESWIFT for $5. I thought it'd be a nice easy way to start with the language, get familiar with the new ways of naming things and so on... On one of the exercises, the app has you creating these few variables and combining them to print to the console:
var company = "Apple"
let yearFounded = 1976
var str = "was founded in "
print(company + str + yearFounded)
"binary operator '+' cannot be applied to operands of type 'String' and 'Int'
That's definitely not how to do it. These all work:
var company = "Apple" let yearFounded = 1976 var str = "was founded in" print("\(company) \(str) \(yearFounded)") print(company + " " + str + " " + String(yearFounded)) print(company, str, yearFounded) // three times "Apple was founded in 1976"