Schulung_iOS/CountView.swift
2025-10-22 08:19:25 +02:00

34 lines
545 B
Swift

//
// CountView.swift
// TheSwiftWeek
//
// Created by Ingo Rohlf on 21.10.25.
//
import SwiftUI
struct CountView: TabContent {
static var title = "Count"
static var image = "42.circle"
@State var text = ""
var body: some View {
TextField("Enter Emoji", text: $text)
.padding()
Text("""
Zeichenzahl: \(text.count)
Unicode: \(text.unicodeScalars.count)
UTF-8 Bytes: \(text.lengthOfBytes(using: .utf8))
""")
Spacer()
}
}
#Preview {
CountView()
}