Countdown Timer
Applying what you’ve learned about Swift and StoryBoards, then pushing yourself to do some problem-solving and research, you are going to build a countdown timer!
You may have seen these before:
- countdown to graduation
- countdown to a vacation
- countdown to you see your best friend again
Must-Haves
- An event or big day to count down to
- A fun UI relevant to your event or big day
- A countdown in days (but could go down to the minute and even second!)
Tips
- You will need to utilize the Swift 4
Date()
class - You will need to utilize Swifts
Timer.scheduledTimer
class and function - You will probably have to do some work with around converting numbers to strings, and vice versa
- You will probably have to split apart strings
Here’s an example:
Iteration 1 - Wireframe & Vision
- Decide on the event or big day you will count down to.
- Draw out your vision for the way your Countdown Timer will look
- Find your inspiration! Create a folder on your desktop that you can save images/icons to as you find ones you like. Also, decide on any colors and fonts you’d like to use. FlatIcon is a great, free resource. Make sure you give credit to the artists, if necessary.
- Make sure your wireframe and assets are approved by your instructor before moving on.
Notice: you haven’t written any code in Xcode yet. The planning process is extremely important and professional developers spend a lot of time in this phase.
Iteration 2 - Research and Pseudo-Code
- Psuedo-code or whiteboard the Swift code that will need to be in place to make your timer work.
- What objects elements will you need outlets/actions for?
- How often will it “tick”?
- How will you get ahold of today’s date to compare it to the date in the future?
- Hint: The tips above give you some starting points on what to research.
- Play around in a Playground or with some
print()
statements to get familiar with the new tools/technologies you need to complete this project.
Iteration 3 - Implement JavaScript
- Write the code necessary to get your timer working!
Iteration 4 - Deploy
- Create a GitHub repository
- Commit and push your work