Skip to content

Commit

Permalink
update BPKIcon template
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo-skyscanner committed Jan 9, 2025
1 parent 694fc73 commit 273ddad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion templates/swiftui/BPKIcons.njk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ public extension BPKIcon {

public extension BPKIcon {
// swiftlint:disable function_body_length cyclomatic_complexity
static func named(_ iconName: String) -> BPKIcon? {
static func named(_ iconName: String, bundle: Bundle? = nil) -> BPKIcon? {

if let bundle {
return BPKIcon(name: iconName, bundle: bundle)
}

switch iconName {
{% for icon in icons -%}
case "{{icon.file}}": return .{{icon.name}}
Expand Down

0 comments on commit 273ddad

Please sign in to comment.