Swift Vietnam News # 6 – WWDC Special

Tram Ho

6

Swift Vietnam News # 6 – WWDC Special

So WWDC20 is over. Brothers programmers have more APIs to play with. Apple did not introduce any new hardware during this WWDC, but macOS on Apple Silicon is a major change and will greatly affect the hardware introduced in the future.

WWDC20 also marked the first time WWDC was organized online instead of gathering in the hall. The Keynote and Platforms State of the Union sections are pre-recorded, resulting in smoother images. I personally feel unfamiliar and “remember” applause when the new feature is introduced as in the previous WWDC evil.

The Platforms State of the Union part, the most awaited programmer, is a bit boring because the first 30 minutes Apple focused on macOS on Apple Silicon. However, with the introduction of macOS Big Sur, iOS 14 with improved home screen, Widgets and App Clips, iPadOS with new features to make better use of the screen area, watchOS supports multiple Complications from one app, Xcode. 12 extremely few crashes and extremely fast auto completion, I feel quite satisfied with this WWDC.

In particular, the videos of WWDC are made very concise and straight to the heart. Apple Developer App very well supports both watching videos and just copying the code in accordance with the timeline, very convenient for direct code testing.

New operating system versions

Apple introduced iOS 14, iPad 14, tvOS 14, watchOS 7, macOS Big Sur (will be version 11 of macOS) with lots of new features and designs.

I will not dive into introducing new features of these operating systems versions. You can see more on other news sites:

The new API

Swift 5.3

The new features in Swift 5.3 we all know first because the Swift Evolution processes are public.

language_features

SwiftUI

It can be said that in WWDC20, Apple introduced SwiftUI 2.0 with a lot of new features. In particular we can see Apple’s effort to ensure backward compability, supporting all apps written in SwiftUI 1.0.

With the new SwiftUI, we were able to write all apps, widgets, extensions on all Apple platforms using SwiftUI, just like the SwiftUI On All Devices strategy.

The brief information about the new features of SwiftUI you can see here . Some more detailed analysis here

UICollectionView + UICollectionLayoutListConfiguration

Of course, Apple still adds new features to UIKit, especially with UICollectionView. If in WWDC2019, UICollectionView added DiffableDataSource and new layouts to optimize the display of data on many different resolutions, in this WWDC20, Apple introduced UICollectionLayoutListConfiguration to help us use UICollectionView as a UITableView . Brief information about UICollectionLayoutListConfiguration you can see here

Swift Package Manager

The most notable new feature is that SPM will support resources (images, movies etc …) by using assets catalog (.xcasset) in Xcode 12 / Swift 5.3.

Brief compositional information you can see here .

WidgetKit

intent_configuration.png

Apple has finally copied the Widget feature from Android.

We can create widgets using the WidgetKit framework. A special feature is that the Widget is only used to display information without any interactive functions.

Brief information about WidgetKit is here .

StoreKit Testing in Xcode

In-App-Purchase development is often complicated because we have to switch between Sandbox and Production to test. In Xcode 12, Apple has integrated the In-App-Purchase test function directly into Xcode, helping us check if IAP works or not much easier. Details you see here .

Specific step by step instructions are here

App Clips

App Clips can be considered a shortened version of apps. By scanning QRCode or using NFC, users can install App Clips (less than 10MB in size) quickly and run immediately to use a certain feature without having to install the entire app. This is probably similar to Instant App on Android.

Details of App Clips are here .

CoreML – Machine Learning:

This year Apple did not introduce many new features for its machine learning segment. The most notable feature is probably the model encryption feature so that no one can steal your model and use it on other apps. In addition, Frameworks such as Vision also have some additional features such as hand and body recognition.

Other new features in CoreML can be found here

Privacy

Apple continues to invest in protecting user privacy. Everyone must be startled by Tiktok or Zalo copying information from pasteboard of iPhone that only thanks to iOS we know. As a programmer, I can understand why we need to get information from pasteboard for certain features. However, with iOS 14, developers need to pay more attention when using these APIs or explain in detail to users why such features are available.

More information about Apple’s privacy protection features can be found here

Epilogue:

The above is just some brief information about WWDC I have gathered for over 1 week. All videos of WWDC20 are here . We have a whole year to ponder before WWDC21 starts.

I would also like to introduce some other resources related to WWDC for everyone to refer:

If you have posts related to Swift, WWDC and want to share with the community, you can connect with me to discuss more.

You also remember to follow the Swift Vietnam Facebook page to stay updated with the latest information about Swift and the Swift Vietnam developer community.

Share the news now

Source : Viblo