LGV_UICleantime

master

An iOS Widget that Displays Keytags and Medallions.
LittleGreenViper/LGV_UICleantime

The Project Icon

LGV_UICLEANTIME WIDGET

This is a set of methods and resources that will produce a UIKit UILabel, containing a localizable description of a span of cleantime, or UIKit UIImages, representing keytags or medallions (standard medallions).

Here is the GitHub repo for the project.

OVERVIEW

Use these methods and resources to implement a visual, "skeuomorphic," display of the calculations that are generated by the LGV_Cleantime package (This package depends on that package).

WHAT PROBLEM DOES THIS SOLVE?

This makes it very easy to provide a visual representation of important NA Recovery milestones. LGV_Cleantime will calculate them, but this module will display them (only on iOS/iPadOS).

Displays

Keytags

Keytags are displayed as classic "saddle" keytags (the real ones are made from plastic), with a ring at the top. This ring can be specified as "open," or "closed" (more on that, later)

Figure 1: The Standard Keytag Figure 2: With the Top Ring "Open"
The standard Keytag The standard Keytag, With Its Ring "Open"

Medallions

The medallions are "skeuomorphic" renditions of the standard NA cleantime medallions (front only):

Figure 3: The Medallion
The standard Medallion

Singly, Or In Groups

These can be displayed, either as "one-off," single images, or in arrays, Figures 1-3 show them "singly," while Figures 4-6 show them in arrays:

Figure 4: A Horizontal Matrix of Keytags Figure 5: A Vertical Strip of Keytags Figure 6: A Horizontal Matrix of Medallions
A Horizontal Matrix of Keytags A Vertical Strip of Keytags A Horizontal Matrix of Medallions

You can see why the top ring is optionally open, in Figure 5.

These are provided as UIKit UIImages, embedded in UIKit UIImageViews. These can be put into scrollers, or other contexts.

REQUIREMENTS

These classes are UIKit-only (iOS/iPadOS), and require the Swift Programming Language.

Dependencies

The package is dependent upon the following three packages:

IMPLEMENTATION

Installation

The URI for the repo is:

If you want to find out more about SPM, then you might want to view this series).

Resources

The package relies on resources that should be provided in a Localizable.strings file, and embedded as images in your app bundle.

These are not being embedded into the package, because it is likely that you will want to mix them with your own localization resources.

Usage

Once you have the package included in your project, you'll need to include the library:

import LGV_UICleantime

The package has four different classes that can be used. One, is a subclass of UILabel, and the other three are subclasses of UIImageView:

The Test Harness App

The test harness app is designed to demonstrate the various aspects of the package, and provide some sample implementation. It is an iOS/iPadOS app, and its source code is in the Tests/LGV_UICleantimeTestHarness subdirectory.

It has four tabs, which illustrate each of the above subclasses:

Tab 0: The Text Report Label, and Single Medallion View
Figure 7: Tab 0 ("Medallion") Figure 8: Tab 1 ("Keytag") Figure 9: Tab 2 ("Keytags") Figure 10: Tab 3 ("Medallions")
Tab0 Tab1 Tab2 Tab3

The Keytags and Medallions tabs have scrollers, which will allow you to scroll the images.

The two keytag tabs have switches, allowing you to change the appearance/layout:

Figure 11: Keytag Open Top Figure 12: Vertical Keytag Strip
The standard Keytag, With Its Ring "Open" Keytags, Arranged as A Strip

LICENSE

The code and keytag images are MIT license. Use them as you will.

However, the medallion images are renderings of the standard bronze NA World Services (NAWS, Inc.) cleantime commemoration medallions. The design of those medallions is copyrighted by NA World Services.

It is important to treat the intellectual property of NA with respect.

Description

  • Swift Tools
View More Packages from this Author

Dependencies

  • None
Last updated: Fri Oct 18 2024 11:33:54 GMT-0900 (Hawaii-Aleutian Daylight Time)