UIView, UIButton, UIControls, oh gosh!

Before we start

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

Keywords and Terminology

Class: An object that defines properties and methods in common
Subclass: A class that inherits from a superclass
Superclass: The class that is being inherited from

This article

I wrote an article about the SOLID principles, and mentioned that classes should be open for extension and closed for modification and written some articles about extensions in Swift . At the same time, I’ve written articles about subclassing UIView so which should be done and when?

Which should we use, Extension or Subclassing

It depends.

OK, that is the common…


Mix ’em up!

Roll on the next article!

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

Prerequisites:

Terminology

Storyboard: A visual representation of the User Interface of an Application
UITableViewCell: The visual representation of a single row in a table view
UIView: An object that manages the content for a rectangular area on the screen

The Problem

It would be great to have a UITableViewCell and…


MVP can be improved with coordinates. Of course.

Photo by Diana Polekhina on Unsplash

Difficulty: Beginner | Easy | Normal | Challenging

This article has been developed using Xcode 12.5, and Swift 5.4

If you’d like a video version of this, please do take a look!

Prerequisites:

Terminology

MVC: Model, View and Controller
MVP: Model, View and Presenter

In my Previous article describing the MVP architecture, I created the Presenter in the View.

Now…


Use the functions, but well

Before we start

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

The introduction

This project is intended to create a UITableViewCell in an entirely programmatic fashion. Read on to find out about this!

Prerequisites:

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

Load the ViewController

So in the SceneDelegate add the following:

which will load a simple UIViewController called ViewController.

Now we will need to delete the Storyboard…


Callbacks too!

Before we start

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

Prerequisites:

We can use SwiftUI views and view controllers in our existing UIKit applications. This can be useful, since there is a feeling (and it might only be a feeling) that many resources and development are moving towards UIKit. It might make sense to start your migration early, and begin to think about how you can make your code SwiftUI compatible.

The warning

SwiftUI can…


It works…

I previously wrote an article about the view drawing cycle, yet this turned out to be insufficient when I needed some help with shadows in a UITableViewCell subclass.

So I felt like more guidance should be out there around layoutSubviews. This article is the result of my investigation!

Before we start

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

Prerequisites

layoutSubview: A function containing code called when the view is resized

This article

The view lifecycle is…


Right in the cell!

I thought I’d make a project.

Can I play a video in a UICollectionViewCell? You know what? I can!

This is an article about how to do just that — but if you want a YouTube video I’ve got that for you too:

Before we start

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

Prerequisites:

  • You’ll need to either be able to write an iOS application or write some Swift code in Playgrounds
  • This article is self-contained, but you would benefit from having some experience producing a UICollectionView & UICollectionViewCell programmatically, as described…


Copy that stuff

A Repository in Swift

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

If you want to pass data around your App, more than likely you will need to use a Data Transfer Object (DTO) to do so. But how might this be used?

Read on to find out!

Prerequisites:

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

Terminology

Data Transfer Object (DTO): An object that carries data between processes.

The Source

From Martin Fowler, a domain model is an object model of the domain that incorporates both behavior and…


Wholly programatically?

Before we start

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

Prerequisites:

Subclassing: This is the act of basing a new class on an existing class

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

The project

This article will run through creating a UICollectionView programatically, with one version using aUICollectionViewCell and one using a subclassed UICollectionViewCell called SubclassedCollectionViewCell.

A Menu

This isn’t entirely part of this guide, however we will still…


Collaborate together!

Who is this be-hatted person?

Difficulty: Beginner | Easy | Normal | Challenging

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

Prerequisites:

  • You will be expected to be aware how to make a Single View Application in Swift.
  • This article references use of the Playground, although you could translate the tests to that Single View Application

Terminology

Adapter Pattern: allows the interface of an existing class to be used as another interface

Design Pattern: a general, reusable solution to a commonly occurring problem

Adapters allow one thing to work with another, like when a European electrical applicance needs to be used in the Americas…

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