iOS Persistence with UserDefaults

Persistence can be defined as saving data to a place where it can be re-accessed and retrieved upon restart of the device or app. This can mean non-volatile memory on a device or saving data to remote servers. Persistence is necessary for any app that wants to store data in the long term, that is longer than a lifecycle of a running app, and keep it available to the user.… Read the rest

Benefits and Risks of Singletons

Three singletons types frequently occur throughout iOS SDK and codebases. Let us name them and examine their benefits and risks. They are as follows:

class ExampleOne {
    static let shared = ExampleOne()

    private init {}
class ExampleTwo {
    static let shared = ExampleTwo()
class ExampleThree {
    static var sharedInstance = ExampleThree()

ExampleOne is by the book Singleton implementation.… Read the rest

Maintaining Logs

It is highly likely that a development team will log informational messages, errors, and warnings. The team determines the format and log content. Mistakes can happen. The signs of trouble ahead are: application life cycle events and user touches unleash print-out hell.… Read the rest

Validate Acceptance Criteria with UITests

To build an app that displays human viruses on the load of an app, business folks in cooperation with a development team write BBD Specs, the aim being to lay the groundwork for future acceptance testing.

Writing UI tests to validate the system’s compliance with business requirements can give a team necessary confidence to continue implementing the vision of the product, the only problem being that they can become a liability.… Read the rest