Simple Combine Publisher & Subscription for UIKit’s UITextField with MVVM and Unit Tests.

In a previous article I wrote about getting to know ReactiveCocoa 5, with MVVM and Unit Tests. The premise was a pretty basic login screen and provided a good jumping off point to see some uses of a reactive library.

Here we’ll take a similar approach, but with Combine and UIKit. While building a screen like this in SwiftUI is easy, you may already have an existing UIKit app that you want to introduce Combine too. Or even start replacing some RxSwift or ReactiveCocoa.

ReactiveCocoa provides continuousTextValues


Intro

Cards are an important part of mobile and web development. They allow us to group meaningful content or information together. When applications need to display large amounts of content to the user, Cards allow us to display it clearly and concisely and allow us to separate groups of information visually. It can help improve navigation in our applications, allowing the user to interact with either the Card or its contents in very customizable ways.

Two Cards with different numbers of Items

Cards can be deceivingly difficult to construct. In the screenshot above there are 4 distinct components.

  • Title text
  • Image and text
  • Text
  • Footer

Items can appear…


Ive wanted a basic, browser based todo list for a while. Something free of any distractions. Building this with Swift, and getting to know some of the libraries involved seemed like a great place to start.

This is a 4 part series outlining how to set up the project, getting started with routing, setting up the database and finally creating the model and controllers of our application. To see part 1 click here.

Introduction

In this final part, I will outline the project structure, the model, modelAPI and RouteController used in the app.

Models and Some Housekeeping

Ive decides to split my project up into…


Ive wanted a basic, browser based todo list for a while. Something free of any distractions. Building this with Swift, and getting to know some of the libraries involved seemed like a great place to start.

This is a 4 part series outlining how to set up the project, getting started with routing, setting up the database and finally creating the model and controllers of our application. To see part 1 click here.

Introduction

Our application will use a postgrSQL database, and a library called StORM to access it. …


Ive wanted a basic, browser based todo list for a while. Something free of any distractions. Building this with Swift, and getting to know some of the libraries involved seemed like a great place to start.

This is a 4 part series outlining how to set up the project, getting started with routing, setting up the database and finally creating the model and controllers of our application. To see part 1 click here.

Introduction

Now that we have a web server up and running, serving us text, lets see if we can get it to serve up some HTML. We’ll also…


Ive wanted a basic, browser based todo list for a while. Something free of any distractions. Building this with Swift, and getting to know some of the libraries involved seemed like a great place to start.

This is a 4 part series outlining how to set up the project, getting started with routing, setting up the database and finally creating the model and controllers of our application.

Introduction

Part 1 will outline a basic project setup including using swift package manager, and get us started using Swift to return some text in the response from the server.

Project setup

To start, lets make…


Introduction

In trying to get to know the new ReactiveCocoa 5 framework, I decided to take the Ray Wenderlich tutorial (here) and rewrite it with swift and RAC 5.

If you haven’t read it, I would highly suggest diving in. Its a fun tutorial and it gives a better introduction to ReactiveCocoa than I ever could.

This was also an opportunity to rewrite the starter application architecture to follow the MVVM pattern and tackle some unit tests with an application heavily dependent on RAC 5. I also decided to use PureLayout to build my views in code to avoid storyboards.

Tools Used

MVVM…

HammyAssassin

A surfer and a swimmer making his way as an iOS Developer.

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