SwiftUI: Difference between revisions

Content deleted Content added
AnomieBOT (talk | contribs)
m Dating maintenance tags: {{Citation needed}}
improved organization
Line 11:
}}
 
'''SwiftUI''' is a user interface framework<ref name="announcement">{{Cite web |last=Mayo |first=Benjamin |date=June 3, 2019 |title=Apple announces SwiftUI, a modern declarative user interface framework for Apple platforms |url=https://9to5mac.com/2019/06/03/apple-announces-swiftui-a-modern-declarative-user-interface-framework-for-apple-platforms/ |access-date=January 22, 2024 |website=9to5mac.com}}</ref> for building [[user interface]]s for [[iOS]], [[iPadOS]], [[watchOS]], [[tvOS]], [[visionOS]] and [[macOS]], developed by [[Apple Inc.]] for the [[Swift (programming language)|Swift]] programming language. It was announced at the company's [[Worldwide Developers Conference]] (WWDC) on June 3, 2019.
 
== Overview ==
SwiftUI is [[Declarative programming|declarative]], contrasting with the [[Imperative programming|imperative syntax]] used in other Apple development frameworks such as [[UIKit]] and [[AppKit]]. SwiftUI allows for interoperability with other UIKit views, 2D drawing, animations, [[Event (computing)|event handling]], widgets, and [[data binding]]. SwiftUI automatically synchronizes between UI views and data.<ref>{{Cite web |title=SwiftUI |url=https://docs.developer.apple.com/documentation/swiftui |access-date=2024-01-10 |website=Apple Developer Documentation |language=en-US}}</ref>
 
SwiftUI integrates with other Apple services, such as [[Xcode]] to provide for real-time previews during editing,<ref name=":0">{{Cite web |title=Previews in Xcode |url=https://developer.apple.com/documentation/swiftui/previews-in-xcode |access-date=2023-11-07 |website=Previews in Xcode – Apple Developer Documentation |language=en |archive-url=https://web.archive.org/web/20231107221047/https://developer.apple.com/documentation/swiftui/previews-in-xcode |archive-date=2023-11-07}}</ref> and support for maps with [[Apple Maps]].<ref>{{Cite web |title=MapKit for SwiftUI |url=https://docs.developer.apple.com/documentation/mapkit/mapkit_for_swiftui |access-date=2024-01-10 |website=Apple Developer Documentation |language=en-US}}</ref>
== History ==
SwiftUI was announced at the company's [[Worldwide Developers Conference]] (WWDC) on June 3, 2019, and was added in [[iOS 13]] and [[macOS Catalina]].<ref name="announcement"></ref>
== Examples ==
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, with the main view named ContentView{{citation needed|date=January 2024}}.