Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use text-icon instead of Image #88

Open
LuegM opened this issue Aug 28, 2024 · 1 comment
Open

Use text-icon instead of Image #88

LuegM opened this issue Aug 28, 2024 · 1 comment

Comments

@LuegM
Copy link

LuegM commented Aug 28, 2024

Is it possible to initialize with a text (icon) instead of an image?
I would want to use FontAwesome which i have integrated as font and would like to use like that:

Text("").font(.custom("FontAwesome6Duotone-Solid", size: size))

But how to use that here?

.init(
    image: .init(
        

    ),
    title: "",
    subtitle: ""
)
@SvenTiigi
Copy link
Owner

Hi @LuegM,

Yes! You can initialize a WhatsNew.Feature.Image with a custom view e.g. a Text with a custom font using the following initializer:

/// Creates a new instance of `WhatsNew.Feature.Image`
/// - Parameters:
/// - image: A ViewBuilder closure that produces an Image View
public init<Image: View>(
@ViewBuilder
image: @escaping () -> Image
) {
self.view = { .init(image()) }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants