Implementing the UITableView with a Storyboard

Image for post
Image for post
Image of the completed project

This is a project that will help us to create a list of names as an iOS application. This article has been developed using Xcode 12.2, and Swift 5.3

If you want a video guide, I’ve got you covered! Also please do download the full code from the repo and read / watch along!

Create a New Project

Use Xcode’s menu to create a new project, making sure to choose Swift as the language and using UIKit. detailled guide

Add the Code

Replace the code in ViewController.swift with the following:

Add a UITableView instance to the Storyboard

Go to Main.storyboard

Press the plus (+) sign at the top of the Xcode window there is a plus (+) sign. …


Publisher, Subscriber, Operators and Subjects

Image for post
Image for post
Photo by Paweł Czerwiński on Unsplash

No matter your coding background, you will need to get to grips with some of the core concepts of Combine, what it does and how to perform some programming tasks in the same.

This article is here to help you!

What is Combine?

Combine is about what to do with values over time, including how they can fail.

Image for post
Image for post

This means that Combine uses many of the functional reactive concepts that are used by RxSwift (if you are familiar with that), but is Apple’s implementation is baked-in to the iOS SDK meaning it has the advantages of Swift, being type-safe and usable with any asynchronous API. …


That is, disjoint sets

Image for post
Image for post
Image by Giorgio Trovato

Before we start

Difficulty: Beginner | Easy | Normal | Challenging
This article has been developed using Xcode 12.1, and Swift 5.3

Prerequisites

* You will be expected to be aware how to either make a Single View Application in Swift or use a Playground
* It would be useful to have some knowledge of Sets in Swift
* A dictionary is used to store the nodes

Keywords and Terminology

Data Structure: A way of formatting data Disjoint: (of two or more sets) having no elements in common

Union-find data structure: A data structure that sorts a collection of disjoint sets

The Union-Find Data

The background

Disjoint-set data structures play a key role in an efficient version of Kruskal’s algorithm for finding the minimal spanning tree of a graph, and the data structure form the basis of a wide variety of algorithms including cycle detection. …


Surprisingly Easy

Image for post
Image for post
Image by A Million Lanterns

This article is about the 4 challenges in the LeetCode Weekly Contest 216. That is

  • 1662 Check If Two String Arrays are Equivalent
  • 1663 Smallest String With A Given Numeric Value
  • 1664 Ways to Make a Fair Array
  • 1665 Minimum Initial Energy to Finish Tasks The solutions assume some knowledge of Big O notation

The Problems

Each problem will be approached in turn, with a solution and also with articles explaining the tools, techniques and theory that will help you solve these problems yourself.

Let us get started!

1662 Check If Two String Arrays are Equivalent

This task is worth three points — so we would not expect this to be too difficult. …


Seeing changes

Image for post
Image for post

Images by Chewy Pets Bringing us Together

Before we start

Difficulty: Beginner | Easy | Normal | Challenging
This article has been developed using Xcode 12.2, and Swift 5.3

Prerequisites

You will be expected to be aware how to either make a Single View Application in Swift or use a Playground

Keywords and Terminology

Property Observers: Change and respond to changes in a property value. In Swift this is through didSet and willSet.

This article

Background

I’ve previously written an article about properties in Swift, which covers stored, computed and lazy properties.

This article on the other hand covers Property Observers, and it is about time that I did just that. …


Using the American spelling

Image for post
Image for post
Photo by Jonathan Hanna

Difficulty: Beginner | Easy | Normal | Challenging
This article has been developed using Xcode 12.1, and Swift 5.3

Prerequisites

Extension: Extensions add new functionality to a class, struct, enum or protocol

Override: The process in which a subclass changes a method, property or type in the parent class Protocol: A blueprint on methods, properties and requirements to suit a piece of functionality

UIViewController: A view controller is an intermediary between the views it manages and the data of your app

Break down!

The principle here is that we are trying to break view controllers up — which essentially is attempting to make iOSs UIViewControllers more closely follow the Single Responsibility Principle. …


That is, so it works

Image for post
Image for post
Image by Gary Bending @kris_ricepees

Before we start

Difficulty: Beginner | Easy | Normal | Challenging
This article has been developed using Xcode 12.2, and Swift 5.3

Prerequisites

  • You will be expected to be aware how to either make a Single View Application in Swift or use a Playground
  • This article uses the Storyboard to implement the UITableView, and then creates the UITableViewCell programmatically

Keywords and Terminology

IndexPath: The path to a specific node in a tree of nested array collections

UICollectionView: An object that manages an ordered collection of data items and presents them using customizable layouts

UICollectionViewCell: The on-screen cell for the UICollectionView type

UITableView: A view that presents data using rows arranged in a single…


Open and half-open?

Image for post
Image for post
Image by Silas Baisch @silasbaisch

Before we start

Ranges are extremely useful when you produce Swift applications as they allow you to select a range (that is, a subset of an existing) type.

Difficulty: Beginner | Easy | Normal | Challenging This article has been developed using Xcode 12.1, and Swift 5.3

Prerequisites


Great layouts!

Image for post
Image for post

Photo by John Towner @heytowner

Difficulty: Beginner | Easy | Normal | Challenging
This article has been developed using Xcode 12.1, and Swift 5.3

Prerequisites:

Terminology

Constraints: A constraint on the layout of a view

Storyboard: A way to graphically layout the UI in Xcode

Removing the Storyboard

Although this isn’t really part of this tutorial (there is a full guide on this here but essentially you can select Main.storyboard in the project…


Improve your user experience

Image for post
Image for post
Diagram by Steven Curtis

Unusually for one of these articles I’ve presented two separate Projects within the repo

Difficulty: Beginner | Easy | Normal | Challenging
This article has been developed using Xcode 12.1, and Swift 5.3

Prerequisites:

- You will be expected to be aware how to make a Single View Application in Swift

- One of the implementations assumes you can create a UIViewController programmatically

- The concepts described here are the same as those covered in stacks

Terminology

Stack: A data structure used to store objects Storyboard: A way to graphically layout the UI in Xcode UINavigationBar: A bar containing buttons for navigating within the hierarchy of screens UINavigationController: A container that stores view controllers in a…

About

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