Swift Tutorial: if/else/else if and ternary operator

preview_player
Показать описание
In this Swift tutorial video we'll look at control flow using if, else, else if, and the ternary operator. We'll see how to direct the flow of your Mac program in an example containing Bitcoin and CheeseCoin prices.

We look at if statements with function calls in the statement, && (and) and || (or) operators, nested if statements, else if statements, one-line if statements, and the ternary operator.

00:00 Intro
00:12 Setting variables
00:56 First if statement
01:56 If with function call
03:30 && (and) operator
04:33 || (or) operator
05:57 Nested if statements
07:35 Else if statements
09:25 One-line if statements
10:30 Ternary operator
12:05 End

Subscribe for more content, as I will be creating more tutorial and how-to videos for coding in Swift, as well as longer tutorials on building macOS apps.

If you'd like to support my work to help me improve video quality and bring more content, please consider donating to my PayPal:

Thank you for watching!

Huge thank you to the channels below for helping me get started!
Uncreated Light Press
and

Mr. Macintosh
and

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

Thanks for watching, I hope you enjoy the tutorial - please post and questions, requests, or comments!

swift_goose
Автор

Looking forward to the tutorial on switch statements, thanks

etg
Автор

Thank you for the upload. I hope someone invents CheeseCoin soon

thewayasmr
Автор

THANKS.
is swift more or less similar to python syntax-wise?

Musaafir-lnfeet
Автор

i love your brilliant no fuss super clear videos

have recently had the 'epiphany', the information itself isn't (necessarily) 'difficult' it's the interpretation and presentation for others to interpret and implement, based on a million variables etc.

like you said @8:50 " you're code can become cluttered pretty quickly ", a truism that has taken me years to truly OVERstand/ comprehend 🤔💭

again

many thanks 🙌🤩🙌

'oldie' 🥸
(decades-long) beginner
edinburgh 🏰

benuchie