Learning Swift - Build a story App
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.
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.
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.
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.
Leave Learning Swift - Build a story App to:
Read more #education posts
Best Posts From tarekadam
We have not curated any of tarekadam's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From tarekadam
- Back to Hive after 3 years
- Journey to develop a Unity Game (1) - Blender Animation
- Journey to develop a Unity Platform game - Intro
- Altona Test-net Validator using Raspberry Pi4B 8 GB
- Did reddit just beat HIVE / STEEM in introducing smart media token?
- Staking ETH on Topaz Testnet
- Hive Community Action - Binance request ticket to enable Hive withdrawal
- Hive shopping cart coin
- 1# SwiftUI Tutorial - Change color app
- Hive community feedback needed - Would you use this app?