How to return multiple values from functions – Swift for Complete Beginners

preview_player
Показать описание
Other videos in the Functions section:

3. How to return multiple values from functions: This video

Рекомендации по теме
Комментарии
Автор

A bit of feedback for this episode...

I'm a few days ahead now, but I've repeatedly found myself wondering what the point of Tuples was.

After doing additional reading and watching back this video, I hadn't realised that a Tuple can hold multiple data types **at the same time**.

All of Paul's examples here return the same type of data.

Listening back, he does say that Tuples can contain multiple data types, but I didn't interpret that as "simultaneously".

He also mentions "name" & "age" in passing, but I didn't absorb that.

I've seen another example with the following which cleared it up for me:

let error = (code: statusCode, msg: errorString)

Which could for example hold 404 & "Page not found".

This may help somone else going forwards.

NathanBudd
Автор

i love how it seems at least to me that swift takes some of the better elements of javascript and python

asymmetrictechnologies
Автор

why doesn't getUser() take arguments outside of the function?

edgar_roca
Автор

Paul! This is video number 30 of yours for me in this playlist. I'm loving them all! Yet the portion on destructuring (8:20) proves your might as a teacher. 

If you had just written the ending syntax of how destructuring works, I wouldn't have understood. But you first showed the intermediate steps, when you said "here we're just moving data around" 8:20.

*Then* you showed the more complex syntax at 8:45. (line 30)

Thank you so much for taking your time and teaching like this. It makes learning so much easier. I can't imagine producing all these videos. Tons of work. Very very appreciative.

manwithllama
Автор

this is a little confusing, it all looks same to me :)

cagataycetinkol
Автор

hi paul.
when considering
time + space cumplexity.
shall the fool still pass tuple?
bye paul.

alexpascal
welcome to shbcf.ru