Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,971 questions

51,913 answers

573 users

How to assign multiple values to multiple variables in one line with Swift

1 Answer

0 votes
import Foundation

let (a, b, c, d, e) = (1, "Swift", 3.14, -2.0, -5)

print("\(a) \(b) \(c) \(d) \(e)")

print(type(of: a), type(of: b), type(of: c), type(of: d), type(of: e))



/*
run:

1 Swift 3.14 -2.0 -5
Int String Double Double Int

*/

 



answered Jul 14, 2025 by avibootz
...