Schulung_iOS/CountView.swift
2025-10-21 16:37:36 +02:00

34 lines
551 B
Swift

//
// CountView.swift
// TheSwiftWeek
//
// Created by Ingo Rohlf on 21.10.25.
//
import SwiftUI
struct CountView: View, 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()
}