You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's only possible to pass a text/localized Text to the title.
It would be great to pass a View, that way a combo Text + Image content could be presented on top of the feature List.
What solution would you like?
Having a new constructor with a Content in parameter instead of title, where Content is a View
Something like that:
It would make that great framework more flexible in terms of customization (even if I imagine that you want to stick to Apple design).
What alternatives have you considered?
Title could accept an optional Image with the actual Text, and it could be displayed in a VStack.
struct Title: Hashable {
// MARK: Properties
/// The title Text
public var text: Text
public var image: Image?
/// The foreground color
public var foregroundColor: Color
// MARK: Initializer
/// Creates a new instance of `WhatsNew.Title`
/// - Parameters:
/// - text: The title Text
/// - foregroundColor: The foreground color. Default value `.primary`
public init(
text: Text,
image: Image? = nil,
foregroundColor: Color = .primary
) {
self.text = text
self.image = image
self.foregroundColor = foregroundColor
}
Then in WhatsNewView :
private extension WhatsNewView {
/// The Title View
var title: some View {
VStack {
self.whatsnew.title.image.view()
Text(
whatsNewText: self.whatsNew.title.text
)
.font(.largeTitle.bold())
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)
}
}
}
Any additional context?
No response
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
It's only possible to pass a text/localized Text to the title.
It would be great to pass a View, that way a combo Text + Image content could be presented on top of the feature List.
What solution would you like?
Having a new constructor with a Content in parameter instead of title, where Content is a View
Something like that:
It would make that great framework more flexible in terms of customization (even if I imagine that you want to stick to Apple design).
What alternatives have you considered?
Title could accept an optional Image with the actual Text, and it could be displayed in a VStack.
Then in WhatsNewView :
Any additional context?
No response
The text was updated successfully, but these errors were encountered: