Lynda Course - Swift 5 Essential Thinking (Part 5)
Right! Back on it after several days away. Still struggling to get into some sort of routine. So I'm glad that I've managed to create a little bit of time now - around 40 minutes. Need to go over some of the last bit on closures before the next section... Start Time - 17:14 Type Aliasing OK, it was this bit to go over! typealias AttackTuple = (name: String , damage: Int , rechargeable: Bool ) var sunStriker: AttackTuple = ( "Bruce" , 4 , true ) I totally get the benefits of type alias. There is no initial value given to the AttackTuple. But the var of sunStriker does. func levelUpAttack(baseAttack: AttackTuple ) -> AttackTuple { let increasedAttack: AttackTuple = (baseAttack.name, baseAttack.damage + 10 , true ) return increasedAttack } levelUpAttack (baseAttack: sunStriker ) An example of how to use the AttackTuple as a type within a function....