Swiftpack.co - LittleGreenViper/LGV_UICleantime as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by LittleGreenViper.
LittleGreenViper/LGV_UICleantime 1.1.7
An iOS Widget that Displays Keytags and Medallions.
⭐️ 2
🕓 2 weeks ago
iOS macOS tvOS
.package(url: "https://github.com/LittleGreenViper/LGV_UICleantime.git", from: "1.1.7")

The Project Icon


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.


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).


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).



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"


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.


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


The package is dependent upon the following three packages:



Swift Package Manager (SPM):

The URI for the repo is:

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


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.


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


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.


Stars: 2
Last commit: 2 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics