This app demonstrates iOS-development techniques.

Related tags

Layout CatFancy
Overview

CatFancy

GitHub Stars GitHub closed issues Twitter cat


Introduction

CatFancy is an iOS app that demonstrates iOS-development techniques. Users can browse breeds of cats with images from various sources and breed info from Wikipedia. I created CatFancy to accompany a blog post about iOS-developer coding challenges.

Build Tools & Versions Used

I developed CatFancy using Xcode 14.1 Beta 3, iOS 16.1, SwiftLint 0.30.1, and this song.

Discussion

Aside from meeting requirements that are typical of this sort of coding challenge, my emphases in CatFancy are using a technique, dependency injection, and an architectural pattern, the coordinator, that facilitate unit testing. I have come to value unit testing because, as Jon Reid observed, a "robust suite of unit tests acts as a safety harness, giving you courage to make bold changes." In nuts-and-bolts terms, dependency injection makes objects testable by isolating dependencies and side effects. I have written elsewhere on dependency injection. The coordinator pattern makes UIViewControllers more testable by removing from them the work of navigating to other UIViewControllers, whether in the app itself or in external apps. CatFancy's unit-test coverage is 88.5%.

CatFancy demonstrates two new Swift features, if let shorthand and async/await concurrency.

Although the breed-list screen, implemented primarily in BrowseBreedsVC and BrowseBreedsView, is the only screen whose implementation a take-home programming assignment typically requires, I chose to implement two additional screens. I wanted to give the user, the reviewer, the ability to choose different JSON files for display and different sort orders for the breeds. The settings screen, implemented in SettingsVC and SettingView, resulted. I wanted to give the user the ability to see information that cannot be displayed in the breed list. The details screen, implemented in BreedDetailVC and BreedDetailView, resulted. This screen shows walls of text about breeds and allows the user to view the breeds' Wikipedia pages and photo licenses in Safari. The settings and details screens exercise the coordinator pattern to an extent that the browsing screen, acting alone, could not.

CatFancy supports iPhone, iPad, landscape orientation, portrait orientation, Light Mode, and Dark Mode. I developed CatFancy primarily for iPhone. iPad would benefit from, for example, higher information density in breed rows. Landscape orientation on iPhone would be more idiomatic if it used UISplitViewController like Mail does. Due to time constraints that are characteristic of coding challenges, CatFancy may imperfectly support VoiceOver, but accessibility is important to me.

In both professional and side-project apps, I use color palettes from designers or the website Coolors. In CatFancy, I relied on system-provided colors due to time constraints.

The breeds fit perfectly the dainty iPhone SE form factor. If some breed info ended up not fitting in a BreedCell, tweaks would be in order. MarqueeLabel, a UILabel replacement that has performed well in RaceRunner, would obviate the need for either String truncation or widespread UI changes. Dynamic Type, which I did not test due to time constraints, might also necessitate tweaks.

Coding challenges typically do not state a requirement for internationalization or localization so, in the interest of time, I did not wrap user-facing Strings in NSLocalizedString(). I am, however, comfortable with that API.

Warning

If you run CatFancy in the simulator, as I did during development, you may see the following warning:

[plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x6000001ad4a0> F8BB1C28-BAE8-11D6-9C31-00039315CD46

My research indicates that this warning is harmless. I expect Apple to fix it in a future version of Xcode and iOS.

Screenshots

Browsing Details
Settings Splash

Credits

Christy Presler created the app icon and released it under the CC BY-SA 3.0 license.

Sound Jay created the chime and sad-trombone sounds and "allow[s] ... incorporat[ion of these sounds] into ... projects, be it for commercial or non-commercial use." Sound Jay "and its licensors retain all ownership rights to the sound files".

The humorous badges at the top of this readme are from my curated list of iOS-development podcasts.

Settings.swift and the GetterSetter files reflect an approach to storing and retrieving settings that I developed for Immigration and also use in Racerunner (GitHub), Conjugar (GitHub), and Conjuguer (GitHub).

RealSoundPlayer.swift reflects an approach to playing sounds that I developed for Immigration and also use in RaceRunner, Conjugar, and Conjuguer, though I added dependency injection to CatFancy's implementation because playing a sound is a side effect, I realized, that is undesirable in unit tests.

UIViewControllerExtensionTests.swift contains code I developed for Conjugar.

Doug Suriano shared the boilerplate-reduction technique in NSLayoutConstraintExtension.swift.

Antoine van der Lee shared the boilerplate-reduction technique in UsesAutoLayout.swift.

Point-Free developed and evangelized CatFancy's approach to dependency injection, The World.

Paul Hudson shared the approach to dependency injection for URLSession used in URLProtocolStub.swift and URLSessionExtension.swift.

Soroush Khanlou developed the coordinator pattern that CatFancy uses for navigation. Two posts by Paul Hudson also informed CatFancy's implementation.

Geoff Hackworth shared the technique of bespoke app/scene delegates for unit tests exemplified by TestingRootViewController.swift, TestingAppDelegate.swift, TestingSceneDelegate.swift, and main.swift, building on a technique shared by Jon Reid.

You might also like...
ARSpaceStation - A minimal AR iOS App that shows the International Space Station (ISS) in real scale
ARSpaceStation - A minimal AR iOS App that shows the International Space Station (ISS) in real scale

AR Space Station This is a minimal AR iOS app that shows the International Space

Tinylog is a minimal TODO App for iOS (iPhone/iPad).

Tinylog-iOS Tinylog is a minimal TODO App for iOS (iPhone/iPad). Download on the App Store Setup $ git clone https://github.com/sger/Tinylog-iOS $ cd

LinkedIn-Profile - UI of Android LinkedIn App Profile Page  in iOS SwiftUI
LinkedIn-Profile - UI of Android LinkedIn App Profile Page in iOS SwiftUI

LinkedIn-Profile UI of Android LinkedIn App Profile Page in iOS SwiftUI Sample I

SwiftLanguageWeather-master - Swift Language Weather is an iOS weather app developed in Swift 4
SwiftLanguageWeather-master - Swift Language Weather is an iOS weather app developed in Swift 4

Swift Language Weather SwiftWeather has renamed to Swift Language Weather. Becau

GitHawk is the second-highest rated iOS app for GitHub
GitHawk is the second-highest rated iOS app for GitHub

GitHawk is the second-highest rated iOS app for GitHub

An iOS app that automatically capitalizes the title of your essay. Supports MLA, APA, and Chicago styles.
An iOS app that automatically capitalizes the title of your essay. Supports MLA, APA, and Chicago styles.

Title Capitalizr for iOS An iOS app that automatically capitalizes the title of your essay. Supports MLA, APA, AP, and Chicago styles. "You probably w

App desenvolvido do zero em Swift pelo time iOS na formação da Digital House
App desenvolvido do zero em Swift pelo time iOS na formação da Digital House

App desenvolvido do zero em Swift pelo time iOS na formação da Digital House. O App tem por objetivo mostrar o filme da API que deu match de acordo com a escolha do usuário após clicar no botão Roletar. Foi usado o padrão de projeto MVVM.

RMIT SSET Contact List iOS app!
RMIT SSET Contact List iOS app!

RMIT SSET Contact List "The Contact List is Long, The Circle is Small!" 📖 Description This is an iOS application, inspired from the traditional phone

Using Kiva's free API, the demo app retrieves its most recent fundraising loans
Using Kiva's free API, the demo app retrieves its most recent fundraising loans

KivaLoan Kiva is a non-profit organization with a mission to connect people through lending to alleviate poverty. Using Kiva's free API, the demo app

Owner
Josh Adams
I am an iOS developer. My four side-project iOS apps are Conjuguer, Conjugar, RaceRunner, and Immigration. I blog at racecondition.software.
Josh Adams
VidyoPlatform Basic CustomLayouts Reference App for iOS (Swift)VidyoPlatform Basic CustomLayouts Reference App for iOS (Swift)

VidyoPlatform Basic CustomLayouts Reference App for iOS (Swift) VidyoPlatform reference application highlighting how to integrate video chat into a na

Taras Melko 0 Nov 19, 2021
IOS-PokemonQuizApp - Assignment to make a responsive iOS app. App has to connect with an external API

iOS-PokemonQuizApp Assignment to make a responsive iOS app. App has to connect with an external API. The Project The idea of the project is to make a

BennyDB 0 Jan 9, 2022
Ios-quizzer - The app implements basic features of a quiz app using MVC pattern

Quizzer App The app implements basic features of a quiz app using MVC pattern.

Stefan 2 May 10, 2022
WHAT WILL YOU LEARN? Onboarding Screen with Page Tab View, state of the app with the new App Storage

WHAT WILL YOU LEARN? Onboarding Screen with Page Tab View, state of the app with the new App Storage Onboarding or a Home screen Understand how the new App Life Cycle works Link View 
 Group Box View Disclosure View Dynamically List View with a loop

Ghullam Abbas 5 Oct 17, 2022
Flixtor-iOS - iOS streaming app inspired by Netflix that allows you to watch any film and series

Flixtor-iOS iOS streaming app inspired by Netflix that allows you to watch any f

Kevin Liu 0 Jan 14, 2022
Repository for the dgca verifier iOS app.

EU Digital COVID Certificate Verifier App - iOS About • Development • Documentation • Support • Contribute • Contributors • Licensing About This repos

null 47 May 19, 2022
Demo App for Picture-in-Picture of Arbitrary UIView in iOS

> 日本語 UIPiPDemo This is a demo app for displaying an arbitrary UIView in iOS using picture-in-picture. It can be used to display information that chan

Akihiro Urushihara 61 Sep 26, 2022
iOS App that helps you breath properly.

Breathing App iOS App that helps you breath properly. I created this iOS app in my Intro to iOS Develepmont class at Hunter College. I am not a profes

Kevin Salamanca 0 Dec 24, 2021
Random-Colors-iOS - Random colors generator app with auto layout

Random Colors Random colors generator app with auto layout Demo demo.mp4 Depende

Adem Özcan 8 Mar 23, 2022
iOS app for Emoncms

Emoncms for iOS Emoncms for iOS is an app that allows you to connect to an Emoncms instance. This can either be through the official emoncms.org, thro

Emoncms 17 Sep 26, 2022