Files
TUIkit/Sources/TUIKit/Core/View.swift
T
phranck 45e73faafb refactor: Rename package from SwiftTUI to TUIKit
BREAKING CHANGE: Package name changed due to name collision with
existing rensbreur/SwiftTUI package.

Changes:
- Rename package from SwiftTUI to TUIKit in Package.swift
- Rename Sources/SwiftTUI to Sources/TUIKit
- Rename Sources/SwiftTUIExample to Sources/TUIKitExample
- Rename Tests/SwiftTUITests to Tests/TUIKitTests
- Rename SwiftTUI.swift to TUIKit.swift
- Update all imports: import SwiftTUI -> import TUIKit
- Update all code references: SwiftTUI.renderToBuffer -> TUIKit.renderToBuffer
- Update documentation comments
- Rename swiftTUIVersion to tuiKitVersion

All 181 tests passing.
2026-01-28 19:32:09 +01:00

38 lines
967 B
Swift

//
// View.swift
// TUIKit
//
// The base protocol for all TUIKit views.
//
/// The base protocol for all TUIKit views.
///
/// `View` is the central protocol in TUIKit and works similarly to `View` in SwiftUI.
/// It defines how components declare their structure and content.
///
/// Every View defines a `body` composed of other Views.
/// This enables a hierarchical, declarative UI description.
///
/// # Example
///
/// ```swift
/// struct MyView: View {
/// var body: some View {
/// Text("Hello, TUIKit!")
/// }
/// }
/// ```
public protocol View {
/// The type of the body view.
///
/// Swift automatically infers this type from the `body` implementation.
associatedtype Body: View
/// The content and behavior of this view.
///
/// Implement this property to define the structure of your view.
/// The body consists of other Views that together form the UI.
@ViewBuilder
var body: Body { get }
}