Skip to content
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

Simplify infoContent singular or plural strings #108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sandersantema
Copy link
Contributor

Alternatively it could also be simplified to:

infoContent.append("\(artists.count) Artist" + (artists.count > 1 ? "s" : ""))

@sandersantema
Copy link
Contributor Author

I just discovered that this code is repeated in Artist.swift as well, I suppose it might be better to apply this change to all the files which share this code and possibly even better to abstract all the things Genre.swift, Artist.swift and possibly others share to a class or struct but that would require more swift knowledge which I currently don't have.

@BLeeEZ
Copy link
Owner

BLeeEZ commented Apr 1, 2022

Cool, but a small change is required. If the count is zero no info should be appended to infoContent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants