import SwiftUI struct CountView: TabContent { static var title = "Count" static var image = "42.circle" @State var text = "🐼" @FocusState var isFocused: Bool // 1 var body: some View { TextField("Enter Emoji", text: $text) .padding() .focused($isFocused) // 2 .onAppear { isFocused = true // 3 } Text(""" count: \(text.count) unicode: \(text.unicodeScalars.count) length: \(text.lengthOfBytes(using: .utf8)) """) .background(.yellow) .multilineTextAlignment(.center) .bold() .fontDesign(.rounded) .font(.largeTitle) Spacer() } } #Preview { CountView() }