diff --git a/Sources/YCatalogViewer/IconographyCategory.swift b/Sources/YCatalogViewer/IconographyCategory.swift new file mode 100644 index 0000000..25e6194 --- /dev/null +++ b/Sources/YCatalogViewer/IconographyCategory.swift @@ -0,0 +1,19 @@ +// +// IconographyCategory.swift +// +// Created by Y Media Labs on 12/09/22. +// + +import Foundation + +/// Category for images +public struct IconographyCategory: Classification { + typealias View = CatalogDisplayView + /// Name of the category + public var name: String + /// Represents destination of the IconographyCategory + public var destination: Destination { + CatalogDetailDestination(navigationTitle: "IconCategory", models: models) + } + var models: [View.Model] +} diff --git a/Tests/YCatalogViewerTests/CategoriesTest.swift b/Tests/YCatalogViewerTests/CategoriesTest.swift new file mode 100644 index 0000000..192614a --- /dev/null +++ b/Tests/YCatalogViewerTests/CategoriesTest.swift @@ -0,0 +1,23 @@ +// +// CategoriesTest.swift +// +// Created by Y Media Labs on 12/09/22. +// + +import XCTest +@testable import YCatalogViewer + +final class CategoriesTest: XCTestCase { + func testIconographyCategory() { + let model = [ + CatalogDisplayView.Model( + title: "title1", + detail: "detail1", + displayViewAxis: .horizontal, + displayViewModel: UIImage(systemName: "person.fill") ?? UIImage() + ) + ] + let category = IconographyCategory(name: "Icons", models: model) + XCTAssertEqual("IconCategory", category.destination.navigationTitle) + } +}