Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Overview  





2 History  





3 Examples  





4 References  





5 External links  





6 Further reading  














SwiftUI






Deutsch
Italiano

Türkçe
 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


SwiftUI
Developer(s)Apple Inc.
Initial releaseJune 3, 2019
Operating systemiOS, iPadOS, macOS, tvOS, watchOS, visionOS
TypeSoftware framework
LicenseProprietary
Websitehttps://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.

Overview[edit]

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]

History[edit]

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]

Examples[edit]

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?]

import SwiftUI

@main
struct AnApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}
struct ContentView: View {
    var body: some View {
      Text("Hello, World!")
    }
 }

References[edit]

  1. ^ a b Mayo, Benjamin (June 3, 2019). "Apple announces SwiftUI, a modern declarative user interface framework for Apple platforms". 9to5mac.com. Retrieved January 22, 2024.
  • ^ "SwiftUI". Apple Developer Documentation. Retrieved 2024-01-10.
  • ^ "Previews in Xcode". Previews in Xcode – Apple Developer Documentation. Archived from the original on 2023-11-07. Retrieved 2023-11-07.
  • ^ "Swift Playgrounds". Apple Developer. Retrieved 2024-01-31.
  • ^ "Interfacing with UIKit". Apple Developer Documentation. Retrieved 2024-01-31.
  • ^ "MapKit for SwiftUI". Apple Developer Documentation. Retrieved 2024-01-10.
  • ^ "Canvas". Apple Developer Documentation. Retrieved 2024-01-31.
  • ^ "Swift Charts". Apple Developer Documentation. Retrieved 2024-01-31.
  • ^ "Meet SwiftUI for spatial computing - WWDC23 - Videos". Apple Developer. Retrieved 2024-01-31.
  • ^ Hudson, Paul (2018). Swift Design Patterns. Paul Hudson.
  • External links[edit]

    Further reading[edit]


    Retrieved from "https://en.wikipedia.org/w/index.php?title=SwiftUI&oldid=1230027047"

    Categories: 
    Gesture recognition
    IOS
    IPhone
    Proprietary software
    Hidden categories: 
    Articles with short description
    Short description is different from Wikidata
    Articles needing additional references from January 2024
    All articles needing additional references
    All articles with self-published sources
    Articles with self-published sources from April 2024
     



    This page was last edited on 20 June 2024, at 04:26 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki