狠狠撸

狠狠撸Share a Scribd company logo
/* 2016.07.01 @ WWDC.next */
/**
*/
/* @es_kumagai */
/**
*/
?
/* 2016/06/13 2016/06/17 */
Swift Open Hours 2 - Swift ラボで聞いてきた話
Swift Open Hours 2 - Swift ラボで聞いてきた話
Swift Open Hours 2 - Swift ラボで聞いてきた話
Swift Open Hours 2 - Swift ラボで聞いてきた話
Swift Open Hours 2 - Swift ラボで聞いてきた話
Swift Open Hours 2 - Swift ラボで聞いてきた話
Swift Open Hours 2 - Swift ラボで聞いてきた話
Swift Open Hours 2 - Swift ラボで聞いてきた話
Swift Open Hours 2 - Swift ラボで聞いてきた話
Swift Open Hours 2 - Swift ラボで聞いてきた話
?
Swift Open Hours 2 - Swift ラボで聞いてきた話
Swift Open Hours 2 - Swift ラボで聞いてきた話
Swift Open Hours 2 - Swift ラボで聞いてきた話
// 型名につけるとメタタイプが得られる
let type: Int.Type = Int.self // Int.Type
// 評価式に付けると… 評価結果…?
let value: Int = (5 + 3).self // 8
// 普通に計算すれば、掛け算が優先
let a = 1 + 2 * 5 // 11
// 評価式の一部を.self で括ると…
let b = (1 + 2).self * 5 // 15
// でも.self がなくても同じ?
let c = (1 + 2) * 5 // 15
// 先に評価なら、このように Int 型になりそうだが
let a = (1 + 2) as Int * 3.5
// リテラルのまま存続して Double 型に落ち着く
let b = (1 + 2).self * 3.5 // 10.5
Binary operator '*' cannot be applied to operands
of type 'Int' and 'Double'
let value: Int = 10
let value: Double = 10
let value = 10 as Int32
let value = 10 + doubleValue
Swift Lab で聞いてみた!
Swift Open Hours 2 - Swift ラボで聞いてきた話
Swift Open Hours 2 - Swift ラボで聞いてきた話
Swift Open Hours 2 - Swift ラボで聞いてきた話
Swift Open Hours 2 - Swift ラボで聞いてきた話
let answer = (1 + 2) * 3.5
/* 抜粋 */
/* 抜粋 */
/* 抜粋 */
Swift Open Hours 2 - Swift ラボで聞いてきた話
let answer = (1 + 2).self * 3.5
/* 抜粋 */
/* 抜粋 */
/* 抜粋 */
Swift Open Hours 2 - Swift ラボで聞いてきた話
?
/* 再掲 */
Swift Open Hours 2 - Swift ラボで聞いてきた話
Swift Open Hours 2 - Swift ラボで聞いてきた話
Enjoy! Swift
/* Thank you */

More Related Content

More from Tomohiro Kumagai (20)

_Function Builders in Swift #love_swift
_Function Builders in Swift #love_swift_Function Builders in Swift #love_swift
_Function Builders in Swift #love_swift
Tomohiro Kumagai
?
Property Wrappers の特徴を眺める #swiftzoomin
Property Wrappers の特徴を眺める #swiftzoominProperty Wrappers の特徴を眺める #swiftzoomin
Property Wrappers の特徴を眺める #swiftzoomin
Tomohiro Kumagai
?
みんなで Swift 復習会 GO! in "Swift Days Fukuoka" – 12nd′ オープニング&資料
みんなで Swift 復習会 GO! in "Swift Days Fukuoka" – 12nd′ オープニング&資料みんなで Swift 復習会 GO! in "Swift Days Fukuoka" – 12nd′ オープニング&資料
みんなで Swift 復習会 GO! in "Swift Days Fukuoka" – 12nd′ オープニング&資料
Tomohiro Kumagai
?
みんなで Swift 復習会?GO! in 札幌 – 10th′′
みんなで Swift 復習会?GO! in 札幌 – 10th′′みんなで Swift 復習会?GO! in 札幌 – 10th′′
みんなで Swift 復習会?GO! in 札幌 – 10th′′
Tomohiro Kumagai
?
イニシャライザー Part 2.5 #hakataswift
イニシャライザー Part 2.5 #hakataswiftイニシャライザー Part 2.5 #hakataswift
イニシャライザー Part 2.5 #hakataswift
Tomohiro Kumagai
?
ニコニコ超会議?文化の交差点 #techpub #ニコニコ超会議 #さくらシンデレラ
ニコニコ超会議?文化の交差点 #techpub #ニコニコ超会議 #さくらシンデレラニコニコ超会議?文化の交差点 #techpub #ニコニコ超会議 #さくらシンデレラ
ニコニコ超会議?文化の交差点 #techpub #ニコニコ超会議 #さくらシンデレラ
Tomohiro Kumagai
?
Swift クラスのイニシャライザー #devsap
Swift クラスのイニシャライザー #devsapSwift クラスのイニシャライザー #devsap
Swift クラスのイニシャライザー #devsap
Tomohiro Kumagai
?
iOSCon 2019 in London #ioscon #love_swift
iOSCon 2019 in London #ioscon #love_swiftiOSCon 2019 in London #ioscon #love_swift
iOSCon 2019 in London #ioscon #love_swift
Tomohiro Kumagai
?
Around the 変数 let #love_swift
Around the 変数 let #love_swiftAround the 変数 let #love_swift
Around the 変数 let #love_swift
Tomohiro Kumagai
?
もくもく執筆会 #技術同人誌再販Night
もくもく執筆会 #技術同人誌再販Nightもくもく執筆会 #技術同人誌再販Night
もくもく執筆会 #技術同人誌再販Night
Tomohiro Kumagai
?
みんなで Swift 復習会 GO! in 岩手 – 9th′
みんなで Swift 復習会 GO! in 岩手 – 9th′みんなで Swift 復習会 GO! in 岩手 – 9th′
みんなで Swift 復習会 GO! in 岩手 – 9th′
Tomohiro Kumagai
?
macOS アフ?リて? Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アフ?リて? Swift Package Manager を使ってみる #love_swift #hakataswiftmacOS アフ?リて? Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アフ?リて? Swift Package Manager を使ってみる #love_swift #hakataswift
Tomohiro Kumagai
?
みんなで Swift 復習会 GO! in 福岡 – 8th′ #minna_de_swift
みんなで Swift 復習会 GO! in 福岡 – 8th′ #minna_de_swiftみんなで Swift 復習会 GO! in 福岡 – 8th′ #minna_de_swift
みんなで Swift 復習会 GO! in 福岡 – 8th′ #minna_de_swift
Tomohiro Kumagai
?
Getting Started with Attending iOSCon in London 高画質?追記版 #love_swift #ioscon
Getting Started with Attending iOSCon in London 高画質?追記版 #love_swift #iosconGetting Started with Attending iOSCon in London 高画質?追記版 #love_swift #ioscon
Getting Started with Attending iOSCon in London 高画質?追記版 #love_swift #ioscon
Tomohiro Kumagai
?
みんなで Swift 復習会?GO! in 京都 – 6th′
みんなで Swift 復習会?GO! in 京都 – 6th′みんなで Swift 復習会?GO! in 京都 – 6th′
みんなで Swift 復習会?GO! in 京都 – 6th′
Tomohiro Kumagai
?
みんなで Swift 復習会 GO! in 福岡 – 5th′
みんなで Swift 復習会 GO! in 福岡 – 5th′みんなで Swift 復習会 GO! in 福岡 – 5th′
みんなで Swift 復習会 GO! in 福岡 – 5th′
Tomohiro Kumagai
?
勉強会の東京外開催の気持ち #yuru_bounen2017
勉強会の東京外開催の気持ち #yuru_bounen2017勉強会の東京外開催の気持ち #yuru_bounen2017
勉強会の東京外開催の気持ち #yuru_bounen2017
Tomohiro Kumagai
?
みんなで Swift 復習会 GO! in 福岡?発表資料
みんなで Swift 復習会 GO! in 福岡?発表資料みんなで Swift 復習会 GO! in 福岡?発表資料
みんなで Swift 復習会 GO! in 福岡?発表資料
Tomohiro Kumagai
?
Protocol-Oriented Integers に想うジェネリックプログラミングの未来
Protocol-Oriented Integers に想うジェネリックプログラミングの未来Protocol-Oriented Integers に想うジェネリックプログラミングの未来
Protocol-Oriented Integers に想うジェネリックプログラミングの未来
Tomohiro Kumagai
?
技術系同人誌を書こう #love_swift #devsap
技術系同人誌を書こう #love_swift #devsap技術系同人誌を書こう #love_swift #devsap
技術系同人誌を書こう #love_swift #devsap
Tomohiro Kumagai
?
_Function Builders in Swift #love_swift
_Function Builders in Swift #love_swift_Function Builders in Swift #love_swift
_Function Builders in Swift #love_swift
Tomohiro Kumagai
?
Property Wrappers の特徴を眺める #swiftzoomin
Property Wrappers の特徴を眺める #swiftzoominProperty Wrappers の特徴を眺める #swiftzoomin
Property Wrappers の特徴を眺める #swiftzoomin
Tomohiro Kumagai
?
みんなで Swift 復習会 GO! in "Swift Days Fukuoka" – 12nd′ オープニング&資料
みんなで Swift 復習会 GO! in "Swift Days Fukuoka" – 12nd′ オープニング&資料みんなで Swift 復習会 GO! in "Swift Days Fukuoka" – 12nd′ オープニング&資料
みんなで Swift 復習会 GO! in "Swift Days Fukuoka" – 12nd′ オープニング&資料
Tomohiro Kumagai
?
みんなで Swift 復習会?GO! in 札幌 – 10th′′
みんなで Swift 復習会?GO! in 札幌 – 10th′′みんなで Swift 復習会?GO! in 札幌 – 10th′′
みんなで Swift 復習会?GO! in 札幌 – 10th′′
Tomohiro Kumagai
?
イニシャライザー Part 2.5 #hakataswift
イニシャライザー Part 2.5 #hakataswiftイニシャライザー Part 2.5 #hakataswift
イニシャライザー Part 2.5 #hakataswift
Tomohiro Kumagai
?
ニコニコ超会議?文化の交差点 #techpub #ニコニコ超会議 #さくらシンデレラ
ニコニコ超会議?文化の交差点 #techpub #ニコニコ超会議 #さくらシンデレラニコニコ超会議?文化の交差点 #techpub #ニコニコ超会議 #さくらシンデレラ
ニコニコ超会議?文化の交差点 #techpub #ニコニコ超会議 #さくらシンデレラ
Tomohiro Kumagai
?
Swift クラスのイニシャライザー #devsap
Swift クラスのイニシャライザー #devsapSwift クラスのイニシャライザー #devsap
Swift クラスのイニシャライザー #devsap
Tomohiro Kumagai
?
iOSCon 2019 in London #ioscon #love_swift
iOSCon 2019 in London #ioscon #love_swiftiOSCon 2019 in London #ioscon #love_swift
iOSCon 2019 in London #ioscon #love_swift
Tomohiro Kumagai
?
Around the 変数 let #love_swift
Around the 変数 let #love_swiftAround the 変数 let #love_swift
Around the 変数 let #love_swift
Tomohiro Kumagai
?
もくもく執筆会 #技術同人誌再販Night
もくもく執筆会 #技術同人誌再販Nightもくもく執筆会 #技術同人誌再販Night
もくもく執筆会 #技術同人誌再販Night
Tomohiro Kumagai
?
みんなで Swift 復習会 GO! in 岩手 – 9th′
みんなで Swift 復習会 GO! in 岩手 – 9th′みんなで Swift 復習会 GO! in 岩手 – 9th′
みんなで Swift 復習会 GO! in 岩手 – 9th′
Tomohiro Kumagai
?
macOS アフ?リて? Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アフ?リて? Swift Package Manager を使ってみる #love_swift #hakataswiftmacOS アフ?リて? Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アフ?リて? Swift Package Manager を使ってみる #love_swift #hakataswift
Tomohiro Kumagai
?
みんなで Swift 復習会 GO! in 福岡 – 8th′ #minna_de_swift
みんなで Swift 復習会 GO! in 福岡 – 8th′ #minna_de_swiftみんなで Swift 復習会 GO! in 福岡 – 8th′ #minna_de_swift
みんなで Swift 復習会 GO! in 福岡 – 8th′ #minna_de_swift
Tomohiro Kumagai
?
Getting Started with Attending iOSCon in London 高画質?追記版 #love_swift #ioscon
Getting Started with Attending iOSCon in London 高画質?追記版 #love_swift #iosconGetting Started with Attending iOSCon in London 高画質?追記版 #love_swift #ioscon
Getting Started with Attending iOSCon in London 高画質?追記版 #love_swift #ioscon
Tomohiro Kumagai
?
みんなで Swift 復習会?GO! in 京都 – 6th′
みんなで Swift 復習会?GO! in 京都 – 6th′みんなで Swift 復習会?GO! in 京都 – 6th′
みんなで Swift 復習会?GO! in 京都 – 6th′
Tomohiro Kumagai
?
みんなで Swift 復習会 GO! in 福岡 – 5th′
みんなで Swift 復習会 GO! in 福岡 – 5th′みんなで Swift 復習会 GO! in 福岡 – 5th′
みんなで Swift 復習会 GO! in 福岡 – 5th′
Tomohiro Kumagai
?
勉強会の東京外開催の気持ち #yuru_bounen2017
勉強会の東京外開催の気持ち #yuru_bounen2017勉強会の東京外開催の気持ち #yuru_bounen2017
勉強会の東京外開催の気持ち #yuru_bounen2017
Tomohiro Kumagai
?
みんなで Swift 復習会 GO! in 福岡?発表資料
みんなで Swift 復習会 GO! in 福岡?発表資料みんなで Swift 復習会 GO! in 福岡?発表資料
みんなで Swift 復習会 GO! in 福岡?発表資料
Tomohiro Kumagai
?
Protocol-Oriented Integers に想うジェネリックプログラミングの未来
Protocol-Oriented Integers に想うジェネリックプログラミングの未来Protocol-Oriented Integers に想うジェネリックプログラミングの未来
Protocol-Oriented Integers に想うジェネリックプログラミングの未来
Tomohiro Kumagai
?
技術系同人誌を書こう #love_swift #devsap
技術系同人誌を書こう #love_swift #devsap技術系同人誌を書こう #love_swift #devsap
技術系同人誌を書こう #love_swift #devsap
Tomohiro Kumagai
?

Swift Open Hours 2 - Swift ラボで聞いてきた話