I have a Text that I want to decrease the font size when it appears, from a .largeTitle to .headline
Here is what I am trying so far (which doesn't work):
struct MyView: View {
@State private var fontSize: CGFloat = 100
var body: some View {
GeometryReader { geometry in
Text("Big Text - Small Text")
.font(.system(size: self.fontSize))
.onAppear {
withAnimation(Animation.linear(duration: 10)) {
// what do I do here?
}
}
}
}
}
