Weekly iOS Code Challenge
Chris C
24 Nov 2017
How To Submit Your Solution
All code challenge submissions will be done via Twitter.
– Send me a tweet telling me you’ve completed the challenge.
– Make sure you get my attention by mentioning my Twitter handle, @CodeWithChris.
– Attach a photo or video of your working solution to your Tweet.
– PS. If it’s a debugging challenge, don’t post the solution or else you’ll spoil the fun for others!
At the end of the deadline, I’ll award the badges and prizes (coming soon) and reply to your tweet to let you know when it’s happened.
Also, every week there’ll be a new Reddit thread where you can get help with the code challenge.
This Week’s iOS Code Challenge (Jan 5, 2018 to Jan 11, 2018)
Challenge #5: The Mystery Card
Download the project below and run the app in the simulator. Scroll to the bottom of the collection view and notice that there are 17 cards.
There should only be 16!
Use your debugging skills to find out why there is 17 cards and fix it!
PS. Please don’t post the solution when you submit it or else it’ll spoil the challenge. Just post a screenshot of your collection view with no extra card 🙂 Thank you!
Starter Code:
Download the starter project
Hints:
– The necessary skills are taught here:
Xcode Debugging Tools
If you need help:
The Reddit thread for this week’s coding challenge
Badge Earners:
Coming soon
Previous Code Challenges

Challenge #4: The Library Challenge
Download the playground below and follow the instructions for the challenge. You’ll be asked to write the code for several functions to get the expected output in the Playground console.
Starter Code:
Download the starter playground
Hints:
– The necessary skills are taught here:
Build Your Swift Skills – Lesson 6 – Dictionary
Build Your Swift Skills – Lesson 7 – Loops
If you need help:
The Reddit thread for this week’s coding challenge
Badge Earners:

Challenge #3: Variations
Create a user interface that looks like the following:
Hints:
– Try size class specific constraints as shown here.
– The portrait version of this UI was built in Lesson 2.
– Here’s the project we built in that lesson: Xcode Project
If you need help:
The Reddit thread for this week’s coding challenge
My solution:
Xcode project
Badge Earners:

Challenge #2: Eh?
Open up a new Playground and write a function that satisfies the following requirements:
– Accepts a String parameter
– Returns an Int based on the total number of letter “a” or “A”s in the string that gets passed in.
– If the String parameter has no “a” or “A”s, then return 0.
For example:
– Passing in the string, “Radar”, should return 2.
– Passing in the string, “Hello, should return 0.
Hints:
– You can treat the String like an array.
– The String class has some useful functions. Make sure you check them out!
If you need help:
The Reddit thread for this week’s coding challenge
My solution:
Xcode project
Badge Earners:

Challenge #1: Four Quads
Build an app user interface that meets the following requirements:
– Divides the screen into 4 equal quadrants.
– In each quadrant, display an image (can be any image).
– Must work in both portrait and landscape orientations.
My solution:
Xcode project
Badge Earners: