Learning Swift - Build a story AppsteemCreated with Sketch.

in education •  2 months ago

I completed the second code challenge on the Udemy iOS 11 Swift - Complete iOS App development Bootcamp video tutorial course and like to share the result with you.


App.gif

The App starts with a short story and 2 buttons that give the user two choices on how to continue. The user decision will influence the rest of the story. This challenge is using a quit simple story but I think with a bit of time this app could be build out to a nice full fledged story App.


Screen Shot 2018-09-09 at 22.21.41.png

Story structure from the Udemy course

The essential part in this app is to navigate through the storyline based on the choices the user makes. In order to know which button has been pressed, a "Tag" was assigned to the top (Tag number 1) and bottom (tag number 2) button. In addition to the button pressed, I had to add a story index variable that got updated once I reached a new part of the story. With this identifier in place I created an if /if else block that went to the various options. The important part was to add an AND condition to the IF blocks in order to navigate to the next story based on the choice the user made.


Screen Shot 2018-09-09 at 22.44.21.png

This challenge was a lot a fun and I learned how to display dynamic text on buttons as well as increase my knowledge with conditional statements.

I can't wait to get to the next challenge, once complete will share with you again.

All the best.


tarekadam.png

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

challenges only make anyone stronger great going keep learning :) all the best

·

Thank you, all the best to you too.

Posted using Partiko Android

Congrats bro, i'm serching video on youtube. 😁 I am interested in taking a course.

Thanks my friends @tarekadam, Your upvote is very good for me.

thank you so much for upvoting my post. i'm so glad

Thanks for sharing, @tarekadam.

Excellent learning is always great and learning coding comes handy anyday anytime :) keep learning and sharing

That desire, with which you study these lessons, says that you will get a wonderful developer, if you so choose.