Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Swift 5.1の変更点
Search
iganin
November 29, 2019
Programming
840
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Swift 5.1の変更点
2019/11/29 yumemi.swiftでの発表内容です。
iganin
November 29, 2019
More Decks by iganin
See All by iganin
On-behalf-of Token exchange with AgentCore Identity
hironobuiga
2
330
FastMCP OAuth Proxy with Cognito
hironobuiga
4
430
Three-Legged OAuth in AgentCore Gateway
hironobuiga
2
350
Amazon Bedrock AgentCore 認証・認可入門
hironobuiga
3
680
AgentCoreで実現するマルチテナントAIエージェント
hironobuiga
2
280
FlutterでGraphQL のuseQueryを使う
hironobuiga
0
37
FlutterでGraphQLを扱う
hironobuiga
0
30
FlutterでScrollViewとExpandedを併用し てSignIn / SignUp画面 など レイアウトを作成する
hironobuiga
0
32
Data Race and Actor
hironobuiga
0
100
Other Decks in Programming
See All in Programming
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
410
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
1
510
アクセシビリティから考える情報設計
high_g_engineer
0
380
一人だけ、Kiroが静止する日
hideg
0
130
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
380
FreeBSDでZabbixを動かす
kenkino
0
320
Building an Out-of-Order CPU
latte72
1
800
巨大モノリシックアプリ モダン化大作戦
ktcryomm
1
1.1k
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
4
3.4k
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
450
setup-vp GitLab対応の裏側
naokihaba
0
120
新卒PdEのリアル
ryu1013
1
510
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
225
10k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
370
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
76k
So, you think you're a good person
axbom
PRO
2
2.2k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
390
Discover your Explorer Soul
emna__ayadi
2
1.3k
Code Review Best Practice
trishagee
74
20k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
How GitHub (no longer) Works
holman
316
150k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
340
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Transcript
Swift 5.1 の変更点 2019/11/29 yumemi.swift Hironobu Iga
自己紹介 Hironobu Iga( Iganin ) Freelance Mobile App Engineer( iOS
, Android) • Twitter: @iganin_dev • Hatena: Iganin • Qiita: @iganin
話すこと • ざっくりとしたSwift 5.1 の変更点確認 • Pickup ◦ SE-0242 Synthesize
default values for the memberwise initializer ◦ SE-0068 Expanding Swift Self to class members and value types • まとめ
Swift5.1の変更点 (ざっくり)
Swift 5.1で入った変更点 Swift UIの導入もあり、非常に多くの変更が入っています。 簡単にキーワードを上げていきます。
Swift 5.1で入った変更点 Module Stability swiftmodule の ライブラリInterface定義の安定化により、ライブラリのコンパイル時に 使用したSwiftバージョンとアプリのSwiftバージョンが異なっても大丈夫に Additional Language
and Compiler Update SwiftUIの導入と共に多くの変更が入っています • Property Wrapper • Opaque Result Types • single expression の場合はreturn 不要 ( var sample: String { “sample” } ) • Key Path Member Lookup • etc
Swift 5.1で入った変更点 Standard Library Updates Collectionsの扱い, Arrayの初期化, StringにいくつかのAPIが追加 ,Identifiableプロトコ ルの導入など
Language Server Protocol LSPをサポートしているエディターであれば、Swiftのコード補完やシンタックスハイライ ト、ジャンプ機能などが使えるように
PickUpして話すこと Swift UI の導入もあり多くの変更点があります それぞれの内容は深く、他の勉強会でも語られているため 本日の発表ではあまり他の勉強会でみなかった2つをPickupします • SE-0242 Synthesize default
values for the memberwise initializer • SE-0068 Expanding Swift Self to class members and value types
SE-0242 Synthesize default values for the memberwise initializer
Synthesize default values for the memberwise initializer ざっくり説明 Structの自動生成される初期化メソッドがより便利になった
Synthesize default values for the memberwise initializer 従来は、 `var id:
Int = 0` と定義していてもデフォルト値を考慮した初期化メソッドは生成 されていませんでした
Synthesize default values for the memberwise initializer User(name: “Tanaka”) のように初期化するためには、
明示的に定義する必要がありま した
Synthesize default values for the memberwise initializer var id: Int
= 0 を考慮した初期化メソッド init(id: Int = 0, name: String) のようにデフォルト引数を考慮した初期化メソッドが自動生 成されるようになり、明示的にメソッドを作成する必要がなくなりました OK!
SE-0068 Expanding Swift Self to class members and value types
Expanding Swift Self to class members and value types ざっくり説明
class内からstatic変数やメソッドにアクセスしやすくなりました
Expanding Swift Self to class members and value types staticなhogeという変数とfugaというメソッドを定義します。
struct内からアクセスする際に従来は ${Struct名}.変数 や type(of: self).変数とする必 要がありました。
Expanding Swift Self to class members and value types Swift
5.1 以降では、 class, struct, enum内から staticな変数やメソッドにアクセスする際 に、 Self を利用できるようになりました OK!
Expanding Swift Self to class members and value types インスタンス変数・メソッドへのアクセス
• self.変数 • self.メソッド staticへ変数・メソッドへのアクセス • Self.変数 • Self.メソッド 上記のように綺麗な対比関係ができました
まとめ • Swift UI の導入もあり、多くの変更点 • 2つの変更をPickup ◦ structの自動生成初期化メソッドが便利に ◦
staticな変数・メソッドにSelfでアクセス可能に
補足 Swift.orgの1次情報にあたるのはとてもオススメです • https://swift.org/blog/ Swift 5.1の新機能が解説されているPlaygroundが GitHubにありオススメです • twostraws/whats-new-in-swift-5-1 ◦
GitHub: https://github.com/twostraws/whats-new-in-swift-5-1 ◦ 関連記事: https://github.com/twostraws/whats-new-in-swift-5-1
Thank you!