Pierpaolo Pignelli - 2024-01-19
In this article, we will explore the latest improvements in UIKit and SwiftUI, Vision Pro, and SwiftData, diving together into the prospects for the future of iOS applications.
Index
With the introduction of iOS 17, Apple's development ecosystem is evolving once again, bringing with it numerous new features. In this article, we will explore the latest innovations in UIKit and SwiftUI, SwiftData, Xcode, and we will discover the revolutionary Vision Pro.
Let's explore together into the prospects for the future of iOS applications.
Few things are certain in June: the beginning of summer, the end of school classes, yet another Latin catchphrase that will climb the charts and that we will forget in October, the WWDC. I also wanted to add a national soccer tournament, but the last one held in December last year complicated everything!
Looking forward to the 2024 edition, let's go over the news announced in the last conference held last summer, which put a lot of flesh on our bones!
Let's start right away with the most important language-side innovations in the two frameworks UIKit and SwiftUI. Read my article before continuing if you want to know what they are!
Let's start by examining the new features introduced in iOS UIKit.
One of the flaws of UIKit compared with SwiftUI was undoubtedly the possibility of very often having to check with a control build what was written in the code...now XCode 15 gives us the ability to be able to create a #Preview("UIKit") build.
Example of the use of preview
By creating a UIButton or a UIBarButtonItem with an SF Symbol (a list of native icons covering lots of use cases released directly by Apple) you can now create an effect upon tapping on it with the new flag isSymbolAnimationAnimated = true.
Paraphrasing a famous Italian illustrator, Apple has introduced two new font size formats (.extraLargeTitle and .extraLargeTitle2); as you can tell from the name, they certainly won't go unnoticed on a screen!
Textfields can now better handle data such as date of birth and expiration date of payment cards where needed. The .textContentType in fact now also accepts .birthDateDay (and declinations) and .creditCardExpiration (and declinations). A good step forward to increase the UX of our applications.
These are some of the most curious new features for UIKit, let's see together in the next section what changes for those who prefer to adopt SwiftUi as their IOS framework instead?
SwiftUI's innovations in iOS 17 see the integration of StoreKit revolutionizing in-app purchases and the user experience. Let's find out together the new features that make creating graphical components more efficient and engaging.
Implementation of an example of SubscriptionStoreView
SubscriptionStoreView Result
Example of the bottom initialAnchor
Source: Hakingswift
Apple winks at a case that has never been handled and "puts a patch" on UI for those who want to give their apps a more "native" feel: iOS 17, iPadOS 17 and macOS 14 introduced a view called ContentUnavailableView for UIKit and SwiftUI that allows in a few steps to create context in the case of a search with no results or a list with no items.
Before, in fact, the developer in the case of a search without results or empty list had to create a custom view to show; now instead, with a few lines of code (in this example using SwiftUI) it will be possible to have the view as in the second image.
Example of ContentUnavailableView
Simulator result
SwiftData, Apple's new proposal, a new fast, powerful and easy-to-use way to save data on all operating systems, even the newest VisionOS.
Apple, starting with Core Data, listened to all the positive and negative feedback from devs to make a product that fits nicely with SwiftUI (it can also be integrated with UIKit but is not optimized).
The first steps are quite intuitive because, in the wake of SwiftUI, you want to simplify what is code writing. Here are the first steps for writing an app that includes SwiftData:
Unfortunately, support starts with iOS 17 and age-matched operating system versions of other devices, which breaks the legs a bit for new introductions but I am sure it will find a place in a few years when older versions are removed from supported versions of apps.
If you are interested in learning more, we can analyze it in depth in a subsequent article!
Feature that I personally had missed introduced since this summer with Xcode 15 is the ability to create String Catalogs; i.e. the ability to centralize the numerous localization files (the translations of texts in the various languages supported by the app) into a single file where you can keep track of the translations.
It will create a kind of table with the translation keys as rows and the various languages as columns, also indicating the percentage of completion for languages other than the default (generally English). Pearl not to give pigs the option of flagging the keys with a "revision needed" label in case it needs double-checking.
Example implementation of a String Catalog
What was unusual in recent years in fact was that of a hardware presentation combined with a software presentation: the entry of a new device that had been talked about in the preceding months, the Vision Pro, with its associated ad-hoc operating system (visionOS) made the event a hybrid between the usual WWDC and the event held in September where Apple's home mobile devices are unveiled.
This visor, mixed reality, will surely set new standards in the category, and the decidedly high price ($3500) will discourage many casual-fans from buying it in these early months.
On the developers side, however. the simulator (software eh) downloadable from what I could see performs well enough to be able to get familiar with new gestures and APIs, while waiting it was available in physical device released just these days.
The device has a Digital Crown (similar to that of the Apple Watch) located on the upper right side and an external battery that provides between 2 and 2.5 hours of use. The speakers on the other hand are positioned close to the ears, to create a feeling of high-immersion spatial audio.
Also the design plays a very important factor and creates trends and milestones in the industry: soft lines and continuous interplay between fabrics (thread and back band) and metals (the body of the visor itself).
Home page device page
Source: Apple
This new device, decidedly unique compared to all others from the Cupertino company, opened up a scenario that immediately appeared clear: The possibility and need to create a dedicated app store from scratch., and like a new Klondike, I am sure that many developers and designers in recent months have already been working on applications that take advantage of the power and potential of this visor. We are going to see some great things!
In recent years the opinion has changed and by a lot wanting to answer this question objectively. Starting more than 3 years ago with "UIKit and SwiftUI are equally valid frameworks for creating an app," continuing with "We have added so many ways to bring UIKit components into SwiftUI, so you can use SwiftUI-only APIs," and last year the message was lapidary "SwiftUI is the best way to create an app."
At the crucial moment of creating a new app, the choice between the two frameworks can make all the difference in the short but especially in the long run: taking the right direction (in terms of longevity) in this regard can save a lot of extra work in the years to come.
This year, I have a feeling that UIKit has received the coup de grace. Certainly the large company market will delay this transition to a total conversion of their proprietary applications to SwiftUI, but the dense indie market will undoubtedly benefit from this boost given by the parent company in terms of creative freedom.
Definitely the ContentUnavailableView will be very useful to me in projects given the benefit it gives and if I were to start a new project from scratch with no minimum version constraints I would definitely use SwiftData as a DB. Other minor new features listed in this article are definitely minor and situational in impact but personally relevant.
In conclusion, the advent of the visor and the important innovations presented certainly made the past edition very juicy. We will find out together whether this summer's edition will exceed expectations in a few months.
Pierpaolo Pignelli
The author of this article, has been working at Ulixe as an iOS developer since 2022. A graduate in Computer and Automation Engineering, he has been interested in IT since his teens and was weaned to the videludic world with a Game Boy Color, yellow. He is a lover of basketball and wellness and is an enthusiastic aspiring environmentalist.
Back to our blog to read Pierpaolo's upcoming articles!
Get in touch
Ulixe Group S.r.l. Copyright © Ulixe Group S.r.l. | Lungo Dora Pietro Colletta, 67, 10153, Turin, Italy | VAT IT03305250122 | Rea Number TO1173020