kodeco.com Forums

Learn to Code iOS Apps with Swift Tutorial 1: Welcome to Programming

Learn how to code iOS Apps with Swift in this free tutorial series for complete beginners!

This is a companion discussion topic for the original entry at https://www.raywenderlich.com/1577-learn-to-code-ios-apps-with-swift-tutorial-1-welcome-to-programming

Thanks a lot for sharing this! Your my IOS master !

Thank you for your teaching ,follow your tutorial it’s easy to learn:clap:

1 Like

Thanks so much! I’m glad it helped!

actually i am confused with if/else statement
i don’t know when and where we should use them can you explain it more briefly
and after writing
while(cokeleft > 0){
print(“you have (cokeleft) cokeleft.”)
why does it showing 5 cokeleft

i am learning programming for first time,i hope u understood my problem

In the string, you are directly referencing the variable cokeLeft by the following text: (cokeLeft).

Anything you put inside of () will be converted into a string. Try it yourself. Create a new variable and place it in a string using () so you can see the results.

If you have any other questions, feel free to shoot me an message.


the if/else statement is another problem i don’t know where to use them

Hi, is it normal for the results shown in the shaded window on the right to disappear?

Thanks. Love the tutorial. I am having lots of fun learning.

one of the lines in the “Break” from loop tutorial is out of place
the line: cokesLeft = cokesLeft -1
this line should be written after the “if” conditional.
as it is written now, there will be 5 cokes left and 4 fantas at end of program.
if this line is moved to after the if conditional then they will be even at 4