Defined the Stack enumeration for the Browse module.
This commit is contained in:
parent
a393449bee
commit
0f0773992f
35
Modules/Sources/Browse/UI/Enumerations/Stack.swift
Normal file
35
Modules/Sources/Browse/UI/Enumerations/Stack.swift
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
//
|
||||||
|
// Stack.swift
|
||||||
|
// Browse
|
||||||
|
//
|
||||||
|
// Created by Javier Cicchelli on 15/12/2022.
|
||||||
|
// Copyright © 2022 Röck+Cöde. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
enum Stack {
|
||||||
|
case browse(Folder)
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Computed
|
||||||
|
|
||||||
|
extension Stack {
|
||||||
|
var tag: String {
|
||||||
|
if case .browse(let folder) = self {
|
||||||
|
return folder.id
|
||||||
|
} else {
|
||||||
|
return .Constants.noId
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Hashable
|
||||||
|
|
||||||
|
extension Stack: Hashable {}
|
||||||
|
|
||||||
|
// MARK: - String+Constants
|
||||||
|
|
||||||
|
private extension String {
|
||||||
|
enum Constants {
|
||||||
|
static let noId = "-"
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user