Weekly iOS Code Challenge

by Chris Ching

Weekly code challenges. Hone your skills. Earn limited edition badges. Get prizes.

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.

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 (Dec 8 – Dec 14, 2017)

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:
Coming soon.


Previous Code Challenges

Challenge #3 badge
Challenge #3: Variations

Create a user interface that looks like the following:

Challenge 3 UI

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 badge
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 badge
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:

49 Shares
Share12
Tweet33
+1
Share
Pin
Buffer4