3æ1ã3æ¥ã«éå¬ãããtry! Swift Tokyoã«è¡ã£ã¦ãã¾ãããæ±äº¬ã§ã®try! Swiftã¯ä»åã3åç®ã®ã¯ãã§ãããã¼ãã¯ä»åãååå ã«ãªãã¾ãã1åç®ã®éå¬æããåå¨ã¯ç¥ã£ã¦ãã¦ããã®é ããè¡ã£ã¦ã¿ããã¨æã£ã¦ããã¨ãããä»å¹´ãã£ã¨è¡ããã¨ãã§ãã¾ããð
iOSDCãDroidKaigiã¨éã£ã¦ãã¼ã¯ã®ãã©ãã¯ã1ã¤ãªã®ã§ãã©ã®ãã¼ã¯ãèãããã¨è¿·ããªãã¦æ¸ãã®ã¯ããããã¨ãããããã¦ãæµ·å¤ããã®åå è ãå¤ãã®ãç¹å¾´ã§ãããã¼ã¯ã«é¢ãã¦ã¯åæé訳ããããã¬ã·ã¼ãã¼ãåãããã¨ã§ãæ¥æ¬èªãè±èªã®ã©ã¡ããã®å¥½ããªè¨èªã§èããã¨ãã§ãã¾ãã
ã©ã®ãã¼ã¯ãç´ æ´ãããã£ãã®ã§ãããå人çã«å°è±¡ã«æ®ã£ããã®ãããã¤ãç´¹ä»ãã¾ãã
é¢å¿ã®åé¢ã¨åç´åã®ããã®Swiftã³ã¼ãã®æé©å
ã½ã¼ã¹ã³ã¼ãã¯æ¸ããããèªãã»ãã«æéãããããã ããããã åãã³ã¼ãããããä½ããã¦ãããã®ãªã®ããèªãã§ããããããã³ã¼ãã«ãããã¨ãã話ã§ãããããããäºä¾ãæããªãããæå³ãä¼ããã³ã¼ãã«æ¸ãæãã¦ããã¨ãããã®ã§ããã
ã³ã¼ãã¬ãã¥ã¼ãªã©ã®å®åé¢ã§ãæå¹ãªãã®ã ã¨æãã¾ããããã¼ãã¯ããã°ã©ã ã«ã¯ã¢ã¼ãã®å´é¢ãããã¨èãã¦ããã®ã§ããã®ç¹ããããèªã¿æã«æå³ãä¼ããã³ã¼ãã¯ç¾ããã¦ããã¨æãã¾ããã
ã³ã¼ãã¼ããã¶ã¤ã³ãã¹ããªã®ã
åãªãè¦ãç®ã§ã¯ãªãã¦ãããã«æ©è½ãããã¨ãããã¨ããã¶ã¤ã³ã ã¨ããã¹ãã£ã¼ãã»ã¸ã§ããºã®è¨èã®å¼ç¨ãå ã«ãã¨ã³ã¸ãã¢ããã¶ã¤ã³ã«è²¢ç®ã§ããç¹ãæãã¦ãã¾ãããä¾ãã°ãã¨ã³ã¸ãã¢ãªãææ°ã®APIã«ç²¾éãã¦ããããæè¡çã«ä½ãå¯è½ãã¨ãããã¨ãä¼ãããã¨ãã§ããã¨ãããã¨ã§ããã
究極çã«ã¯èª°ãããã¶ã¤ã³ãã³ã¼ãã£ã³ã°ãã§ããã¨ããã®ãçæ³ã§ãããç¾å®ã«ããã¯ãããªãããããã¶ã¤ãã¼ã¨ã¨ã³ã¸ãã¢ãããããã®ç«å ´ã§ååããã£ã¦ãããã«æ©è½ãããããä½ãä¸ãã¦ããã®ã大äºã£ã¦ãã¨ããªã¨ç解ãã¾ããã
ð¾
ãð¾ãã¯ãã¼ã¯ã¿ã¤ãã«ã§ããèªããªãã
Xcodeã¯ã²ã¼ã éçºãã¼ã«ã ï¼ã¨ããï¼ã¼ãã«ã¨ã£ã¦ã¯ï¼è¡æçãªè©±ã§ãSpriteKitãGameplayKitã使ã£ãã²ã¼ã éçºã®ç´¹ä»ã§ãããã©ããã¦ãRikoï¼try! Swiftã®ãã¹ã³ãããã£ã©ã¯ã¿ã¼ï¼ãççºããããããããã¦ã¼ã¢ã¢ã交ããå 容ã§ããã
ãããããæ¬æ¥ã¨ãã¦ã²ã¼ã éçºããããªããã©ãããã©ã¼ã ã®å¤ããèãã¦Unityã¨ãã«ãªããã§ãããããXcodeã ãã§ãããªãã¨ãã§ãããã ã¨ç¥ã£ã¦ãå人ã²ã¼ã ãä½ã£ã¦ã¿ãããªãã¨æãããããå°è±¡ã«æ®ã£ããã¼ã¯ã§ããã
AST ã¡ã¿ããã°ã©ãã³ã°
Swiftã®ASTï¼Abstract Syntax Tree; æ½è±¡æ§ææ¨ï¼ã®è©±ã§ããããããªæ段ã§åºåãããæ§ã ãªASTã®ç´¹ä»ã¨ããããããããã«ã¾ã¨ãã¦æ¯è¼ãã¦ãã¾ãããã¾ããASTãæ´»ç¨ãããã¼ã«ãä½ããã¨ãã話ããã£ã¦ããã®ä¸ã§SwiftPowerAssertãåºã¦ãã¾ããã
Swiftã§Power Assertãä½ã話ã¯ãæ®å¿µãªããå®ç¾ããªãã£ãPEAKSã®ãInside Swiftãï¼æ¸ç±ï¼ã«ãå ¥ãäºå®ã ã£ãã®ã§å人çã«æ°ã«ãªã£ã¦ãããã¨ã§ããã
Swiftã®ã³ã³ãã¤ã«ãã§ã¼ãºã§ã¯ASTãæ¸ãæããæ段ããªãã®ã§ãä¸è¨ã®Power Assertã§ã¯ã½ã¼ã¹ã³ã¼ããæ¸ãæãã¦ã³ã³ãã¤ã«ã«ãããï¼æå¾ã«å ã®ã½ã¼ã¹ã³ã¼ãã«æ»ãï¼ã¨ããæ¹æ³ãã¨ã£ã¦ãã¾ããASTãç´æ¥æ¸ãæãããã¨ãã§ããããã«ãªãã°ããã£ã¨ããããªãã¼ã«ãä¸ã®ä¸ã«ä½ããããã ãªã¨æãã¾ããã
Swift ã«ããã¢ã«ã´ãªãºã ã®å¯è¦å
3次ãã¸ã§æ²ç·ã®æç»ã¢ã«ã´ãªãºã ãSwift Playgroundã使ã£ã¦è§£èª¬ããã¨ãããã®ã§ãããã©ã¤ãã³ã¼ãã£ã³ã°ã§ã¢ã«ã´ãªãºã ã表ç¾ããããã°ã©ã ãæ¸ãã¦ããããã®çµæããªã¢ã«ã¿ã¤ã ã«Playgoundã§ç¢ºèªããã¨ããæµãã§ããããè¯ãå¦ç¿ä½é¨ãå¾ããã¾ããããã¶ããåå ã§ããªãã£ãæ¹ã«ã¯ãã®è奮ã¯ä¼ãããªãã®ã§ãåç»ãå ¬éãããããã²è¦ã¦ã¿ã¦ãã ããããããä¸æã«è§£èª¬ãããªãã¨æã£ã¦ããããNSScreencastã®äººãããããããã£ã解説ã¯ææ £ãããã®ãªãã§ããããã
Swift Playgroundã§UIãå«ããã®ã¯Flappy Birdã®ãµã³ãã«ãªã©ã§ç¥ã£ã¦ã¯ãã¾ããããæ´»ç¨ãã¦ããã¨ãããè¦ãã®ã¯åãã¦ã§ãããããããããããããããæ´»ç¨ä¾ã ã¨æãã¾ããã
UIImageView vs Metal
ã¿ã¤ãã«ã«ãvsãã¨å ¥ã£ã¦ãã¾ãããå®éã«ã¯UIImageViewã¯Metalã使ã£ã¦æ§ç¯ããã¦ãã¾ããå ¤ãããUIImageViewã®ãããªãã®ãMetalã使ã£ã¦èªä½ãã¦ã¿ããã¨ããçµé¨ãå ã«ãMetalãä½ããã£ã¦ããã®ãã¨ããé¨åãéãã¦ãGPUã¬ã¤ã¤ã¼ã«ç®ãåãã¦ã¿ããã¨ãã話ã§ãããStep by Stepã§è©±ãé²è¡ãã¦ãããããããããç´å¾æã®ããå 容ã§ããã
ãªããã¼ãå人ã¯Metalã®ç¥èãå ¨ç¶æã£ã¦ããªãã®ã§ããããããªäººãèå³ãæã¤å°å ¥ã¨ãã¦ã®è©±ã«ãªã£ã¦ããã®ã§ã¯ãªããã¨æãã¾ããPEAKSã®ãiOS 11 Programmingãã®ç¬¬13ç« ã«å ¤ããã«ããMetalã®è§£èª¬ãããã¾ãããããããããããã®å°å ¥ã®ç¶ãã«ãªãã¨æãã¾ãã
ä¸è¨æ¸ç±ã§ã¯ãMetalã®åºç¤ããç´°ãã解説ãã¦ãã£ã¦ãã¼ãã¯ãã£ã¨ããèªãã¦ããªãã¦äººã«åãããªãã¨ã¯è¨ããªãã®ã§ãããèå³ã®ããæ¹ã¯ãã²èªã¾ãã¦ã¿ã¦ã¯ã¨æãã¾ãããiOS 11 Programmingããã¾ã æã£ã¦ããªãã¨ããæ¹ã¯ãä¸ã®ãªã³ã¯ããè³¼å ¥ãã¦ããã ããã¨ã¼ãã«ç´¹ä»æãå ¥ãã¾ãð
ãããã«
ä¸ã«ç´¹ä»ãã以å¤ã«ããå ±å¤æ§ãåå¤æ§ãªã©ã®å¤æ§ã®è©±ãããªãã¨Kotlinã®è©±ãªã©èå³æ·±ããã®ãããããããã¾ãããç´¹ä»ããããªãã®ã§ãããããã§ã
ãªãããã®ãããªãã¼ã¯ã»ãã·ã§ã³ã¯2æ¥éã§ã3æ¥ç®ã¯é½å åæã«åããã¦éå¬ãããã¯ã¼ã¯ã·ã§ããã¨ãã¢ã©ãï¼ããããä¼ï¼ã§ãããã¼ãã¯Firebase Cloud Firestoreã®ã¯ã¼ã¯ã·ã§ããã«åå ããã®ã§ããããã®è©±ã¯æ©ä¼ãããã°å¥ã«æ¸ããã¨æãã¾ãã
ãã¼ã¯ãã¯ã¼ã¯ã·ã§ãã以å¤ã«ããããããªæ¹ã ã«åºä¼ããããããããªããã«ãã£ãããããããèªåã®è±èªåã®ãªãã«è½ã¡è¾¼ãã ãã¨ãæ®æ®µã§ããªãä½é¨ãããã¾ããï¼è±èªåã«ã¤ãã¦ã¯ãæ®æ®µãªãã®åªåããã¦ããªãã®ã§ãã§ããªãã¦å½ããåã§ã¯ããã®ã§ãããåªåããªãããªãã¨çæãã¾ããðï¼ã
try! Swiftã«åå ãã¦ããã£ãï¼ð¤£