Defined the "info" and "person" static constants for the Image+Icons, String+Icons, and UIImage+Icons extensions for the UI library.

This commit is contained in:
Javier Cicchelli 2024-03-20 01:34:20 +01:00
parent 32c0ef500d
commit 5b1ca622b7
4 changed files with 58 additions and 5 deletions

View File

@ -62,11 +62,9 @@ private extension StarRating {
}
// MARK: - Image+Constants
private extension Image {
enum Icon {
static let star: Image = .init(systemName: "star")
static let starFill: Image = .init(systemName: "star.fill")
}
private extension Image.Icon {
static let star: Image = .init(systemName: "star")
static let starFill: Image = .init(systemName: "star.fill")
}
// MARK: - Previews

View File

@ -0,0 +1,19 @@
//
// Image+Icons.swift
// ReviewsUIKit
//
// Created by Javier Cicchelli on 20/03/2024.
// Copyright © 2024 Röck+Cöde VoF. All rights reserved.
//
import SwiftUI
public extension Image {
enum Icon {
// MARK: Constants
public static let info = Image(systemName: .Icon.info)
public static let person = Image(systemName: .Icon.person)
}
}

View File

@ -0,0 +1,17 @@
//
// String+Icons.swift
// ReviewsUIKit
//
// Created by Javier Cicchelli on 20/03/2024.
// Copyright © 2024 Röck+Cöde VoF. All rights reserved.
//
extension String {
enum Icon {
// MARK: Constants
static let info = "info.circle.fill"
static let person = "person.crop.circle.fill"
}
}

View File

@ -0,0 +1,19 @@
//
// UIImage+Icons.swift
// ReviewsUIKit
//
// Created by Javier Cicchelli on 20/03/2024.
// Copyright © 2024 Röck+Cöde VoF. All rights reserved.
//
import UIKit
public extension UIImage {
enum Icon {
// MARK: Constants
public static let info = UIImage(systemName: .Icon.info)
public static let person = UIImage(systemName: .Icon.person)
}
}