-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-iOS: new WWDC23 video {'Prototype with Xcode Playgrounds'}.
- Loading branch information
Showing
20 changed files
with
285 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
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.
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.
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,259 @@ | ||
--- | ||
title : "Prototype with Xcode Playgrounds" | ||
abstract: "Speed up feature development by prototyping new code with Xcode Playgrounds." | ||
|
||
displayToc: true | ||
--- | ||
|
||
# WWDC 2023: Prototype with Xcode Playgrounds | ||
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 10250](https://developer.apple.com/videos/play/wwdc2023/10250/)). | ||
|
||
![](../../../../../images/iOSdev/wwdc23-10250_Poster.png) | ||
|
||
"**Speed up** feature development by **prototyping new code** with Xcode Playgrounds, eliminating the need to keep rebuilding and relaunching your project to verify your changes. We'll show you how **using a playground in your project** or package can help you try out your code in various scenarios and take a close look at the returned values, including **complex structures and user interface elements**, so you can quickly iterate on a feature before integrating it into your project." | ||
|
||
</br>Hereafter, the underlined elements **lead directly to the playback of the WWDC video** at the appropriate moment. | ||
</br> | ||
|
||
## Overview | ||
The entire presentation is based on a [basic app](https://developer.apple.com/videos/play/wwdc2023/10250/?time=75) that will be enhanced to achieve specific goals and become [much more efficient](#finalApp). | ||
|
||
![](../../../../../images/iOSdev/wwdc23-10250_AppStarter.png) | ||
A playground is an **interactive environment** in which code can be written and executed while real-time results are displayed nearby.</br> | ||
The **Xcode Playgrounds** [streamline the code writing](https://developer.apple.com/videos/play/wwdc2023/10250/?time=124) and save time through skipping a project rebuild and relaunch while easily testing some code snippets. | ||
|
||
**Starting** a new `Xcode` playground is [quite easy](https://developer.apple.com/videos/play/wwdc2023/10250/?time=160) with its **running** [speed up](https://developer.apple.com/videos/play/wwdc2023/10250/?time=195) and its [defaults settings](https://developer.apple.com/videos/play/wwdc2023/10250/?time=216). | ||
|
||
![](../../../../../images/iOSdev/wwdc23-10250_2.png) | ||
|
||
</br> | ||
|
||
## [Type information](https://developer.apple.com/videos/play/wwdc2023/10250/?time=267) | ||
New in `Xcode 15`, a brief detail of each row is highlighted through the inline result item. | ||
|
||
![](../../../../../images/iOSdev/wwdc23-10250_3.png) | ||
|
||
</br> | ||
|
||
## [Source code](https://developer.apple.com/videos/play/wwdc2023/10250/?time=317) | ||
`Xcode 15` points out the source code that produces the displayed result. | ||
![](../../../../../images/iOSdev/wwdc23-10250_4.png) | ||
|
||
</br> | ||
|
||
## Protocols | ||
<ul class="nav nav-tabs" role="tablist"> | ||
<li class="nav-item" role="presentation"> | ||
<a class="nav-link active" | ||
data-bs-toggle="tab" | ||
href="#XcodePlaygroundsProtocols1" | ||
id="XcodePlaygroundsProtocols1_tab" | ||
role="tab" | ||
aria-selected="true">Custom string protocol</a> | ||
</li> | ||
<li class="nav-item" role="presentation"> | ||
<a class="nav-link" | ||
data-bs-toggle="tab" | ||
href="#XcodePlaygroundsProtocols2" | ||
id="XcodePlaygroundsProtocols2_tab" | ||
role="tab" | ||
aria-selected="false">Custom display protocol</a> | ||
</li> | ||
</ul> | ||
|
||
<div class="tab-content"> | ||
<div class="tab-pane show active" id="XcodePlaygroundsProtocols1" role="tabpanel"> | ||
|
||
<a alt="Click to playback the footage at the appropriate moment regarding the custom string protocol" href="https://developer.apple.com/videos/play/wwdc2023/10250/?time=337">🎬</a> | ||
|
||
Instead of having elements with empty labels, a **description can be added** thanks to the **CustomStringConvertible** protocol. | ||
![](../../../../../images/iOSdev/wwdc23-10250_5.png) | ||
</div> | ||
|
||
<div class="tab-pane" id="XcodePlaygroundsProtocols2" role="tabpanel"> | ||
|
||
<a alt="Click to playback the footage at the appropriate moment regarding the custom display protocol" href="https://developer.apple.com/videos/play/wwdc2023/10250/?time=434">🎬</a> | ||
|
||
The **CustomPlaygroundDisplayConvertible** protocol is the best way to show an element description dedicated to the **playground representation**. | ||
|
||
![](../../../../../images/iOSdev/wwdc23-10250_6.png) | ||
</div> | ||
</div> | ||
</br> | ||
</br> | ||
|
||
## [Filters](https://developer.apple.com/videos/play/wwdc2023/10250/?time=571) | ||
<ul class="nav nav-tabs" role="tablist"> | ||
<li class="nav-item" role="presentation"> | ||
<a class="nav-link active" | ||
data-bs-toggle="tab" | ||
href="#XcodePlaygroundsFilters1" | ||
id="XcodePlaygroundsFilters1_tab" | ||
role="tab" | ||
aria-selected="true">Hovering</a> | ||
</li> | ||
<li class="nav-item" role="presentation"> | ||
<a class="nav-link" | ||
data-bs-toggle="tab" | ||
href="#XcodePlaygroundsFilters2" | ||
id="XcodePlaygroundsFilters2_tab" | ||
role="tab" | ||
aria-selected="false">User interface</a> | ||
</li> | ||
<li class="nav-item" role="presentation"> | ||
<a class="nav-link" | ||
data-bs-toggle="tab" | ||
href="#XcodePlaygroundsFilters3" | ||
id="XcodePlaygroundsFilters3_tab" | ||
role="tab" | ||
aria-selected="false">String catalog</a> | ||
</li> | ||
</ul> | ||
|
||
<div class="tab-content"> | ||
<div class="tab-pane show active" id="XcodePlaygroundsFilters1" role="tabpanel"> | ||
|
||
<a alt="Click to playback the footage at the appropriate moment regarding the hovering" href="https://developer.apple.com/videos/play/wwdc2023/10250/?time=604">🎬</a> | ||
|
||
Hovering over the different inline results will toggle some highlight in their source code ranges. | ||
|
||
![](../../../../../images/iOSdev/wwdc23-10250_7.png) | ||
</div> | ||
|
||
<div class="tab-pane" id="XcodePlaygroundsFilters2" role="tabpanel"> | ||
|
||
<a alt="Click to playback the footage at the appropriate moment regarding the user interface" href="https://developer.apple.com/videos/play/wwdc2023/10250/?time=647">🎬</a> | ||
|
||
New in `Xcode 15`, the user interface provides a **split view** to improve the display of the history values. | ||
|
||
![](../../../../../images/iOSdev/wwdc23-10250_8.png) | ||
</div> | ||
|
||
<div class="tab-pane" id="XcodePlaygroundsFilters3" role="tabpanel"> | ||
|
||
<a alt="Click to playback the footage at the appropriate moment regarding the string catalog" href="https://developer.apple.com/videos/play/wwdc2023/10250/?time=726">🎬</a> | ||
|
||
The new string catalog is also an efficient way to offer a reliable solution for some specific downsides. | ||
|
||
![](../../../../../images/iOSdev/wwdc23-10250_9.png) | ||
</div> | ||
</div> | ||
</br> | ||
</br> | ||
|
||
## Maps | ||
Using an `Xcode` playground for maps requires some cautions for a better experience: | ||
|
||
1. When retrieving documentation, providing code examples that can be easily used in a playground is a great way to save time. | ||
|
||
2. In order to avoid needless calls, it might be interesting to activate the **manual mode** of playground execution. | ||
|
||
3. The **source editor gutter** points out the lines to be executed. | ||
|
||
4. Using the playgrounds **live view** involves some mandatory items to be applied. | ||
|
||
5. The **eye icon in the sidebar** might be of a great help regarding a map view troubleshooting. | ||
|
||
6. Activate the `Live View` through the `Editor Options`. | ||
|
||
</br> | ||
|
||
<ul class="nav nav-tabs" role="tablist"> | ||
<li class="nav-item" role="presentation"> | ||
<a class="nav-link active" | ||
data-bs-toggle="tab" | ||
href="#XcodePlaygroundsMaps1" | ||
id="XcodePlaygroundsMaps1_tab" | ||
role="tab" | ||
aria-selected="true">1</a> | ||
</li> | ||
<li class="nav-item" role="presentation"> | ||
<a class="nav-link" | ||
data-bs-toggle="tab" | ||
href="#XcodePlaygroundsMaps2" | ||
id="XcodePlaygroundsMaps2_tab" | ||
role="tab" | ||
aria-selected="false">2</a> | ||
</li> | ||
<li class="nav-item" role="presentation"> | ||
<a class="nav-link" | ||
data-bs-toggle="tab" | ||
href="#XcodePlaygroundsMaps3" | ||
id="XcodePlaygroundsMaps3_tab" | ||
role="tab" | ||
aria-selected="false">3</a> | ||
</li> | ||
<li class="nav-item" role="presentation"> | ||
<a class="nav-link" | ||
data-bs-toggle="tab" | ||
href="#XcodePlaygroundsMaps4" | ||
id="XcodePlaygroundsMaps4_tab" | ||
role="tab" | ||
aria-selected="false">4</a> | ||
</li> | ||
<li class="nav-item" role="presentation"> | ||
<a class="nav-link" | ||
data-bs-toggle="tab" | ||
href="#XcodePlaygroundsMaps5" | ||
id="XcodePlaygroundsMaps5_tab" | ||
role="tab" | ||
aria-selected="false">5</a> | ||
</li> | ||
<li class="nav-item" role="presentation"> | ||
<a class="nav-link" | ||
data-bs-toggle="tab" | ||
href="#XcodePlaygroundsMaps6" | ||
id="XcodePlaygroundsMaps6_tab" | ||
role="tab" | ||
aria-selected="false">6</a> | ||
</li> | ||
</ul> | ||
|
||
<div class="tab-content"> | ||
<div class="tab-pane show active" id="XcodePlaygroundsMaps1" role="tabpanel"> | ||
|
||
<a alt="Click to playback the footage at the appropriate moment regarding the third party element" href="https://developer.apple.com/videos/play/wwdc2023/10250/?time=897">🎬</a> | ||
|
||
![](../../../../../images/iOSdev/wwdc23-10250_10.png) | ||
</div> | ||
|
||
<div class="tab-pane" id="XcodePlaygroundsMaps2" role="tabpanel"> | ||
|
||
<a alt="Click to playback the footage at the appropriate moment regarding the manual mode of playground execution" href="https://developer.apple.com/videos/play/wwdc2023/10250/?time=1013">🎬</a> | ||
![](../../../../../images/iOSdev/wwdc23-10250_1.png) | ||
</div> | ||
|
||
<div class="tab-pane" id="XcodePlaygroundsMaps3" role="tabpanel"> | ||
|
||
<a alt="Click to playback the footage at the appropriate moment regarding the source editor gutter" href="https://developer.apple.com/videos/play/wwdc2023/10250/?time=1053">🎬</a> | ||
![](../../../../../images/iOSdev/wwdc23-10250_14.png) | ||
</div> | ||
|
||
<div class="tab-pane" id="XcodePlaygroundsMaps4" role="tabpanel"> | ||
|
||
<a alt="Click to playback the footage at the appropriate moment regarding the playground live view" href="https://developer.apple.com/videos/play/wwdc2023/10250/?time=1105">🎬</a> | ||
![](../../../../../images/iOSdev/wwdc23-10250_13.png) | ||
</div> | ||
|
||
<div class="tab-pane" id="XcodePlaygroundsMaps5" role="tabpanel"> | ||
|
||
<a alt="Click to playback the footage at the appropriate moment regarding the eye icon shortcut" href="https://developer.apple.com/videos/play/wwdc2023/10250/?time=1163">🎬</a> | ||
![](../../../../../images/iOSdev/wwdc23-10250_11.png) | ||
</div> | ||
|
||
<div class="tab-pane" id="XcodePlaygroundsMaps6" role="tabpanel"> | ||
|
||
<a alt="Click to playback the footage at the appropriate moment regarding the live view in the editor options" href="https://developer.apple.com/videos/play/wwdc2023/10250/?time=1297">🎬</a> | ||
![](../../../../../images/iOSdev/wwdc23-10250_12.png) | ||
</div> | ||
</div> | ||
</br> | ||
</br> | ||
|
||
Following the preceding logic results in the [final app](https://developer.apple.com/videos/play/wwdc2023/10250/?time=1380) with efficient code writing made possible by the `Xcode Playgrounds`. | ||
|
||
<a name="finalApp"></a> | ||
|
||
![](../../../../../images/iOSdev/wwdc23-10250_AppFinal.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters