Skip to content

Commit

Permalink
-iOS: new WWDC23 video {'What’s new in Swift'}.
Browse files Browse the repository at this point in the history
  • Loading branch information
XLE22 committed Sep 12, 2023
1 parent a20a7fb commit e10ac64
Show file tree
Hide file tree
Showing 27 changed files with 229 additions and 4 deletions.
11 changes: 11 additions & 0 deletions src/assets/json/en/ios/wwdc/ios-wwdc-listnota11y.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@
"raccourcis": "2023/2310197",
"profils": ["All","What's new in..."]
},
{
"themes": "WWDC 2023",
"title": "What’s new in Swift",
"type": [],
"tests": [],
"verifier": [],
"resultat": [],
"exception": "",
"raccourcis": "2023/2310164",
"profils": ["All","Swift","What's new in..."]
},
{
"themes": "WWDC 2023",
"title": "What’s new in SwiftUI",
Expand Down
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_22.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_23.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10164_9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
213 changes: 213 additions & 0 deletions src/en/mobile/ios/wwdc/nota11y/2023/2310164.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
---
title : "What’s new in Swift"
abstract: "Discover powerful enhancements to the trait system in UIKit."

displayToc: true
---

# WWDC 2023: What’s new in Swift
Find hereafter a detailed summary of a video that belongs to a [taxonomy of some WWDC footages](../../).

The original video is available on the **Apple official website** ([session 10164](https://developer.apple.com/videos/play/wwdc2023/10164/)).
![](../../../../../images/iOSdev/wwdc23-10164_Poster.png)
"Join us for an update on Swift. We'll show you how APIs are becoming more extensible and expressive with features like **parameter packs and macros**. We'll also take you through improvements to interoperability and share how we're expanding **Swift's performance and safety benefits** everywhere from Foundation to large-scale distributed programs on the server."
</br>Hereafter, the underlined elements lead directly to the playback of the WWDC video at the appropriate moment.
</br>
![](../../../../../images/iOSdev/wwdc23-10164_1.png)
The `Swift` [open&nbsp;source&nbsp;project](https://developer.apple.com/videos/play/wwdc2023/10164/?time=40) has set up some changes in its operating mode to head towards a more efficient collaborative work.
</br>

## [Expressive&nbsp;code](https://developer.apple.com/videos/play/wwdc2023/10164/?time=164)
### [If/else&nbsp;&&nbsp;switch](https://developer.apple.com/videos/play/wwdc2023/10164/?time=172)
These two statements can be used as **expressions** to streamline the code writing.
![](../../../../../images/iOSdev/wwdc23-10164_2.png)
</br>
### [Result&nbsp;builder](https://developer.apple.com/videos/play/wwdc2023/10164/?time=231)
![](../../../../../images/iOSdev/wwdc23-10164_3.png)
</br>
### [Type&nbsp;parameter&nbsp;pack](https://developer.apple.com/videos/play/wwdc2023/10164/?time=294)
**The combination of the argument length with some abstraction types** may be reached through the use of `Any` as the type information with the variadic parameters but `Swift`&nbsp;`5.9` highlights a new concept called the **type parameter pack** to suggest a more elegant way of coding this use case.
![](../../../../../images/iOSdev/wwdc23-10164_4.png)
To increase the generics range, it could be interesting to add some **protocol** conformances to the initial types in order to work directly with them instead of types themselves.
</br>
### Macros
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active"
data-bs-toggle="tab"
href="#SwiftMacros1"
id="SwiftMacros1_tab"
role="tab"
aria-selected="true">Definition</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link"
data-bs-toggle="tab"
href="#SwiftMacros2"
id="SwiftMacros2_tab"
role="tab"
aria-selected="false">freestanding</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link"
data-bs-toggle="tab"
href="#SwiftMacros3"
id="SwiftMacros3_tab"
role="tab"
aria-selected="false">attached</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link"
data-bs-toggle="tab"
href="#SwiftMacros4"
id="SwiftMacros4_tab"
role="tab"
aria-selected="false">@Observable</a>
</li>
</ul>

<div class="tab-content">
<div class="tab-pane show active" id="SwiftMacros1" role="tabpanel">

<a alt="Click to playback the footage at the appropriate moment regarding the macro definition" href="https://developer.apple.com/videos/play/wwdc2023/10164/?time=590">🎬</a>

![](../../../../../images/iOSdev/wwdc23-10164_5.png)
Introduced in `Swift`&nbsp;`5.9`, the macros `API`s use the hash syntax for creating code that **transforms&nbsp;syntax at compile time**.
![](../../../../../images/iOSdev/wwdc23-10164_6.png)

They may be defined through [module&nbsp;importing](https://developer.apple.com/videos/play/wwdc2023/10164/?time=695) or in [separate&nbsp;programs](https://developer.apple.com/videos/play/wwdc2023/10164/?time=771).</div>

<div class="tab-pane" id="SwiftMacros2" role="tabpanel">

<a alt="Click to playback the footage at the appropriate moment regarding the freestanding expression macro" href="https://developer.apple.com/videos/play/wwdc2023/10164/?time=812">🎬</a>

As a possible **role** to be attached to a macro, the **freestanding expression** macro that creates a piece of code returning a value is highlighted through the new [Foundation&nbsp;Predicate](https://developer.apple.com/videos/play/wwdc2023/10164/?time=833) APIs.

![](../../../../../images/iOSdev/wwdc23-10164_7.png)
</div>

<div class="tab-pane" id="SwiftMacros3" role="tabpanel">

<a alt="Click to playback the footage at the appropriate moment regarding the attached macros" href="https://developer.apple.com/videos/play/wwdc2023/10164/?time=886">🎬</a>

Using the same syntax as property wrappers, the goal of an **attached macro** is to add very condensed code information while authoring with the at sign.
![](../../../../../images/iOSdev/wwdc23-10164_8.png)

[Multiple&nbsp;roles](https://developer.apple.com/videos/play/wwdc2023/10164/?time=953) can also be assigned to this type of macro.
![](../../../../../images/iOSdev/wwdc23-10164_9.png)
</div>

<div class="tab-pane" id="SwiftMacros4" role="tabpanel">

<a alt="Click to playback the footage at the appropriate moment regarding the new observable object" href="https://developer.apple.com/videos/play/wwdc2023/10164/?time=1017">🎬</a>

Composed of different macro roles, the **new Observable macro** generates a SwiftUI dependencies automation for read properties with no needed wrapper.
![](../../../../../images/iOSdev/wwdc23-10164_10.png)
For quickly reaching the code regarding a [macro&nbsp;expansion](https://developer.apple.com/videos/play/wwdc2023/10164/?time=1114), it'll come handy to use the **new `Xcode`&nbsp;`15` feature** suggested in the menu when the macro is selected.

![](../../../../../images/iOSdev/wwdc23-10164_11.png)
</div>
</div>
</br>

![](../../../../../images/iOSdev/wwdc23-10164_12.png)
</br>

## [Dates&nbsp;&&nbsp;JSON](https://developer.apple.com/videos/play/wwdc2023/10164/?time=1192)
**Dates** calculation and formatting plus **`JSON`** handling have been improved in `Swift`&nbsp;`5.9`.

![](../../../../../images/iOSdev/wwdc23-10164_13.png)
</br>

## [Ownership](https://developer.apple.com/videos/play/wwdc2023/10164/?time=1415)
This new concept introduces many enhancements **for structs and enums**:
- Remove the **copyable** default implementation if need be ⟹ <a alt="Click to playback the video footage." href="https://developer.apple.com/videos/play/wwdc2023/10164/?time=1537">🎬</a>

- Add **consuming methods** that can be played only once and that invalidate the value after the method has been run ⟹ <a alt="Click to playback the video footage." href="https://developer.apple.com/videos/play/wwdc2023/10164/?time=1595">🎬</a>

- Add a **deinit** like classes ⟹ <a alt="Click to playback the video footage." href="https://developer.apple.com/videos/play/wwdc2023/10164/?time=1575">🎬</a>


![](../../../../../images/iOSdev/wwdc23-10164_14.png)
## [C++&nbsp;interoperability](https://developer.apple.com/videos/play/wwdc2023/10164/?time=1679)
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active"
data-bs-toggle="tab"
href="#SwiftC++1"
id="SwiftC++1_tab"
role="tab"
aria-selected="true">Xcode</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link"
data-bs-toggle="tab"
href="#SwiftC++2"
id="SwiftC++2_tab"
role="tab"
aria-selected="false">Using&nbsp;C++&nbsp;from&nbsp;Swift</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link"
data-bs-toggle="tab"
href="#SwiftC++3"
id="SwiftC++3_tab"
role="tab"
aria-selected="false">Using&nbsp;Swift&nbsp;from&nbsp;C++</a>
</li>
</ul>

<div class="tab-content">
<div class="tab-pane show active" id="SwiftC++1" role="tabpanel">

<a alt="Click to playback the footage at the appropriate moment regarding the xcode side" href="https://developer.apple.com/videos/play/wwdc2023/10164/?time=1714">🎬</a>

![](../../../../../images/iOSdev/wwdc23-10164_15.png)
</div>

<div class="tab-pane" id="SwiftC++2" role="tabpanel">

<a alt="Click to playback the footage at the appropriate moment regarding the use of c++ from swift" href="https://developer.apple.com/videos/play/wwdc2023/10164/?time=1733">🎬</a>

![](../../../../../images/iOSdev/wwdc23-10164_16.png)
</div>

<div class="tab-pane" id="SwiftC++3" role="tabpanel">

<a alt="Click to playback the footage at the appropriate moment regarding the use of swift from c++" href="https://developer.apple.com/videos/play/wwdc2023/10164/?time=1791">🎬</a>

![](../../../../../images/iOSdev/wwdc23-10164_17.png)
</div>
</div>
</br>
</br>

## [CMake&nbsp;support](https://developer.apple.com/videos/play/wwdc2023/10164/?time=1894)

`Swift` support in `CMake` has been improved in order to encompass `C++` and `Swift` within a single target.
![](../../../../../images/iOSdev/wwdc23-10164_18.png)
</br>

## [Concurrency](https://developer.apple.com/videos/play/wwdc2023/10164/?time=1960)
![](../../../../../images/iOSdev/wwdc23-10164_19.png)
</br>

### [Tasks](https://developer.apple.com/videos/play/wwdc2023/10164/?time=2020)
![](../../../../../images/iOSdev/wwdc23-10164_20.png)
</br>

### [Actors](https://developer.apple.com/videos/play/wwdc2023/10164/?time=2081)
![](../../../../../images/iOSdev/wwdc23-10164_21.png)

The **custom actor executors** are an appropriate way to introduce a [dedicated&nbsp;dispatch&nbsp;queue](https://developer.apple.com/videos/play/wwdc2023/10164/?time=2130) for instance.

![](../../../../../images/iOSdev/wwdc23-10164_22.png)

This [actors&nbsp;synchronization](https://developer.apple.com/videos/play/wwdc2023/10164/?time=2203) comes in handy thanks to the conformance of the **SerialExecutor protocol** that include new methods in `Swift`&nbsp;`5.9`.
</br>

### [Foundation&nbsp;DB](https://developer.apple.com/videos/play/wwdc2023/10164/?time=2300)
![](../../../../../images/iOSdev/wwdc23-10164_23.png)

</br>

9 changes: 5 additions & 4 deletions src/en/mobile/ios/wwdc/nota11y/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ The videos that may be of interest to **designers** are highlighted with a **ded

<section class="visually-hidden" id="wwdcTests" aria-hidden="true">
<h2 id="hhwwdc2023" class="pt-5">WWDC 2023</h2>
<p id="hwwdc65">WWDC 2023 Keynote</p>
<p id="hwwdc64">WWDC 2023 Platforms State of the Union</p>
<p id="hwwdc63">WWDC 2023 Unleash the UIKit trait system</p>
<p id="hwwdc62">WWDC 2023 What’s new in SF Symbols 5</p>
<p id="hwwdc66">WWDC 2023 Keynote</p>
<p id="hwwdc65">WWDC 2023 Platforms State of the Union</p>
<p id="hwwdc64">WWDC 2023 Unleash the UIKit trait system</p>
<p id="hwwdc63">WWDC 2023 What’s new in SF Symbols 5</p>
<p id="hwwdc62">WWDC 2023 What’s new in Swift</p>
<p id="hwwdc61">WWDC 2023 What’s new in SwiftUI</p>
<p id="hwwdc60">WWDC 2023 What’s new in UIKit</p>
<p id="hwwdc59">WWDC 2023 What’s new in Xcode 15</p>
Expand Down

0 comments on commit e10ac64

Please sign in to comment.