59 lines
1.2 KiB
Swift
59 lines
1.2 KiB
Swift
|
//
|
||
|
// ToolbarItem.swift
|
||
|
// Gemini-iOS
|
||
|
//
|
||
|
// Created by Shadowfacts on 10/10/21.
|
||
|
//
|
||
|
|
||
|
import Foundation
|
||
|
|
||
|
enum ToolbarItem: String, Codable, CaseIterable {
|
||
|
case back
|
||
|
case forward
|
||
|
case reload
|
||
|
case share
|
||
|
case home
|
||
|
case tableOfContents
|
||
|
case preferences
|
||
|
}
|
||
|
|
||
|
extension ToolbarItem {
|
||
|
var imageName: String {
|
||
|
switch self {
|
||
|
case .back:
|
||
|
return "arrow.left"
|
||
|
case .forward:
|
||
|
return "arrow.right"
|
||
|
case .reload:
|
||
|
return "arrow.clockwise"
|
||
|
case .tableOfContents:
|
||
|
return "list.bullet.indent"
|
||
|
case .share:
|
||
|
return "square.and.arrow.up"
|
||
|
case .preferences:
|
||
|
return "gear"
|
||
|
case .home:
|
||
|
return "house"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var displayName: String {
|
||
|
switch self {
|
||
|
case .back:
|
||
|
return "Go Back"
|
||
|
case .forward:
|
||
|
return "Go Forward"
|
||
|
case .reload:
|
||
|
return "Reload"
|
||
|
case .tableOfContents:
|
||
|
return "Table of Contents"
|
||
|
case .share:
|
||
|
return "Share"
|
||
|
case .preferences:
|
||
|
return "Preferences"
|
||
|
case .home:
|
||
|
return "Home"
|
||
|
}
|
||
|
}
|
||
|
}
|