Skip to content

Instantly share code, notes, and snippets.

@jtomchak
Created April 19, 2023 22:35
Show Gist options
  • Save jtomchak/ab28cef7645e17f78b4b23a3504cac1c to your computer and use it in GitHub Desktop.
Save jtomchak/ab28cef7645e17f78b4b23a3504cac1c to your computer and use it in GitHub Desktop.
//
// FontAwesomeIcon.swift
// Mastodon
//
// Created by Jesse Tomchak on 4/19/23.
//
import Foundation
struct IconStyle {
let title: String
let image: UIImage
}
enum FAIcon {
case mention
case message
}
extension FAIcon {
private var iconStyle: IconStyle {
switch self {
case .mention:
return IconStyle(title: "Mention", image: FontAwesome.image(fromChar: "\u{40}"))
case .message:
return IconStyle(title: "Message", image: FontAwesome.image(fromChar: "\u{f0e0}"))
}
}
}
extension FAIcon {
var image: UIImage {
return iconStyle.image
}
var title: String {
return iconStyle.title
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment