Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

SwiftUI

From Wikipedia, the free encyclopedia
User interface framework
icon
This articlerelies largely or entirely on asingle source. Relevant discussion may be found on thetalk page. Please helpimprove this article byintroducing citations to additional sources.
Find sources: "SwiftUI" – news ·newspapers ·books ·scholar ·JSTOR
(January 2024)
SwiftUI
DeveloperApple Inc.
Initial releaseJune 3, 2019
Operating systemiOS,iPadOS,macOS,tvOS,watchOS,visionOS
TypeSoftware framework
LicenseProprietary
Websitehttps://developer.apple.com/swiftui/

SwiftUI is adeclarative framework[1] for buildinguser interfaces foriOS,iPadOS,watchOS,tvOS,visionOS andmacOS, developed byApple Inc. for theSwift programming language.

Overview

[edit]

SwiftUI isdeclarative, contrasting with theimperative syntax used in other Apple development frameworks such asUIKit andAppKit. SwiftUI allows for 2D drawing, animations,event handling, widgets, anddata binding. SwiftUI automatically synchronizes between UI views and data.[2]

SwiftUI integrates with other Apple technologies, such asXcode andSwift 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 and AppKit views via theUIViewRepresentable andNSViewRepresentable protocols respectively.[5][6]

History

[edit]

SwiftUI was announced at the company'sWorldwide Developers Conference (WWDC) on June 3, 2019, and was added iniOS 13 andmacOS Catalina.[1]

During WWDC 2020 and theiOS 14 release cycle, Apple natively added support for maps with theMap view, with an interface based onApple Maps via MapKit.[7] MapKit allows for map annotation and satellite imagery.

During WWDC 2021 and theiOS 15 release cycle, Apple added theCanvas element, adding support forImmediate mode drawing and performant 2D drawing.[8]

During WWDC 2022 and theiOS 16 release cycle, Apple released Swift Charts, a framework for making customizable and accessible charts.[9]

During WWDC 2023, Apple announced theApple Vision Pro, and support for the device was added to SwiftUI, alongside new views for AR content such asRealityView andImmersiveSpace.[10]

Examples

[edit]

The following is an example of a simpleHello World program. The@main attribute defines the entry point into the app. It is standard practice in SwiftUI to separate the application struct and views into different structs, according to theModel–View–ViewModel (MVVM) architectural pattern.[11][self-published source?]

importSwiftUI@mainstructAnApp:App{varbody:someScene{WindowGroup{ContentView()}}}structContentView:View{varbody:someView{Text("Hello, World!")}}

References

[edit]
  1. ^abMayo, Benjamin (June 3, 2019)."Apple announces SwiftUI, a modern declarative user interface framework for Apple platforms".9to5mac.com. RetrievedJanuary 22, 2024.
  2. ^"SwiftUI".Apple Developer Documentation. Retrieved2024-01-10.
  3. ^"Previews in Xcode".Previews in Xcode – Apple Developer Documentation. Archived fromthe original on 2023-11-07. Retrieved2023-11-07.
  4. ^"Swift Playgrounds".Apple Developer. Retrieved2024-01-31.
  5. ^"Interfacing with UIKit".Apple Developer Documentation. Retrieved2024-01-31.
  6. ^"AppKit integration".Apple Developer Documentation. Retrieved2024-10-06.
  7. ^"MapKit for SwiftUI".Apple Developer Documentation. Retrieved2024-01-10.
  8. ^"Canvas".Apple Developer Documentation. Retrieved2024-01-31.
  9. ^"Swift Charts".Apple Developer Documentation. Retrieved2024-01-31.
  10. ^"Meet SwiftUI for spatial computing - WWDC23 - Videos".Apple Developer. Retrieved2024-01-31.
  11. ^Hudson, Paul (2018).Swift Design Patterns. Paul Hudson.

External links

[edit]

Further reading

[edit]
iOS and iOS-based products
Hardware
iPhone (models)
iPad (models)
Discontinued
iPod Touch
Other
iOS logo
Software
OS versions
Derived from iOS
Features
SDK & API
Bundled apps
Discontinued
Apple apps
Discontinued
Services
Discontinued
Other
Retrieved from "https://en.wikipedia.org/w/index.php?title=SwiftUI&oldid=1310568609"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp