HomeiOS Developmentios - Find out how to animate textField's peak grows in SwiftUI?

ios – Find out how to animate textField’s peak grows in SwiftUI?


With under code, the textField grows when its line is elevated and smaller than 5 traces. However there is no such thing as a animation on textField’s peak change, how may I apply an animation on that change?

struct TextClipView: View {
    @EnvironmentObject var textClipModel: TextClipModel
    non-public var placeholderString = "Sort your textual content right here!"
    
    var physique: some View {
        GeometryReader { proxy in
            VStack(spacing: 20) {
                Spacer()
                    .body(peak: 80)
                
                TextField(placeholderString, textual content: $textClipModel.textClip, axis: .vertical)
                    .textFieldStyle(.roundedBorder)
                    .lineLimit(5)
                Spacer()
            }
            .body(
                width: proxy.measurement.width,
                peak: proxy.measurement.peak
            )
        }
        .background(Coloration.inexperienced.opacity(0.2))
    }
}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments