What is "swiftui"
Swiftui is an Apple framework that provides a declarative way of defining GUI appearances and behaviors. The official documentation describes Swiftui as the following:
Swiftui provides views, controls, and structures of layout to declare the user interface of your application. The framework provides Event handlers to manipulate touches, gestures, and other types of input to your application, and tools to manage the data flow of models from its application until views and controls with which users can observe and interact.
An application can define its interface almost entirely using Swiftui, but must embed a "top-level" View
Swiftui on an adapter hosting suitable for the platform (NSHostView
, NSHostingController
, UIHostingController
, or WKHostingController
).
Swiftui can be integrated with other frameworks such as Appkit, Uikit, and Watchkit frameworks. One NSView
or UIView
can embed a Swiftui View
and vice versa.
Swiftui supports dynamic previews and replacements (hot swapping) on Xcode 11, macOS 10.15 and more current versions, and on devices running an operating system that supports Swiftui (see the list below).
Apple revealed the first version of Swiftui during the event WWDC on 3 June 2019 and made it available in the first beta release of Xcode 11.
Swiftui is part of the following Sdks:
- macOS 10.15 (Catalina) or higher,
- iOS 13 or higher,
- tvOS 13 or more,
- watchOS 6 or more.
Swiftui applications cannot be run on older platforms.