This article relies largely or entirely on a single source .(January 2024) |
![]() | |
Developer(s) | Apple Inc. |
---|---|
Initial release | June 3, 2019 |
Operating system | iOS, iPadOS, macOS, tvOS, watchOS, visionOS |
Type | Software framework |
License | Proprietary |
Website | https://developer.apple.com/xcode/swiftui/ |
SwiftUI is a declarative framework [1] for building user interfaces for iOS, iPadOS, watchOS, tvOS, visionOS and macOS, developed by Apple Inc. for the Swift programming language.
SwiftUI is declarative, contrasting with the imperative syntax used in other Apple development frameworks such as UIKit and AppKit. SwiftUI allows for 2D drawing, animations, event handling, widgets, and data binding. SwiftUI automatically synchronizes between UI views and data. [2]
SwiftUI integrates with other Apple technologies, such as Xcode and Swift Playgrounds to provide for real-time previews during editing, [3] [4] alongside support for debugging and other development features.
SwiftUI allows for interoperability with UIKit views via the UIViewRepresentable
struct. [5]
SwiftUI was announced at the company's Worldwide Developers Conference (WWDC) on June 3, 2019, and was added in iOS 13 and macOS Catalina. [1]
During WWDC 2020 and the iOS 14 release cycle, Apple natively added support for maps with the Map
view, with an interface based on Apple Maps via MapKit. [6] MapKit allows for map annotation and satellite imagery.
During WWDC 2021 and the iOS 15 release cycle, Apple added the Canvas
element, adding support for Immediate mode drawing and performant 2D drawing. [7]
During WWDC 2022 and the iOS 16 release cycle, Apple released Swift Charts, a framework for making customizable and accessible charts. [8]
During WWDC 2023, Apple announced the Apple Vision Pro, and support for the device was added to SwiftUI, alongside new views for AR content such as RealityView
and ImmersiveSpace
. [9]
The following is an example of a simple Hello World program. It is standard practice in SwiftUI to separate the application struct and views into different structs, according to the Model–View–ViewModel (MVVM) architectural pattern. [10] [ self-published source? ]
importSwiftUI@mainstructAnApp:App{varbody:someScene{WindowGroup{ContentView()}}}structContentView:View{varbody:someView{Text("Hello, World!")}}
macOS, originally Mac OS X, previously shortened as OS X, is an operating system developed and marketed by Apple since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and laptop computers, it is the second most widely used desktop OS, after Microsoft Windows and ahead of all Linux distributions, including ChromeOS.
Cocoa is Apple's native object-oriented application programming interface (API) for its desktop operating system macOS.
WebObjects is a discontinued Java web application server and a server-based web application framework originally developed by NeXT Software, Inc.
Xcode is Apple's integrated development environment (IDE) for macOS, used to develop software for macOS, iOS, iPadOS, watchOS, tvOS, and visionOS. It was initially released in late 2003; the latest stable release is version 15, released on September 18, 2023, and is available free of charge via the Mac App Store and the Apple Developer website. Registered developers can also download preview releases and prior versions of the suite through the Apple Developer website. Xcode includes command-line tools that enable UNIX-style development via the Terminal app in macOS. They can also be downloaded and installed without the GUI.
The Worldwide Developers Conference (WWDC) is an information technology conference held annually by Apple Inc. The conference is usually held at Apple Park in California. The event is usually used to showcase new software and technologies in the macOS, iOS, iPadOS, watchOS, tvOS, and visionOS families as well as other Apple software; new hardware products are sometimes announced as well. WWDC is also an event hosted for third-party software developers that work on apps for iPhones, iPads, Macs, and other Apple devices. Attendees can participate in hands-on labs with Apple engineers and attend in-depth sessions covering a wide variety of topics.
Rhapsody is an operating system that was developed by Apple Computer after its purchase of NeXT in the late 1990s. It is the fifth major release of the Mach-based operating system that was developed at NeXT in the late 1980s, previously called OPENSTEP and NEXTSTEP. Rhapsody was targeted to developers for a transition period between the Classic Mac OS and Mac OS X. Rhapsody represented a new and exploratory strategy for Apple, more than an operating system, and runs on x86-based PCs and on Power Macintosh.
AppKit is a graphical user interface toolkit. It initially served as the UI framework for NeXTSTEP. Along with Foundation and Display PostScript, it became one of the core parts of the OpenStep specification of APIs. Later, AppKit and Foundation became part of Cocoa, the Objective-C API framework of macOS. GNUstep, GNU's implementation of the OpenStep/Cocoa API, also contains an implementation of the AppKit API.
Core Data is an object graph and persistence framework provided by Apple in the macOS and iOS operating systems. It was introduced in Mac OS X 10.4 Tiger and iOS with iPhone SDK 3.0. It allows data organized by the relational entity–attribute model to be serialized into XML, binary, or SQLite stores. The data can be manipulated using higher level objects representing entities and their relationships. Core Data manages the serialized version, providing object lifecycle and object graph management, including persistence. Core Data interfaces directly with SQLite, insulating the developer from the underlying SQL.
Dashcode was a software application created by Apple Inc. that was included with Mac OS X Leopard and facilitates the development of widgets for Dashboard. It was first included on new MacBooks shipping around the time of May 24, 2006, as part of the Xcode developer tools.
Titanium SDK is an open-source framework that allows the creation of native mobile applications on platforms iOS and Android from a single JavaScript codebase. It is presently developed by non-profit software foundation TiDev, Inc.
Swift is a high-level general-purpose, multi-paradigm, compiled programming language created by Chris Lattner in 2010 for Apple Inc. and maintained by the open-source community. Swift compiles to machine code and uses an LLVM-based compiler. Swift was first released in June 2014 and the Swift toolchain has shipped in Xcode since version 6, released in 2014.
AVFoundation is a multimedia framework with APIs in Objective-C and Swift, which provides high-level services for working with time-based audiovisual media on Apple Darwin-based operating systems: iOS, macOS, tvOS, and watchOS. It was first introduced in iOS 4 and has seen significant changes in iOS 5 and iOS 6. Starting with Mac OS X Lion, it is now the default media framework for the macOS platform.
tvOS is an operating system developed by Apple Inc. for the Apple TV, a digital media player. In the first-generation Apple TV, Apple TV Software was based on Mac OS X. Starting with the second generation, the software is based on the iOS operating system and has many similar frameworks, technologies, and concepts.
WatchKit is a framework provided by Apple to develop applications for the Apple Watch. The WatchKit framework is designed for the Swift programming language and also the Objective-C programming language and must be compiled in Xcode, similar to iOS applications.
ARKit is an application programming interface (API) for iOS, iPadOS and VisionOS which lets third-party developers build augmented reality apps, taking advantage of a device's camera, CPU, GPU, and motion sensors. The ARKit functionality is only available to users of devices with Apple A9 and later processors. According to Apple, this is because "these processors deliver breakthrough performance that enables fast scene understanding and lets you build detailed and compelling virtual content on top of real-world scenes." The SDK was first released for IOS 11 in 2017, and was preinstalled in the initial release of IPadOS 13 in 2019 and visionOS 1.0 in 2024. In visionOS, however, ARKit plays a lesser role in augmented reality than in iOS and iPadOS. ARKit in visionOS is focused on acquiring data about the person’s surroundings, while SwiftUI and RealityKit control the placement of any 2D or 3D content in the person’s surroundings, and SwiftUI or UIKit are used to build windows with an app's content.
Swift Playgrounds is an educational tool and development environment for the Swift programming language developed by Apple Inc., initially announced at the WWDC 2016 conference. It was introduced as an iPad application alongside iOS 10, with a macOS version introduced in February 2020. It is available for free via Apple's App Store for iPadOS and Mac App Store for macOS.
iPadOS 14 is the second major release of the iPadOS operating system developed by Apple for their iPad line of tablet computers. It was announced on June 22, 2020 at the company's Worldwide Developers Conference (WWDC) as the successor to iPadOS 13, making it the second version of the iPadOS fork from iOS. It was released to the public on September 16, 2020. It was succeeded by iPadOS 15 on September 20, 2021.
visionOS is a mixed reality operating system derived primarily from iPadOS core frameworks, and MR-specific frameworks for foveated rendering and real-time interaction. It was developed by Apple Inc. exclusively for its Apple Vision Pro mixed reality headset. It was unveiled on June 5, 2023, at Apple's WWDC23 event alongside the reveal of the Apple Vision Pro. The software released on February 2, 2024, shipping with the Apple Vision Pro.
ArkUI is a declarative based user interface framework for building user interfaces on native HarmonyOS, OpenHarmony alongside Oniro OS applications developed by Huawei for the ArkTS and Cangjie programming language.
ArkTS is a high-level general-purpose, multi-paradigm, compiled, declarative programming language developed by Huawei which is a superset of open-source TypeScript, in turn a superset of JavaScript formerly used in July 2022 HarmonyOS 3.0 version, alongside its evolved percussor, extended TypeScript (eTS) built for HarmonyOS development as a shift towards Declarative programming. ArkTS compiles to machine code via its ahead-of-time compilation Ark Compiler. ArkTS was first released in September 30, 2021 on OpenHarmony, and the ArkTS toolchain has shipped in DevEco Studio since version 3.1, released in 2022. Since, OpenHarmony 4.0 release on October 26, 2023, ArkTS APIs has been added to the open source community to contribute.