Slide 1

Slide 1 text

Swift पใ 2018/09/04 John Lin @johnlinvc

Slide 2

Slide 2 text

From the core • Swift 5: Start your engines

Slide 3

Slide 3 text

Swift 5: Start your engines • Release date: Late 2018 • ໨ඪ: ABI stability (again) ɼแؚ generic, API resilience, memory ownership model • ။޲Լ૬༰ 4

Slide 4

Slide 4 text

Evolution • [SE-0220] count(where:) • [SE-0224] Support 'less than' operator in compilation conditions • [SE-0225] isEven, isOdd, isMultiple • [SE-0226] Package Manager Target Based Dependency Resolution

Slide 5

Slide 5 text

[SE-0220] count(where:) • ཁዎᒬᏐ [1,2,3,4,5,6,7] ཫ໘༗ଟগۮᏐ䏆ʁ [1,2,3,4,5,6,7].filter { $0 % 2 == 0 }.count • Ṝᒬతሜ๏ଖመ䋯తൺֱຫɼfilter ။ઌ䋯Ұ࣍᫮ ᅲɼ count ။࠶䋯Ұ࣍

Slide 6

Slide 6 text

[SE-0220] count(where:) [1,2,3,4,5,6,7].reduce(0) { $0 + ($1 % 2 == 0 ? 1 : 0) } • Ṝᒬతሜ๏䋯తൺֱշɼୠੋ኷೉䔟㣛ੋࡏ၏ॄኄɻ

Slide 7

Slide 7 text

[SE-0220] count(where:) var count = 0 for n in [1,2,3,4,5,6,7] { count += n % 2 == 0 ? 1 : 0 } • ࿨ reduce Ұᒬշɼෆա޷௕ɻ

Slide 8

Slide 8 text

[SE-0220] count(where:) [1,2,3,4,5,6,7].count{$0 % 2 == 0} • ৽⃧ Sequence#countɼ䋯ىိ࿨ reduce Ұᒬշɼ ෆաൺֱ໌֬ɻ

Slide 9

Slide 9 text

[SE-0224] Support 'less than' operator in compilation conditions #if swift(>=5.0) print("this is 5.0") #endif • ݱࡏՄҎ༻্໘తํ๏ိ൑Ꮧ Swift ൛ຊ • ෆա୞ೳ༻ >=ɼཁখԙ୞ೳ༻ ! ိᒾҰෆੋ >= #if !swift(>=5.0) print("this is not 5.0") #endif

Slide 10

Slide 10 text

[SE-0224] Support 'less than' operator in compilation conditions #if swift(<5.0) print("this is not 5.0") #endif • ೭ޙՄҎ༻ < ိ൑Ꮧ Swift ൛ຊ

Slide 11

Slide 11 text

[SE-0225] isEven, isOdd, isMultiple • ᧷ಘ㑌࣍౎ཁሜ n % 2 == 0 ኷൥䆩ʁ • େՈ᧷ಘ -3 % 2 ੋଟগ䏆ʁ

Slide 12

Slide 12 text

[SE-0225] isEven, isOdd, isMultiple • ༗ਓఏҊཁՃ n.isEven, n.isOdd, n.isMultiple(of:) • ࠷ޙ୞༗ n.isMultiple(of:) ௨աɼ။Ճ౸ Swift 5 ཫɻ • ֩৺ᅶୂ᧷ಘ isEven Ṝछ؆ᄸతେՈࣗݾሜब޷ɻ ر๬ೳ೺ޠݴతද໘ੵେখ߇੍޷ɻ

Slide 13

Slide 13 text

[SE-0226] Package Manager Target Based Dependency Resolution • Ұݸ Package ཫ໘ৗৗ༗኷ଟෆಉ target, 㑌ݸ target ౎༗֤ࣗత dependencyɻݱࡏ༻ྃҰݸ Package ब။೺ॴ༗త dependency ౎፛ਐိɼ೭ ޙ୞။፛༗༻౸త targetɻ

Slide 14

Slide 14 text

૓ྛ [SE-0226] Package Manager Target Based Dependency Resolution ߳া ᘈᘈ ᘆࢠ थ

Slide 15

Slide 15 text

૓ྛ [SE-0226] Package Manager Target Based Dependency Resolution ߳া ᘈᘈ ᘆࢠ थ

Slide 16

Slide 16 text

Community • 㟬ঋڃ iOS beta ྃ䆩ʁ • 㟬ใ໊ iplayground ྃ䆩ʁ

Slide 17

Slide 17 text

iOS 12 beta upgrade •

Slide 18

Slide 18 text

iPlayground • https://iplayground.io 10/20(࿡)-21(೔ʣ • ݱਖ਼ᄧථɼ㐸ߘதɻ