mirror of
https://github.com/metabolist/metatext.git
synced 2024-05-16 23:43:01 +00:00
33 lines
671 B
Swift
33 lines
671 B
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
import Foundation
|
|
|
|
public enum Timeline: Hashable {
|
|
case home
|
|
case local
|
|
case federated
|
|
case list(MastodonList)
|
|
case tag(String)
|
|
}
|
|
|
|
public extension Timeline {
|
|
static let nonLists: [Timeline] = [.home, .local, .federated]
|
|
}
|
|
|
|
extension Timeline: Identifiable {
|
|
public var id: String {
|
|
switch self {
|
|
case .home:
|
|
return "home"
|
|
case .local:
|
|
return "local"
|
|
case .federated:
|
|
return "federated"
|
|
case let .list(list):
|
|
return list.id
|
|
case let .tag(tag):
|
|
return "#" + tag
|
|
}
|
|
}
|
|
}
|