Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
iOSDC2024ポスター:Swift 6に備えよう!Upcoming Feature Fla...
Search
野瀬田 裕樹
May 12, 2025
Programming
0
27
iOSDC2024ポスター:Swift 6に備えよう!Upcoming Feature Flagsを全て解説します!
iOSDC2024で掲示したポスター資料です
野瀬田 裕樹
May 12, 2025
Tweet
Share
More Decks by 野瀬田 裕樹
See All by 野瀬田 裕樹
Swift6.2時代のconcurrencyを考える会
yuukiw00w
0
130
実践!App Intents対応
yuukiw00w
1
390
App Intents再入門
yuukiw00w
0
65
Flutterで備える!Accessibility Nutrition Labels完全ガイド
yuukiw00w
0
210
WWDC25要約:Evaluate your app for Accessibility Nutrition Labels
yuukiw00w
0
120
モバイルアプリ設計入門
yuukiw00w
0
11
Swiftは最高だよの話
yuukiw00w
2
340
SwiftでよりSwiftyに
yuukiw00w
0
14
より良いLint設定を追い求めて
yuukiw00w
0
110
Other Decks in Programming
See All in Programming
ユーザーも開発者も悩ませない TV アプリ開発 ~Compose の内部実装から学ぶフォーカス制御~
taked137
0
210
ファインディ株式会社におけるMCP活用とサービス開発
starfish719
0
2.3k
Refinementsのメソッド定義を4000倍速くした話
alpacatc
0
220
テストカバレッジ100%を10年続けて得られた学びと品質
mottyzzz
2
620
AI Agents: How Do They Work and How to Build Them @ Shift 2025
slobodan
0
110
Performance for Conversion! 分散トレーシングでボトルネックを 特定せよ
inetand
0
5.6k
Server Less Code More - コードを書かない時代に生きるサーバーレスデザイン / server-less-code-more
gawa
4
820
より安全で効率的な Go コードへ: Protocol Buffers Opaque API の導入
shwatanap
3
960
Flutter with Dart MCP: All You Need - 박제창 2025 I/O Extended Busan
itsmedreamwalker
0
160
大規模アプリにおけるXcode Previews実用化までの道のり
ikesyo
0
330
アプリの "かわいい" を支えるアニメーションツールRiveについて
uetyo
0
290
CloudflareのChat Agent Starter Kitで簡単!AIチャットボット構築
syumai
2
550
Featured
See All Featured
It's Worth the Effort
3n
187
28k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
930
GraphQLとの向き合い方2022年版
quramy
49
14k
Git: the NoSQL Database
bkeepers
PRO
431
66k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Reflections from 52 weeks, 52 projects
jeffersonlam
352
21k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.9k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
How to Think Like a Performance Engineer
csswizardry
26
1.9k
RailsConf 2023
tenderlove
30
1.2k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
19k
Building Adaptive Systems
keathley
43
2.7k
Transcript
GlobalConcurrency 概要:グローバル変数にデータ競合の可能性があると警告を表示してくれる 対処法:globalアクターに隔離する or immutableかつSendableにする 対処法1:globalアクターに隔離 対処法2:immutableかつSendable 1/10
IsolatedDefaultValues 概要:stored property/関数の引数のデフォルト値の式が、stored property/関数 に指定されているActorと同じActorで隔離されるようになる 対処法:該当の関数/stored propertyが適切なActor隔離になるように修正を行う 例えばこのようなactor隔離されてないinitで は明示的にstored propertyに初期値を設定
する必要がある (IsolatedDefaultValuesが無効だとビルドが 通るが、このinitはデータ競合の可能性があ る) 2/10
DisableOutwardActorInference 概要:property wrapperを使ったときに、型のアクター隔離が推測されなくなる 対処法:property wrapperで暗黙的にアクター隔離されていた箇所を 明示的に隔離する 元々暗黙的にMainActorWrapperの MainActorを引き継いでしまう仕様 DisableOutwardActorInferenceを有効にして 同じ挙動にしたい場合、@MainActorを付与する
3/10
ImportObjcForwardDeclarations 概要:objcで前方宣言されたinterface/protocolがSwiftでimportできるようになる ImportObjcForwardDeclarationsを有効にする と色々importしなくても使えるようになる 4/10
BareSlashRegexLiterals 概要:Regex Literalsが使える(compileチェックとtyped-capture推論もされる) /…/の形式で正規表現リテラルが書け る Enable Bare Slash Regex LiteralsをYESに
設定することでも有効化できる 5/10
ImplicitOpenExistentials 概要:存在型の値をgeneric関数に渡せる(基底型が暗黙的に開かれる) 実はImplicitOpenExistentialsを 有効にしなくてもSwift 5.10でビルドが通る (Any.Typeの存在メタタイプを開く機能については Swift 6環境のSwift 5互換モードでフラグを有効にす ると使える)
anyP(存在型)の中身を渡す(開く)形になるので、 (generic関数に)Pに適合した型として渡せる 6/10
ExistentialAny 概要:存在型には全てanyを付けなければならなくなる 対処法:存在型にanyを付ける protocolの前にanyを入れると警告が消える (Fixしても同じ) 7/10
ForwardTrailingClosures 概要:trailing closuresのスキャンが前方からになる ForwardTrailingClosuresが 有効だとこれはfirstのクロージャとして認識される (無効だとsecondとして認識される) 8/10
ConciseMagicFile 概要:#fileの評価がFullPathから<ModuleName>/<fileName>に変更される 対処法:もし従来挙動のものが欲しい場合は#filePathを使用する ConciseMagicFileを有効にすると#fileが 元々の値(#filePathの値)と違う値になる 9/10
概要:@UIApplicationMainと@NSApplicationMainが非推奨になる 対処法:@mainを使用する ※ 本ポスターではSwift 6より前に使える Upcoming Feature Flagsを解説しています。 Other Swift
Flagsに -enable-upcoming-feature DeprecateApplicationMain のように追加する と有効化できます。 DeprecateApplicationMain @mainに置き換えると警告が消える 全てのサンプルコードを見たい方はこちら → https://github.com/yuukiw00w/iosdc-2024-poster 10/10