Understand your Context

This article is supported by a YouTube video

One of the biggest warning signs in software development, is the use of jargon and acronyms within an organisation.

I worked for a firm in the UK, and they had an acronym for platform tickets. When asked, colleagues didn’t know what this acronym stood for (it really was best not to ask questions in that particular organisation).

This is a trivial example, but imagine that your code lacks such clarity that new Hires need multiple training sessions before their first Pull Request.

You know what, Uncle Bob thinks you should make sure you structure your code well. …


We might not always want to implement them!

Difficulty: Beginner | Easy | Normal| Challenging

This article has been developed using Xcode 11.5, and Swift 5.2.4

If you’d like a video version of this article, you can view this YouTube version of this article

Keywords and Terminology

Protocol: A blueprint on methods, properties and requirements to suit a piece of functionality

The problem

Protocols are great in Swift! Absolutely fantastic!

However you may want to use a protocol which has optional requirements — when you conform to a protocol only some of the functionality is required.

This would be great, as you should probably make more use of protocols than you currently are…


Isn’t this missing in the language?

Difficulty: Beginner | Easy | Normal | Challenging

This article has been developed using Xcode 11.5, and Swift 5.2.4

The accompanying video is at https://youtu.be/CCMMmmmGuuA

Keywords and Terminology

Array: an ordered series of objects which are the same type

The problem

It is possible to “run off the end” of an array. This means that that you can get a nasty runtime crash which will throw your user out of the nice iOS App experience that they had.


Deal if your JSON contains an array

Photo by Elizeu Dias on Unsplash

Difficulty: Beginner | Easy | Normal | Challenging

This article has been developed using Xcode 11.5, and Swift 5.2.4

If you prefer a video for this content, here that your option!

Prerequisites:

Terminology:

JSON: JavaScript Object Notation, a lightweight format for storing and transporting data

Decoding JSON

Decoding JSON is good, right?

I remember creating an article about Using Codable with Nested JSON and we can easily test JSON decoding yet it is missing…


Who are you, again?

Before we start

Difficulty: Beginner | Easy | Normal | Challenging

The opportunity

You know what, I’ve previously had a fun old time creating a Tip calculator in SwiftUI. Yes, there are some points for improvements (thanks all commenters on all my articles).

The completed project


Make sure your App Delegate can take care of it too!

Photo by Lefteris kallergis on Unsplash

A Service Oriented Architecture (SOA) is an architecture pattern that consolidates functionality and business logic in such a way that services can be injected into view controllers for use.

This type of architecture can leverage dependency injection as a means to achieve a clear separation of concerns.

Prerequisites:

You will be expected to be aware how to make a Single View Application, or a Playground to run Swift code

This article avoids Dependency Injection, but you should be aware of what that is, and make up your own mind whether that is relevant for your application.

Terminology:

AppDelegate: Effectively the root object…


You bet What is the @Published Property Wrapper? can!

VIDEO VERSION

Before we start

If you are writing functions, you might be asked whether the code is a pure function or not. You’ll need to know, and you’ll need to be able to describe what it is. In steps this guide to help you out.

Before we start

Difficulty: Beginner | Easy | Normal | Challenging

This article has been developed using Xcode 13, and Swift 5.5.

Keywords and Terminology

Idempotent: An operation that produces the same results if executed multiple times

Pure Function: A function where the return value is only determined by its input values, without observable side effects

The theory

A pure function does not produce any side effects…


They aren’t too hard!

If you’d prefer the video version — https://youtu.be/I6j-suUEOts

We can add enums within enums, or even within a Struct or a Class in order to make our software design come alive.

This article will take us through just that.

The example

During 2020 the UK experienced various lockdowns. During some of these the number of acceptable activities for people resident in the UK was limited.

Therefore I’ve created a example right here:

The issue

There isn’t a massive issue here. If you want to use these enum in various places within your module the default (internal) access control would not be an issue.

But what if you want (and you should)…


Marquee!

Before we start

Difficulty: Beginner | Easy | Normal | Challenging

This article has been developed using Xcode 13, and Swift 5.5.

Keywords and Terminology

UIButton: A control that responds to user interactions

UILabel: A view used by UIKit that displays on or more lines of text

This article

Background

Experimenting with user interfaces? That sounds like fun!

We should know that CABasicAnimation is a concrete representation of a CAAnimation.

The Project

I’ve created a project with several different animated buttons on them. They’re fantastic! If you want to take a closer look, I’d advise you take a look at the accompanying repo.

Adding a target to each of the buttons

Each of these buttons have been added to…


With a real example

Before we start

Difficulty: Beginner | Easy | Normal | Challenging

This article has been developed using Xcode 13, and Swift 5.5.

If you’d like to see a video version of this article, follow this link: https://youtu.be/ZurWIRpX_HA, all the code is in the GitHub repo

Keywords and Terminology

async/await: An alternative to completion handlers, a coroutine model that allows execution to be suspended and resumed
URLSession: The class and related classes proved an API for downloading data to and from endpoints indicated by URLs

This article

Background

I’ve got “Standard” use of URSession, using a view controller, view model and a closure to return the result.

Steven Curtis

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