I made some custom fonts in Illustrator with the Fontself extension. I exported the fonts as an otf-file and mapped the glyphs on alphabetic keys (a,b,c,d,..). I wanted to use them to display an icon for my editActionsForRowAt method instead of a string.
I followed the steps provided by apple (and other guides) to include the fonts in my project, so no problem there.
override func tableView(_ tableView: UITableView, editActionsForRowAt: IndexPath) -> [UITableViewRowAction]? {
let doc = documentations.value[editActionsForRowAt.row]
let deleteBtn = UITableViewRowAction(style: .normal, title: "Delete") { action, index in
try? Documentation.db.cascadedDelete(documentationId: doc.id)
var ary = self.documentations.value
ary.remove(at: editActionsForRowAt.row)
self.documentations.accept(ary)
}
deleteBtn.backgroundColor = UIColor.init(hexString: "#e53935")
return [deleteBtn]
}
I mapped a Trash-icon on a and want to display it instead of "Delete".
How can I include my Ios-fonts.otf file to display an icon instead of the title "Delete" ?