Two More Examples of Clean Architecture

I recently found two more examples of Clean Architecture.

The first one is called CosyHome and is an example iOS application for a home heating system developed using Clean Architecture and developed with Acceptance Test Driven Development (ATDD) using Fitnesse. Fitnesse is something I’d like to dive more into and could be a future post. Let me know if you’re interested. You can find CosyHome here.

The other example is CleanNote that applies Clean Architecture to an iOS and Mac application. You can find that one here.

The Clean Architecture: An Example

Today, I’d like to take an example iOS app written with an MVC architecture and show you what the example would be with a Clean Swift architecture. The example I’ve chosen to use is the Quiz app from chapter 1 of the 3rd edition of iOS Programming: The Big Nerd Ranch Guide.

The Quiz is a simple app that is like flash cards. It looks like this:

The Show Answer button will reveal the answer to the question and tapping on the Next Question button will display the next question.

The MVC Example

Click here to download the source code for the MVC version from Big Nerd Ranch’s site. The code is actually from the 6th edition.

Let’s look at the relevant code. Here’s the code for the view controller, ViewController.swift: Continue reading →

The Clean Architecture: An Introduction

In the last post, I talked about various architectures used as alternatives to MVC, in a attempt to solve MVCs problems, such as Massive View Controller.

In this post, I would like to introduce you to another architecture, which seems to me to be the best starting point for your app’s architecture: the Clean Architecture.

Continue reading →