The dark side. Image of Darth Vader
The dark side. Image of Darth Vader

When designing your user interface, did you know that your components can also adapt to dark mode when enabled? This is possible if running iOS 13 or above on your device.

What is dark mode?

If you are an Apple user and your device is running iOS 13 or later, you can choose to enable dark mode. This darkens the colour palette and the appearance of your device’s pages, buttons etc will have muted colours. Personally I prefer this, as it makes content rest easier on my eyes.

Default colours.

When setting colours for our UI design, the components will be set to use one of…


laptop displaying code
laptop displaying code

As defined by the swift docs, a protocol is a blueprint of methods, properties and other requirements that suit a particular task or piece of functionality. Protocols can be adopted by a class, structure and enumeration. Basically, a Protocol is a set of predefined rules that can be passed onto classes, structs and enums to follow.

Defining a protocol

We define a protocol in a similar way to what we have seen before when defining a class or other types. We use a keyword to indicate what we are defining. …


chain links
chain links

I love that you can commit and push changes to GitHub right from within Xcode. Trust Apple to keep you within their ecosystem, and their IDE! I decided to write the steps to remind myself on how to do it. I am also assuming that you have a GitHub account. If not, head over to GitHub and create one.

  1. When creating your new project in Xcode, ensure you check the box that creates a new GitHub repository before you hit that Create button. If you were too eager to begin your project and forgot to do this, click on the…

Classes and structs are available within the Swift language, but what are they and when would you use them?

Struct

A struct is short for structure and is used in Swift to group together a set of related data. This data is referred to as the properties of the struct. This could be an example of a person and the properties a person has.

Within a struct you can have functions, which are referred to as methods. Structs are immutable too, so once the properties are set they can’t really be changed. This can stop changes within your struct happening accidentally…


When I googled ‘magic numbers’ the first thing that popped up was the British pop band. But I’m afraid this is not what this post is about! I then specifically googled ‘magic numbers in swift’ and many questions popped up, so I thought this was a topic worth discussing. Although this isn’t specific to the Swift language, this post is relating to a swift application.

Firstly, what is a magic number, and why avoid them? A magic number is when you directly use a number (Int) in your code. Maybe the corner radius of a shape is set to 7.0…


Photograph of stairs
Photograph of stairs
Stairs going up

I’m not new to problems and trying to solve them, my previous career was in the live events industry so quite often these would happen in the worst possible moments, but I am new to code related problems. Often when hitting a wall with the issue I am facing, I have found these steps have helped get me back on track.

  1. My initial go-to is probably everyone’s favourite, Google. Someone at some point in their career will have no doubt had the same problem as you so more than likely you’ll find your answer here. When I do a Google…

Lego Stormtroopers
Lego Stormtroopers

Whether you want to see how another project is put together, or you are following a tutorial, at some stage you’re gonna want to clone a project in Xcode.

The good thing is there aren’t many steps, so it should be easy to remember!

  1. Firstly you want to open up the project page on github that you would like to clone. You should see a small row of three buttons reading ‘Go to file’, ‘Add file’ and lastly ‘Code’. If you click on this last button, you will see the link to which you will need to copy.

Ashley Oldham

Career changer but still a problem solver. New to Code and blogging my experiences with it. Hoping this helps both you and I learn!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store