SwiftUI
Use Apple’s XCode IDE to build native VisionOS apps for Vision Pro, iPhones, iPads.
Overview
VIDEO: Apple first released SwiftUI in 2019 for all Apple platforms (iOS 13+, tvOS 13, macOS 10.15+, watchOS 6+, VisionOS). Before that, no SDK was provided by Apple to build apps for iPhoneOS 1 (with no SDK) in 2007. After 3rd party developers were able to build apps for iPhoneOS 2 in 2008, a UIKit SDK was provided for each platform to build apps.
Apple’s official documentation is at https://developer.apple.com/documentation/swiftui
Apple’s Human Interface Guidelines (HIG) applies to all Apple platforms.
-
Vision uses the same font point system as on other Apple platforms.
-
There is no “dark mode” in VisionOS, which changes the color scheme of the UI based on the color of the user’s room.
https://developer.apple.com/sf-symbols – Apple’s comprehensive library of vector-based symbols included in Apple’s system fonts that you can incorporate into your app. Icons are 2D images containing layers.
VisionOS
- VIDEO: Vision UIs consist of Windows, Volumes, and Spaces.
Volumes are 3D experiences (with depth), such as a spinning globe. Volumes are created using the Unity IDE or RealityKit. Reality Composer Pro is a separate app for creating Volumes (3D scenes, particles, spatial audio).
Spaces are 3D experiences (with depth), such as a spinning globe.
Full Spaces take over your entire field of view for full immersion.
Full Spaces display ARKit features such as displaying your hands.
Shared Spaces contain multiple Volumes.
Vision Pro device
https://www.apple.com/apple-vision-pro
Although Apple does not use the terms VR, AR, or Metaverse even though they had a ARKit product for Augmented Reality. Vision Pro v1 from Apple is a combination of a VR headset and AR glasses.
Apple uses the term “Vision”.
Apple announced the Vision Pro at WWDC in June 2023.
The $3,500 Vision Pro pre-orders begin 5pm PT January 19, 2024, with delivery in Apple Stores beginning February 2, 2024.
It will be purchased by early adopters, such as developers, and those who want to be the first to have the latest technology.
Pay $199 to buy through Apple Zeiss prescription glasses that slots into the Vision Pro headset, unlike the Oculus Quest 2 which presses on glass frames under the headset.
Vision Pro is a standalone device, with no need for a computer or phone.
Apple released the VisionOS SDK June 21, 2023.
SwiftUI is the only way to build apps for VisionOS.
It contains an M2 Apple Silicon chip like the one in MacBook Pros.
So realistic, it seems like you’re really there, fully immersive in the real world.
-
A front display to display your eyes.
-
A 4K display for each eye to display 3D Spaces.
-
Internal IR cameras and IR illuminators to track your eyes with
A 3D eye tracking system to allow you to interact with the virtual world.Authentication with OpticID to unlock the device based on your unique eye pattern.
When you look at the edge of the screen, the screen scrolls. When you look at the menu at the edge of the screen, it is expanded.
When you look at an object, it is selected. -
A 3D microphone system to record spatial audio.
Connection with Siri to say instead of typing on a keyboard.
It has noise cancellation so it seems like you’re in a quiet room.
-
A 3D gesture system to allow you to interact with the virtual world.
The Vision Pro has no controllers like other VR headsets.
-
A 3D audio system to play spatial audio such that when you turn your head, the sound appears to be stationary.
Within the Facetime app, when you move a person, sound from that person appears to come from that person.
-
Pairs of external cameras that look down, to each side.
- A 3D touch system to allow you to feel objects in the virtual world.
-
A 3D haptic system to allow you to feel objects in the virtual world.
Vibrancy is a new feature of Vision Pro that allows you to feel the vibrations of objects in the virtual world.
- A 3D temperature system to allow you to feel the temperature of objects in the virtual world. (not really)
- A 3D smell system to allow you to smell objects in the virtual world. (not really)
- A 3D taste system to allow you to taste objects in the virtual world. (not really)
- A 3D wind system to allow you to feel the wind in the virtual world. (not really)
- A 3D water system to allow you to feel water in the virtual world. (not really)
VIDEO: Apple Vision Pro Impressions! by Marques Brownlee
VIDEO: I tried the Apple Vision Pro! Here’s what it’s really like by GadgetGuy (Adam Quinn)
VIDEO: Apple Vision Pro Will Change You by Hololinked
VIDEO: Apple Vision Pro - Is it worth $3500? by Mrwhosetheboss
VIDEO: Patent Leak Shows Vision Pro’s Game Changing Secret | Quick Tech News on Apple CrazyOnes Tech News
Tutorials
VIDEO: How to Make an App - Lesson 1 (2023 / Xcode 14 / SwiftUI) by CodeWithChris
Xcode
Install XCode 15.1+ A separate VisionOS simulator app is installed automatically.
- https://developer.apple.com/xcode/
“Swift” refers to macros, functions, and classes in the Swift language.
- Primitive - Learn SwiftUI for designers
Each GitHub repo has these files and folders:
- .gitignore
- README.md
- LICENSE
- Within folder AuthSample.xcodeproj:
- project.pbxproj
- project.xcworkspace
- xcuserdata
Within the folder with the app name:
- Folder Assets.xcassets
- Folder AccentColor.colorset
- Folder AppIcon.appiconset
- File Contents.json
- Folder Model
- File User.swift
- Folder Preview Content/Preview Assets.xcassets
- File Contents.json
- Folder View
- Folder Auth containing:
- LoginView.swift
- SignUpView.swift
- File HomeView.swift
- File MainTabView.swift
- File ProfileView.swift
- Folder Auth containing:
- Folder ViewModel (data models such as Firebase)
- File AuthViewModel.swift
- File AuthSampleApp.swift
- File ContentView.swift
Sample apps
Sample apps from Apple:
-
devxoul/SwiftUITodo - The world-1st example to-do list app using SwiftUI which is introduced in WWDC19
-
apple/sample-food-truck - SwiftUI sample code from WWDC22
Hello World Use windows, volumes, and immersive spaces to teach people about the Earth.
https://developer.apple.com/documentation/swiftui/backyard-birds-sample”>Backyard Birds: Build an app with SwiftData and widgets with persistent data, interactive widgets, and an all new in-app purchase experience.
- https://github.com/apple/sample-backyard-birds
GitHub Repos
A search within all of GitHub.com reveals 60,800+ repos with SwiftUI in the repo name. The ones with most stars:
Awesome links:
- A collaborative list of awesome SwiftUI resources first released Sep 13, 2020 by Yigit Can in Turkey
- Awesome SwiftUI = A collaborative list of awesome articles, talks, books, videos and code examples about SwiftUI.
- Gathering all info published, both by Apple and by others, about new framework SwiftUI.
- SwiftUI 2.0 Cheat Sheet
- chinsyo/awesome-swiftui - A curated list of awesome SwiftUI tutorials, libraries, videos and articles.
- onmyway133/awesome-swiftui 🌮 Awesome resources, articles, libraries about SwiftUI
Practices:
- fzhlee/SwiftUI-Guide - SwiftUI practices guidebook, written for humans.
https://vapor.codes/ is a web framework for Swift used as a server backend for Apple apps. https://github.com/Alamofire/Firewalk?tab=readme-ov-file
Sample apps:
-
SwiftUI sample app using Clean Architecture. Examples of working with CoreData persistence, networking, dependency injection, unit testin…
-
https://github.com/gao-sun/eul eul = 🖥️ macOS status monitoring app written in SwiftUI (installed using brew install –cask eul) first released Sep 13, 2020 by Gao Sun in China
-
Recreate - A video series about recreating popular UI with SwiftUI
-
SwiftUI-Kit = A SwiftUI system components and interactions demo app by Jordan Singer in San Francisco. Use the SwiftUI Kit app to see how SwiftUI views appear and interact when using system defaults. Includes Buttons, Colors, Controls, Fonts, Haptics, Images, Indicators, Shapes, Text, and more.
-
gonzalezreal/swift-markdown-ui - Display and customize Markdown text in SwiftUI. By Guille Gonzalez in Madrid, Spain.
-
AmeddahAchraf/Food-Delivery-SwiftUI - iOS Food delivery app with custom components and layouts, Built entirely with swiftUI
-
mecid/swiftui-recipes-app - Recipes app written in SwiftUI using Single State Container
-
alfianlosari/SwiftUI-MovieDB - SwiftUI MovieDB prototype app built with Xcode 11 Beta & macOS 10.15 Catalina
-
QuickBirdEng/SwiftUI-Architectures - Three different architectures (Model-View, Redux, MVVM) for using SwiftUI implemented at the example of a chat app
-
nantoka/edhita - Fully open source text editor for iOS written in SwiftUI.
-
rensbreur/SwiftTUI - SwiftUI for terminal applications
-
SwiftOnTap/Docs - Complete SwiftUI Docs with Examples
-
alfianlosari/SwiftUICDExpenseTrackerCompleted - Building Expense Tracker iOS App with Core Data & SwiftUI Completed Project
UI Controls:
- SwiftUI Animations = A repository containing a variety of animations and Animated components created in SwiftUI that you can use in your own projects.
Migration
- VIDEO: Vision Pro from a Developer’s Perspective by Paul Hudson
Previous apps written using UIKit need to be converted to SwiftUI code.
Apple expects that most iPadOS and iOS apps can run unmodified on Apple Vision Pro, so your app can easily extend to this new platform — with no additional work required. Your compatible iPad and iPhone apps will be published automatically on the App Store for Apple Vision Pro, using the metadata you’ve already provided. You can edit your app’s availability at any time in App Store Connect.
DOCS: These features in iPad and iPhone apps aren’t available in visionOS.
* Core Motion services
* Barometer and magnetometer data
* All location services except the standard service
* HealthKit data
* Video or still-photo capture
* Camera features like auto-focus or flash
* Rear-facing (selfie) cameras
<br /><br />
VisionOS framework APIs are used to determine when the features are available.
Developers
https://www.macworld.com/article/672537/when-is-apples-next-event.html
https://www.youtube.com/watch?v=Bc_6XNZos-4 Vision Pro Developer Hands-on by Developer Commentary (Jordi and Malin)
Language Constructs
UIKit is Imperative with MVC & MVVM.
SwiftUI is Declarative.
- For views/view controllers, SwiftUI uses struct instead of class
- Struct as a value type works differently with var internally
- In structs, init is implicit
- Ternary Conditional operators are used instead of if/else
Cards, Containers, ContentView.swift
-
Structs with protocols
-
Computed properties
-
Closures
-
Array methods
-
Conditional operators
Tutorials
At OReilly.com
https://learning.oreilly.com/videos/-/9781805121770/ Deep Dive iOS 16 Swift - SwiftUI Programming
https://learning.oreilly.com/videos/-/9781801070676/ SwiftUI - The Complete iOS 16 Developers Resource and Bible
https://learning.oreilly.com/library/view/-/9781803242071/ Elevate SwiftUI Skills by Building Projects
https://learning.oreilly.com/library/view/-/9781805121732/ SwiftUI Cookbook - Third Edition
At pluralsight.com
https://www.pluralsight.com/paths/ios iOS App Development Path of 14 courses.
VIDEO: SwiftFest Boston Sep 3, 2019 presentations
Apple doesn’t participate in big industry-wide events such as CES or E3.
On LinkedInLearning
https://www.linkedin.com/learning/search?keywords=swiftui
Composable SwiftUI Architecture Using Redux 2: Building the App by Mohammad Azam
Part 1
Part 2:
YouTube Videos
VIDEO: SwiftUI Bootcamp “most organized”.
Jobs
Indeed.com aggregates job postings: https://www.indeed.com/q-swiftui-jobs.html
https://www.ziprecruiter.com/Jobs/Swiftui says that the average SwiftUI salary is near $150,000 per year.
https://www.flexjobs.com/remote-jobs/ios-developer
https://www.simplyhired.com/search?q=swiftui&l=remote
https://workwithswiftui.com/swiftui-jobs
https://www.hackingwithswift.com/forums/jobs
Agencies
https://www.linkedin.com/company/swiftui-developers/
https://arc.dev/hire-developers/swiftui
More on Apple technologies
This is one of several topics:
- Evangelism dependencies
- Deliverables and Events Budgeting spreadsheet
-
Evangelism Cost-Benefit analysis (Bang-for-the-buck comparion)
- Events and Conferences
- Calendar of Announcements
-
Milestone events
- Social media
- Social media strategy
- Tweets
- Sentiment analysis (of favorable words or not)
- Responses to social media
- Competitive Comparisons (by analysts and others)
- Competitive Strategy
- Competitive Comparison Kit (for people to run for themselves)
-
Objections, and how to handle them
- Target Customers
- Customer References
- Proof Points
- Email databases (User Acquisition)
-
Remarketing of current or lapsed users
- Product websites
- Product wikis
- User Forums (Google, LinkedIn, Reddit, etc.)
-
Surveys
- Product Roadmaps
- Release Schedule
- Tasks
-
Issues
- environments for development, testing, demos, training, etc.
- Demo presentation scripts
- Beta activities
-
Release Notes
- Tutorials
- Live event sign-up administration
- Webinars
- Video production capability
-
Live Video Streaming
- Spiffs
- Hackathons
- Participating in Conferences
- Running Conferences
-
Dynamic projections of tweets, etc.
- Recruitment follow-up