Declan Conway

Web Developer

iOS Developer

Software Developer

Declan Conway

Web Developer

iOS Developer

Software Developer

Number Fact Generator

  • Status: Completed
  • Published : 19th October 2019
  • Platform: iOS
  • Language: Swift
Back to Works page

Introduction

In this app, tapping the generate button reveals a random fact about a number. Alternatively, they can shake their device to generate a new fact. Once they have a fact, they can share it with their friends using the iOS share sheet.

The idea for this app came about while I was creating snippets of code for various iOS functions and features as a repository to consult during the development of an app. One snippet I was creating was how to parse a JSON feed. As I was creating this snippet, I realised that this could be a good foundation for a rudimentary iOS app. So I continued development with the goal of publishing on the App Store.

How was it built?

This app was created using the Numbers API. In code, I am calling the JSON feed using the JSONDecoder library and then parsing that through a struct that inherits from the Codable protocol.

The app was built to support iOS 12 and iOS 13. These versions, together, at the time, ran on 91% of all iOS devices. (As measured by the App Store on 15 October 2019.)

The gradient background was created using a CAGradientLayer (the CAGradientLayer is then assigned to a background view of type UIView), which shuffles through an array of pre-set gradient colours. When the generate button is tapped or the device is shaken, an animation is called (CABasicAnimation) to show the next colour in the array.

Gallery

Copyright © 2025, Declan Conway | Privacy Policy