Skip to content

[Issue-47] Add SystemImage protocol #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2023
Merged

Conversation

mpospese
Copy link
Contributor

@mpospese mpospese commented Mar 8, 2023

Introduction

We have ImageAsset protocol to allow users to load images from asset catalogs, unit test them, and have a fallback image (so that we can return a non-optional UIImage. We should do the same thing for system images, e.g. for UIImage(systemName:) optional initializer.

Purpose

Add a protocol to simplify loading system images from string-based enums.
Fix #47

Scope

  • Add new protocol
  • Add unit tests

Discussion

@WestonHanners mentioned alerting the dev if loadImage() fails. Would this be print statement? Would it be a Logger statement? And should we log the message from loadImage() or from image? (The former is allowed to return nil but the latter is not.) I think it should be from image. Perhaps this would be a separate issue (and the functionality could be added for both ImageAsset and SystemImage at the same time.

📈 Coverage

Code

100%

image

Documentation

100%

image

@mpospese mpospese added the enhancement New feature or request label Mar 8, 2023
@mpospese mpospese self-assigned this Mar 8, 2023
@mpospese mpospese linked an issue Mar 8, 2023 that may be closed by this pull request
@mpospese mpospese merged commit d72ddbc into main Mar 9, 2023
@mpospese mpospese deleted the issue/47-add-systemimage branch March 9, 2023 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

Add SystemImage protocol
2 participants