iOSã¢ããªãä½ãã¨ãã®ããããæ§æ
2017å¹´æ«ç
ä»ããiOSã¢ããªãä½ãã¨ããããã©ããªæ§æããããããã«ã¤ãã¦ãåãªãã®è¦è§£(å ¨ä½çã«ã¾ãã¾ãã¹ã¿ã³ãã¼ããªãã®ããªã¨èªè¦ãã¦ãã¾ã)ãã¤ãã¤ãã¨æ¸ãã¦è¡ãã¾ãã
ä¼¼ããã®ã¨ãã¦ãYouhei Sugigami ããã以åæ¸ãããè¨äºãããã¾ãããå½æ2016å¹´8æã¨ãããã¨ã§Swift 2æ代ã§ãå®è³ª2ä¸ä»£åã¨ãªã£ã¦ããã®ã§ãä»ã®ã¿ã¤ãã³ã°ã§æ¹ãã¦åãªãã«æ¸ãã¦ã¿ãã®ãè¯ãããªã¨æãã¾ããã
ã¾ãã人ããããè¦è§£ãå¤å°ç°ãªãã¨æãã®ã§ãåãã¿ã¤ãã³ã°ã§ãããã¨ãè²ã ãªæ¹ãæ¸ããã¦ã¿ãã®ãé¢ç½ãé¡æããªã¨ãæã£ã¦ãã¾ã( ´・â¿ï½¥ï½)
ããã§ã¯iOSã¢ããªéçºã«å¿ è¦ãªè¦ç´ ãã¨ã«ã¤ãã¤ãã¨æ¸ãã¦ããã¾ããããããèªããããã¨ããªã¥ã¼ã ãå¢ããããã®ã§ãããã¦ãªãã¹ãæµ ãã«æ¸ãã¦ããã¾ãð¶
é«æ§è½ãªMacãã·ã³ã確ä¿
ã¾ããæè¡çãªãã¨æãã«ä¸å®ä»¥ä¸ã®æ§è½ã®Macãã·ã³ãç¨æããã®ãè¯ãã§ããåã£æããã®åå¼·ç®çãªã©ãªãã¨ããããä¸è¦æ¨¡ä»¥ä¸ã®ã¢ããªãä½ãå ´åä½ã¹ããã¯ãã·ã³ã§ã¯èããéå¹çã§ãã
大ä½ä»¥ä¸ã®ãããªã¤ã¡ã¼ã¸ã§ãããæªæºã ã¨æ©ãã«ãã·ã³å¤ããæ¹ã幸ãã«ãªããã¨æã£ã¦ãã¾ãã
- 2â3年以å ã«è²·ã£ã20ä¸å以ä¸ç¨åº¦ã®MacBook Pro: 許容ç¯å²
- iMac 5K: è¯ãæã
- iMac Pro: ä¸è¬çãªiOSã¢ããªéçºã§ã¯ãªã¼ãã¼ã¹ããã¯æ°å³ã§ã³ã¹ãã¯å¾®å¦ããð¤
ä¼ç¤¾ã§ã交æ¸ãã¦ãä½ã¹ããã¯ç°å¢ãå¼·ããããã®ãªãã°è»¢è·ããæ¹ãè¯ãæ°ããã¦ãã¾ãð¤ã¡ãªã¿ã«è»¢è·ãã©ããã§SWHGã¨ããæå¾ ã³ã¼ãã§ç»é²ããã¨ãäºããããã¤ã³ã²ããã§ããã®ã§ãæ°ãåããããé¡ããã¾ã( ´・â¿ï½¥ï½)
Continuous Integration(CI)ç°å¢
次ã«ãCIç°å¢ã«ã¤ãã¦è§¦ãã¾ããCIç°å¢æ§ç¯ã¯ãã²ã¨æ®µè½ããã¨ããã§æ´ãããã¨ã«ãªããã¡ã§ãããæ©ãã«æ§ç¯ããæèã大äºã ã¨æã£ã¦ãã¾ãããªãã¸ããªä½ã£ã¦æ°è¦ããã¸ã§ã¯ãä½ã£ãããå³æ§ç¯ãã¦ãè¯ããããã«æãã¾ãð¤
ãã¡ãã®è¨äºã«ãåããã¨ãæ¸ããã¦ãã¾ããð
iOSã®CIç°å¢æ§ç¯ã¯æ°å¹´åã¾ã§é£æ度é«ãã§å·¥æ°ãããããã¡ã§ããããæè¿ã¯ä»¥ä¸ã®ä¾¿å©ãªãµã¼ãã¹ã»ãã¼ã«ãããã®ã§ãæ¯è¼ç楽ã«çµããããã«ãªã£ã¦ãã¾ã(ã¨ã¯ããåãã¦ã ã¨ãã£ããã¤ã¾ããã¨ãæãã¾ãã)ã
- 主ãªCIãµã¼ãã¹: Bitriseã»CircleCIã»Travis CIãªã©
- CIæ¯æ´ãã¼ã«: fastlane
å人çãªãªã¹ã¹ã¡ã¯ãBitriseã§ããå¾çºãã¤ã¢ãã¤ã«ã¢ããª(iOSã»Androidã»Xamarinã»Ionicã»Cordovaã»React Native)ã«ç¹åãã¦ãããããã使ããããã§ããBitriseã使ãå ´åã大ãã次ã®2éãã®æ¹éãããã¨æã£ã¦ãã¦ãåã¯æè¿ã¯å¾è ã«ãã¦ãã¾ããfastlaneã¨Bitriseãã©ã¡ãã«ããã¯ã¤ã³ãããã®ã好ãã次第ããªã¨æãã¾ã(ã¡ãªã¿ã«ã©ã¡ããOSSã§ã)ã
- Bitriseã®stepã¯æå°éã«ãã¦ã主ãªå¦çã¯fastlaneå®è¡ã§è¡ã
- Bitriseã®stepã¡ã¤ã³ã«çµã
å¾è ã®å ´åãä¸è¦Bitriseããã¦ã³ããæã»ãµã¼ãã¹ãçµãã£ãæãªã©å°ãããã«æãããããã¾ããããBitrise CLIã§ãã¼ã«ã«å®è¡ãã§ããã®ã§ããã®ç¹ããã¾ãåé¡ãªãã§ããã¾ãä»å¤ã«ç´3.5ååã®è³é調éããããªã©ãé 調ãããªã®ã§ãµã¼ãã¹ãçµãããªã©ã®å¿é ã¯ãã°ããã¯ææã ã¨æã£ã¦ãã¾ãð¤
ã¾ããXcode 8ããAutomatic Signingãå°å
¥ããã¦ãã¾ãããfastlaneã¯ããã¨ã®ç¸æ§ãå¾®å¦ãªä¸æ¹ãBitriseã¯ã¾ãã¾ãç¸æ§è¯ãããã«æè¿ãããããã«ãããããæ¹åãããã®ã§ãããããé¢ã§ãããããã§ãã
(fastlaneã§ã¯ä»çµã¿ã¯ç°ãªãã¾ãã match ã§ãã®ããã楽ã«ã§ãã¾ãã)
ä¸æ¹ãfastlaneãã¾ã betaãªããRubyã ãã§ã¯ãªãSwiftã§ãæ¸ããããã«ãªãããã¡ãã注ç®ã§ãð åãã³ã³ã»ããã® kdawgwilk/Autobahn ã¨ãããã®ããã£ãã®ã§ãããæ¬å®¶ã§å¯¾å¿ãããã¨ããã役御å ãªæãã§ãããð
ããããã°æè¿ã©ã®CIãµã¼ãã¹ä½¿ã£ã¦ãããã¢ã³ã±ã¼ãåã£ã¦ã¿ãã®ã§ãåèã«ã©ããã§ã:
ã¢ããªé å¸
ã¾ããCIç°å¢ã§ãªãããå¦çã¨ãã¦ã¯ã¢ããªé å¸ãããã¾ãããä»ã¯æ¬¡ã®æ§æãã¹ã¿ã³ãã¼ãã ã¨æãã¾ããã©ã¡ããã¨ã¦ãç°¡åã§ãã
- AdHocçãFabric Betaã§é ä¿¡
- TestFlightçãiTunes Connectã§é ä¿¡
ããã¸ã§ã¯ãæ§æ
次ã«ãã¢ããªãªåºæ¬æ§æã§ãããä¸è¦æ¨¡ä»¥ä¸ã®ã¢ããªã¯Embedded Frameworkã使ã£ã¦é©å½ã«ã¢ã¸ã¥ã¼ã«ãåãããã¨ããããããã¾ãã次ã®è¨äºã¯2å¹´åã®ãã®ã§ãããä»ãã»ã¼ãã®ã¾ã¾éç¨ããå 容ã ã¨æã£ã¦ãã¾ãã
ã¢ã¸ã¥ã¼ã«åå²ç²åº¦ã¯ãªãã¨ãªã3â5ã¤ããããé©åº¦ããªã¨æã£ã¦ãã¾ããè¨è¨çã«ã¯æ¬æ¥ãã£ã¨ç´°ãããããããªãã¨ããã§ãããã¢ã¸ã¥ã¼ã«æ°ãå¢ããããã¨èµ·åæéãé ããªãåé¡ãããã¾ãããã ããã®åé¡ãç¹ã«é¡èãªã®ã¯ã端æ«åèµ·åã»ã¢ããªããã°ãã使ã£ã¦ããªããªã©ã§ã¢ã¸ã¥ã¼ã«ã®ãã£ãã·ã¥ãã¯ãªã¢ããã¦ãã¾ã£ã¦ããæã®èµ·åæéã§ããã常ç¨ãã¦ããã¢ããªãåèµ·åããæãªã©ã¯å¤§æµã¢ã¸ã¥ã¼ã«ã®ãã£ãã·ã¥ãå¹ãã¦ãããããã®å½±é¿ã¯å°ãªãç¹ã«é ãæãã¾ããããã®ããå人çã«ã¯ãèµ·åæéåé¡ã¯ããã¾ã§æ°ã«ããããªãããã«ãã¦ãã¾ã(ã¦ã¼ã¶ã¼ã¨ãã¦ã常ç¨ãã¦ããã¢ããªãæ¯åèµ·åæéé·ãã¦ã¹ãã¬ã¹ã«æãããã¨ç¡ãã®ã§)ã
è¨è¨çã«ã¯æ¬æ¥ãã£ã¨ç´°ãããããããªãã¨ããã§ãããã¢ã¸ã¥ã¼ã«æ°ãå¢ããããã¨èµ·åæéãé ããªãåé¡ãããã¾ãã
ã¡ãã£ã¨è足ã§ãããSwift Package Manager(SwiftPM)ã§CLIãã¼ã«ä½ã£ãããµã¼ãã¼ãµã¤ãSwiftã®å ´åã¯ãã®ãããåé¡ã«ãªããªãã®ã§ãã¢ã¸ã¥ã¼ã«åå²ç²åº¦ãç´°ãããªãå¾åãããã¨æãã¾ãã
ãµãã¼ãiOSãã¼ã¸ã§ã³
ã¾ããã©ã®çã¾ã§ã®iOSãã¼ã¸ã§ã³ããµãã¼ããããã©ããããã®å¾ã®éçºå¹çã«é¢ãã£ã¦ããã®ã§å¤§äºã§ããã»ãªãªã¼ã¯Appleãæ¨å¥¨ãã¦ããç´è¿2ãã¼ã¸ã§ã³ãµãã¼ã(iOS 11ãææ°ã®ä»ã§ã¯iOS 10以éãµãã¼ã)ã ã¨æã£ã¦ãã¾ããç´è¿2ãã¼ã¸ã§ã³ãµãã¼ãããã°æ¦ã95%ãããã®ã¦ã¼ã¶ã¼ã¯ã«ãã¼ã§ãã¾ãããã ããã£ã¨ä½ãã¦ãéçºå¹çä¸ãããã¨æããã°ææ°ãã¼ã¸ã§ã³ã®ã¿ã®ãµãã¼ãã§ãè¯ãã§ãããéã«ãã®5%ãã«ãã¼ããã¡ãªããã大ã§ããã°éçºã³ã¹ããå¢å¤§ããã®ã許容ãã¦ãã®å¤æããã®ãååããã ã¨æã£ã¦ãã¾ããè¦ã¯ã¦ã¼ã¶ã¼ã«ãã¼çã»éçºã³ã¹ãã®æå¾åå®ãåççã«å¤æããã®ã大äºã§ãã
ãã ãç¾ææ°çã§ããiOS 11ã®äºæ èæ ®ããã¨ãiOS 10ã¨11ã§ã¯ç¹ã«UIå¨ãã§Safe Areaçé ã«å·®ããããiOS 10ãåãã¨ãã£ãã楽ã«ãªãã®ã§ãç¹ã«ä»ããä½ãæ°è¦ã¢ããªã§ã¯iOS 11以ä¸ã¨ããå¤æã¯ãã£ããè¯ãã®ã§ã¯ã¨æã£ã¦ãã¾ã(åãä»éçºä¸ã®æ°è¦ã¢ããªããããã¦ãã¾ã)ããã®å¤æã¯OSãã¼ã¸ã§ã³éã«ãã£ã¦å·®ããã£ã¦ãä¾ãã°iOS 9ã¨10ã§ã¯éç¥APIã®å·®ãæ°ã«ãªãç¨åº¦ã§ãã以å¤ãã¾ã9ãåããããªãåæ©ç¡ãã£ãã§ãããiOS 6ã¨7ã¿ããã«ãã©ããUIåããã¿ã¤ãã³ã°ã§ã¯ä¸¡å¯¾å¿ã®æéãããªã大ããå¤ãçãåãããã¨å¼·ãæãã¾ããã
ã¾ããæ°è¦ã§ã¯ç´è¿2ãã¼ã¸ã§ã³ã®ãµãã¼ããªã©ã¨ãã¦ããæ¯å¹´ç§ã®iOSã¡ã¸ã£ã¼ã¢ãããã¼ãã®ã¿ã¤ãã³ã°ã§æ½ãå¤ããã¼ã¸ã§ã³ã®ãµãã¼ããåããã«ãºã«ãºã«ãµãã¼ãç¶ãã¦ãã¾ãå°ããã¤éçºè² è·ãé«ããªã£ã¦ãããã¨ããããã¡ãªã®ã§ãå¤ããã¼ã¸ã§ã³ãåããªããç¶ç¶çã«å¤æãã¦ããã®ã大äºã§ãã
ã¾ã¨ããã¨ããããªæãã§ãããã
- ã»ãªãªã¼ã¯ç´è¿2ãã¼ã¸ã§ã³ã®ãµãã¼ã
- 3ãã¼ã¸ã§ã³ä»¥ä¸ã®ãµãã¼ããåççãªå¤æããªããã¦ããã°ååããã ã¨æã
- ãã¼ã¸ã§ã³éã®å·®ã大ããã¦ãããå·¥æ°å¢ã«ç¹ããå ´åãç¹ã«æ°è¦ã¢ããªã§ã¯ææ°ãã¼ã¸ã§ã³ã®ã¿ã®ãµãã¼ããããã ã¨æã
ã©ã¤ãã©ãªã®å°å ¥æ¹æ³
ã©ã¤ãã©ãªã®å°å ¥æ¹æ³ã¨ãã¦ã¯ã以ä¸ãªã©ããã£ã¦ãCarthageã»CocoaPodsã使ããã¨ã大åã ã¨æãã¾ãã
- Carthage
- CocoaPods
- Git Submodule(Subtree)
- ç´æ¥ã½ã¼ã¹è¿½å
å人çã«ã¯ãCocoaPodsã§ããã¸ã§ã¯ããã¡ã¤ã«ãå¼ããã¦ãã¾ããã¨ã«èµ·å ãããã©ãã«ãå¤ãã¦ããªãã¹ãCarthageã«çµ±ä¸ãããã¨ãããªãã®ã®ãCocoaPods使ããããããªãã¡ã¸ã£ã¼ãªSDKããã£ãããã£ãããã¦æ©ã¾ããã§ã ð¤
ã¾ããCocoaPodsã»Carthageã§ã¤ã³ã¹ãã¼ã«ããææç©ããã¼ã¸ã§ã³ç®¡çã«å«ããããè²ã æµæ´¾ãããããã®ãããã¯æ¬¡ã®è¨äºã§æ¸ãã¾ããã®ã§ããåèã«:
UIã®çµã¿æ¹
次ã«UIãã©ãçµãã®ããªã¹ã¹ã¡ãã«ã¤ãã¦ã®åã®è¦è§£ãæ¸ãã¦ããã¾ãã
1 Storyboard â 1 ViewController
Storyboardã¯Xcode 4.2ããå°å ¥ãããããã¾ã§ã®Xib(Nib)ã«æ¯ã¹ã¦ç»é¢é·ç§»ãªã©ã表ç¾ã§ãããã¨ã主ãªã¡ãªããã¨ãã¦æãããã¦ãã¾ããã1 Storyboardã«ããããã®ViewControllerãè©°ãè¾¼ãã§ããã¨ã次ã®ãããªãã¡ãªãããåºã¦ãã¾ãã
- è¤æ°äººéçºã§ã³ã³ããªã¯ããå¤çº
- éããªã
- ä¸è¦§æ§ãå¾®å¦
ãªã®ã§ãæè¿ã¯1 Storyboard â 1 ViewControllerã«ããã®ãã¹ã¿ã³ãã¼ãã«æãã¦ãã¦ãåããã£ããåãããããã¦ãã¾ã(é¢é£æ§ã®é«ãæ°ç»é¢ã1 Storyboardã«å ¥ãããã¨ãããã¾ãã)ã
ããããã¨ãStoryboardã®Segueã§ãµãã¼ããã¦ããç»é¢é·ç§»ãã©ãããã®ãã¨ãããã¨ã«ãªãã¾ããã次ã®ãããããããã°è¯ãã ãã§å°ãã¾ããã
- æ®éã«ã³ã¼ãã§æ¸ã
- Storyboard Reference (Xcode 7以é) ãå©ç¨
åã¯Segueã®ã¡ãªãããç解ã§ããªãã®ã§ã»ã¼ä½¿ããã«ãç»é¢é·ç§»ã¯åºæ¬çã«ã³ã¼ãã§æ¸ãã¦ãã¾ãã
ã¾ããViewControllerã¯Xibã§ãçµãã¾ãããStoryboardã¯Xibã®ä¸ä½äºæãªã®ã§Storyboardã使ã£ãæ¹ãè¯ãã§ãã
UIãStoryboardã»Xibã§çµããã³ã¼ãã§çµãã
UIãStoryboardã§çµããã³ã¼ãã§çµããã¯ã度ã 話é¡ã«ãªãã¾ãããåã¯ä»¥ä¸ãã¹ã¿ã³ãã¼ãã ã¨æã£ã¦ãã¦ããããã¦ãã¾ãã
- Storyboardã§æ¸ãããã®ã¯ãã¡ãã§æ¸ã
- Storyboardä¸ã§ã¯ä¸å¯è½ãªè¨ç®ãå¿
è¦ã ã£ããåçã«åãããããããã®ã¯Storyboardã§å®ç¾©ãã
NSLayoutConstraint
ãIBOutlet
ã¨ãã¦æã£ã¦ãã¦å¤ãæ¸ãæã - ã³ã¼ãã§å®ç¾©ããªãã¨è¡¨ç¾ã§ããªã(ãããã¯ã¨ã¦ãããã«ãã)ãã®ã ãã¯ã³ã¼ãã§å®ç¾©(ãã®å ´åãXibãè¤æ°ä½ã£ã¦æ¡ä»¶ã«ãã£ã¦åºãåãã¨ãããã¿ã¼ã³ãæå¹)
Storyboardä¸ã§è²ã
è¨å®ããç
©éããªã©ã¯ãããã®ã®ãè¨å®ããææ群ãçµæã©ããªããããã¢ããªå®è¡åã«Storyboardä¸ã§è¦è¦çã«ç¢ºèªã§ãããè¦åãè¦ããã¨ããã¡ãªããã¯å¤§ããã§ããç¹ã« Priority
ãå¼ãåºãã¨ãã³ã¼ãã§æ¸ãå ´åã¯å®éã«ã©ãã¬ã¤ã¢ã¦ããããã®ãããã«ãåã«ãªããªãèªä¿¡ãæã£ã¦ã¤ã¡ã¼ã¸ã§ããªãã§ãã
ã¨ã¯ããããã¹ã¦ã³ã¼ãã§æ¸ãæ¹ããã¹ã¦ã®å®ç¾©ã表ã«åºã¦åãããããã¨ããæè¦ãç解ã§ãã¾ããã¾ããã³ã¼ãã§æ¸ãã¦Playgroundä¸ã§æç»ããã¨Storyboardä¸ã§æ¸ãã®ã¨åæ§ãªã¡ãªããã享åã§ããã®ã§ããããããããªã¨ã¯æã£ã¦ãã¾ã(åã¯å®éã«ããã§éçºãé²ãããã¨ã¯ãªãã§ãã) ð¤
ã¾ããAuto Layoutã¯ãã®æ¬ããªã¹ã¹ã¡ã§ããXcode 7æ代ã®ãã®ãªã®ã§ãSafe Areaãªã©ã«ãã¼ã§ãã¦ãªãã¨ãããããã¾ãããAuto Layoutã®èã¨ãªãé¨åã¯å½æã¨å¤ãããä»ã§ãååéç¨ããæ¬ã§ãã
ç¹ã«ãUIStackViewã»ãµã¤ãºã¯ã©ã¹ã»ãã¬ã¤ããããã«ãã¡ãã¿ã¼ã³ãªã©ã«ã¤ãã¦å°ãã§ãä¸æç¹ããã°ä¸èªãªã¹ã¹ã¡ãã¾ãã
ã¨ããããFirebase
ããããããããã©ã¤ãã©ãªãªã©ã®è©±ã«ç§»ã£ã¦ããããã¨ããã§ããããã®åã«Firebaseã«è§¦ãã¾ãã
å®ã¯ãã1ã»2å¹´ã®ã¢ããªéçºã§å¤§ããæ å¢ãå¤ãã£ãã®ã¯ãFirebaseå¨ãã§ã¯ç¡ãã§ããããããã£ã¨ãã3å¹´ã»ã©ã®æµããã¾ã¨ãã¦ã¿ã¾ããã
- 2014/10: GoogleãFirebase(ãªã¢ã«ã¿ã¤ã ãã¼ã¿åæãµã¼ãã¹)ãè²·å
- 2015/05: Google I/O 2015ã«ã¦ãFirebase Realtime Databaseã®ãªãã©ã¤ã³ãµãã¼ã
- 2016/05: Google I/O 2016ã«ã¦ãFirebaseãmBaaSã¨ãã¦å¤§é²å(Authenticationã»Analyticsã»FCMãªã©å¯¾å¿)
- 2017/01: GoogleãFabricãè²·å
- 2017/03: Cloud Functions for Firebaseãªãªã¼ã¹(β)
- 2017/05: Google I/O 2017ã«ã¦ãFabricçµ±åãªã©
- 2017/10: Cloud Firestoreã¨ããRealtime Databaseå¾ç¶ã¨è¨ãããGoogleã®ã¤ã³ãã©ãæ´»ç¨ãããå¼·åãªãªã¢ã«ã¿ã¤ã ãã¼ã¿ãã¼ã¹ããªãªã¼ã¹(β)
ãã®éã2016å¹´1æã«Facebookã®è²·åãããParseã¨ããmBaaSã1å¹´å¾ã«ãµã¼ãã¹ãéãããã¨ãã¢ãã¦ã³ã¹ããã¦ãmBaaSã®æ¬å½çãªãã®ãä¸å¨ã«ãªãã¾ãããã¨ããããFirebaseã®ãã1ã»2å¹´ã®ææ¶ã®å±éã§Parseãããã£ã¨ä¸åãå§åçãªå®æ度ã®mBaaSã¨ãã¦è²ã£ã¦ããã¦ãã¢ããªéçºè ã¨ãã¦ãã¨ã¦ããããããã§ãð
ãµã¼ãã¼ãµã¤ãã¨ã®å ¼ãåã次第ã§ã¯ããã¾ãããç¹ã«æ°è¦ã§ä½ãå ´åã¯æ¬¡ã®è¦ç´ ã¯ã¾ãFirebaseã§æ¸ã¾ãªããæ¤è¨ããã®ãè¯ãã¨æãã¾ã(ããã¦ã大å¤è¯ãã§ãã¦ããã®ã§Firebaseã§æ¸ããã¨ãå¤ãã¨æãã¾ã)ã
- èªè¨¼
- ã¢ããªãã£ã¯ã¹
- ãã¼ã¿ãã¼ã¹(RDBã¨ã¯éãã®ã§å®å ¨ã«é ¼ãããã¯ãµã¼ãã¹æ¬¡ç¬¬)
- ã¹ãã¬ã¼ã¸(ç»åã¢ãããã¼ããªã©)
- ã¯ã©ãã·ã¥ã¬ãã¼ã
- ããã·ã¥éç¥
- ããã©ã¼ãã³ã¹è¨æ¸¬
- ABãã¹ã
- Universal Links(Dynamic Links, ãµã¤ãã®ã³ã³ãã³ãã¨1対1対å¿ããããå ´åã«ã¯ããä¸åã)
- åºå
Fabricãè²·åãããã¨ããããã¢ããªé ä¿¡ããã®ãã¡Firebaseã§ã§ããããã«ãªãæ°ããã¦ãã¾ã ð¤
ã¡ãªã¿ã«ãä»éçºä¸ã®ã¢ããªã§ã¯ãµã¼ãã¼ãµã¤ãã¯ä»ã®ã¨ãããã¹ã¦Firebaseã§æ¸ãã§ãã¾ã(å¾ã ãè¦ä»¶ãå¢ãã¦ãããGAEãªã©ã§æ¡å¼µãããå¾ãããï¼ã¨ãæãã¤ã¤)ã
ã©ã¤ãã©ãªé¸å®
次ã«ã©ã¤ãã©ãªé¸å®ã§ãã
åæã¨ãã¦ãæè¿ã¯Swiftã®è¨èªæ©è½ã»è¡¨ç¾åãä¸ãããã¾ãæ¨æºã©ã¤ãã©ãªãã¡ããã¡ããè¯ããªã£ã¦ãã¦ããã®ã§ã以åã¨æ¯ã¹ã¦ã©ã¤ãã©ãªã®å¿ è¦æ§ã¯æ¸ã£ã¦ãã¦ããã¨æãã¾ãããªã®ã§ãä¸ã«æãããã®ã¯ä½¿ããã«èªåã§æ¸ãã¨ããé¸æè¢ãããã§ããã©ã¤ãã©ãªã使ããªãã¨èªåã§æ¸ãã³ã¼ãéã¯å¤å°å¢ãããã®ã®ããã©ãã¯ããã¯ã¹é¨åãæ¸ã£ã¦(ãã¡ããOSSã ã¨ã½ã¼ã¹ã¯ç¢ºèªã§ãã¾ãã常ã«å ¨è¡ææ¡ãã¦ããããã§ã¯ãªãã®ã§)ããããæ¸ãããããªããã¨ããããã¨æãã¾ãã
å種ãªã½ã¼ã¹ã¢ã¯ã»ã¹ã¸ã®åä»ã
å種ãªã½ã¼ã¹ã¸ã®åä»ãã«ã¯ Mathijs Kadijkããä½ã® R.swift ããªã¹ã¹ã¡ã§ãã
主ã«æ¬¡ã®ãããªæµãã§ä½¿ãã¾ãããå
±éçãªå¦çã¯ã³ã¼ãã¸ã§ãã¬ã¼ã·ã§ã³å´ã§ Rswift
ãã¬ã¼ã ã¯ã¼ã¯ã¨ãã¦åç
§ãããããã«ãªã£ã¦ããã®ã§ãã©ã¤ãã©ãªã¨ãã¦ã®ã¤ã³ã¹ãã¼ã«ãå¿
è¦ã§ãã
- ããã¸ã§ã¯ãå ã®ãªã½ã¼ã¹ç³»ãã¡ã¤ã«ãå ã«ã³ã¼ãã¸ã§ãã¬ã¼ã·ã§ã³
R.
ã§å種ãªã½ã¼ã¹ã«ã¢ã¯ã»ã¹ãã¦ä½¿ç¨
åã¯ããããã³ã¼ãã¸ã§ãã¬ã¼ã·ã§ã³ç³»ã¯å©ç¨ã«å°ãæµæããã£ãã®ã§ããããªãªã¼ã¹å¾3å¹´çµã£ã¦æ¯ãã¦ãã¦ãã¦(ã¨ã¯ããéçºãã¾ã ã¾ã æ´»çº)ãè©å¤ãè¯ãã®ã§ããã¨æè¿ä½¿ãå§ãã¦ã使ãåæè¯ãã¨ã¦ããªã¹ã¹ã¡ã ã¨æã£ã¦ãã¾ãã
Xcode æ°æ©è½ã¸ã®è¿½å¾ãã¨ã¦ãæ©ãã§ã ð
é¡ä¼¼ã©ã¤ãã©ãªã¨ãã¦ã¯ã SwiftGen ãããã¾ãã
[追è¨] takasek ããããSwiftGenå¨ãã¬ã¹ãã³ã¹ããã ããã®ã§ãè¼ãã¦ããã¾ã:
åã®åç:
Lint
Lintç³»ãã¼ã«ã¯ãSwiftLintä¸æã§ãããæªã ã«æ©è½è¿½å ãæ´»çºã§ãã¢ãããã¼ãããã¨æ°ããè¦åãå¢ãã¦ããããã¾ã( ´・â¿ï½¥ï½)
ããã©ã«ãã§ã¯ãã¾ã«ä½è¨ãªãä¸è©±ã«æããææãããããããã¾ããããããã¯ç¡å¹åããã°è¯ãã ããªã®ã§ãå¿ è¦ãªé¨åã ããã¾ãæ´»ç¨ããã¨è¯ãã®ã§ã¯ã¨æãã¾ãã
Homebrewã§ãã¤ã³ã¹ãã¼ã«ã§ãã¾ãããCocoaPodsçµç±ã§ã¤ã³ã¹ãã¼ã«ããã¨è¤æ°äººéçºã§ãã¼ã¸ã§ã³ãåããããããªãããã¡ãããªã¹ã¹ã¡ã§ãã
swiftlint autocorrect
ãå®è¡ããã¨ãå¯è½ãªãã®ã«ã¤ãã¦ã¯èªåä¿®æ£ãã¦ãããã®ã§ãç¹ã«ååå°å
¥æã¯ã¾ããããå®è¡ããã¨è¯ãã§ãã Build Phases
ã§ã®å®è¡ã autocorrect
ãªãã·ã§ã³ä»ãã§è¯ãããï¼ã¨æã£ããã®ã®ããã«ãä¸ã«ã³ã¼ããå¤æ´ããã¨ãã®å¤æ´ã¨ autocorrect
ã«ããå¤æ´ã競åãã¦ã©ã¡ããåªå
ãããã®ãã¤ã¢ãã°ãã¡ããã¡ããåºãã®ã§ãç¾ç¶ã§ã¯ãããããã¾ããã
ã¡ãªã¿ã«ãXcodeã®Fix All Issuesæ©è½ã¯Xcodeæ¨æºã§æ¤åºãããè¦åã対象ãªã®ã§ãSwiftLintã§çºçããè¦åã®ä¸æ¬è§£æ¶ç®ç( autocorrect
ç®ç)ã«ã¯ä½¿ãã¾ããð
ââï¸
éåæå¦ç
éåæå¦çã®çµ¡ãã¡ã½ããã¯ãã¿ã«æ¸ãã¨ãçµæéç¥ã¯ã³ã¼ã«ããã¯å½¢å¼ã«ãªãããããé£ç¶ããã¨ãã®ãã¹ããæ·±ããªã£ã¦å¯èªæ§ã»ã¡ã³ããã³ã¹æ§ãèããè½ã¡ã¦ãããããä¸è¦æ¨¡ä»¥ä¸ã®ã¢ããªã§ã¯ãã®è§£æ±ºã¯å¿ é ã ã¨æã£ã¦ãã¾ãã
ãã®è§£æ±ºã¨ãªãã©ã¤ãã©ãªã¯ããã¤ãããã¾ããã ReactiveX/RxSwift ãæãããã¥ã©ã¼ã§ããRxSwiftãå°å ¥ãã¦ä½¿ãããªãã¨ãä¸ã§æ¸ãã課é¡ã®è§£æ±ºä»¥å¤ã«ãæ§ã ãªå©ç¹ãããã¾ãããå人çã«ã¯ç¹ã«MVVMæ¯æ´ç³»æ©è½ãªã©ã¯ç¹ã«ä½¿ã£ã¦ãã¾ãã(iOSã¢ããªéçºã«ããã¦ãã¤ã³ãã£ã³ã°æ©æ§ãå ¬å¼ã«ãµãã¼ãããããã®ã§ã¯ç¡ããã¾ã使ãåæè¯ãæããªããªã©ã®çç±ã«ãã)ã
ã¾ããRx(Reactive Extensions)ã¯2009å¹´ã«Microsoft Researchãå ¬éããã®ãååºã§ã2011å¹´ãããã«ã¯.NETã§ã¯æ®éã«ä½¿ããå§ãããã®å¾åºæ¬çãªæ¦å¿µã¯ãã®ã¾ã¾ã«å種ãã©ãããã©ã¼ã ã§ã®ã©ã¤ãã©ãªãå å®ãã¦ããã¨ããçµç·¯ããããã¨ããããããè¦ãã¦ããã°æ±ç¨çãªç¥èã身ã«ä»ãã¨ããå°è±¡ãããã¾ã(åèªèº«2012å¹´é ã«C#ã§è§¦ãã¦ã¦ããã¯è¯ããªã¨æã£ã¦ããã®ãSwiftã«ãæ¥ã¦è¿·ããé£ã³ã¤ããæãã§ãã)ã
é¡ä¼¼ã©ã¤ãã©ãªã¨ãã¦ã¯ã ReactiveCocoa/ReactiveSwift ãªã©ããã¾ãã
ãããã¯ã¼ã¯ã¢ã¯ã»ã¹
ãããã¯ã¼ã¯ã¢ã¯ã»ã¹ã©ã¤ãã©ãªã¯ããªãã¨ãªãä¸ççã«ã¯Moya( Alamofire ã«ä¾åãã¦ãã)ãå®çªãªæ°ããã¦ãã¾ã ð¤
[2020/02 追è¨] APIKitã¯ä½è ã«ããã¡ã³ããæ¢ã¾ã£ã¦ããã®ãããä»ããé¸ã¶ãªãMoyaä¸æãªæ°ããã¾ã
å人çã«ã¯ã APIKitã好ãã§ä½¿ã£ã¦ãã¾ãã以åã¯ã¬ã¹ãã³ã¹ã®JSONãã³ã¼ãå¦çã«Himotokiãçµã¿åããã¦ä½¿ã£ã¦ãã¾ããããSwift 4ã§å°å ¥ãããCodableã«ãã£ã¦å¤§æµã®ã±ã¼ã¹ã§ã¯ä¸è¦ã«ãªãã¾ããã
ãã ãAPIKitã¯æè¿ããªãéçºé »åº¦ãä½ä¸ãã¦ãã¦æä½éã®è¨èªã¢ãããã¼ã対å¿ç¨åº¦ããè¡ããã¦ããªãç¶æ ã§ãä»å¾ã®æ©è½æ¹åãªã©ã¯ãã¾ãæå¾ ã§ããªãããããã¾ãã ð¤ ãã®ãããä»ããé¸ã¶ã®ã«ã©ãããªã¹ã¹ã¡ãã¨è¨ãããã¨ãé£ããã§ãã
URLSessionã使ãããããªã£ã¦ããã®ã§ããã¹ã¦èªåã§æ¸ãã®ãååããããªã¨ã¯æãã¤ã¤ãçµå±APIKitç¸å½ã®ãã¨ãæ¸ããããªãã¨ã«ãªãã®ã§ããã®æéã¯ãªãã¹ãå°ãªããããã¨ããã§ã¯ããã¾ã ð¤ ãªã®ã§æ¯è¼çã·ã³ãã«ã«ãã®ãããã解決ãã¦ãããAPIKitã¯ãã¯ãè¯ããã®ã ãªã¨æã£ã¦ãã¾ãã
ã¾ãããããã¯ã¼ã¯ç¶æ ããã§ãã¯ããæã¯ashleymills/Reachability.swift ãåããã¦ä½¿ã£ã¦ãã¾ãããªãã©ã¤ã³ã§APIã¢ã¯ã»ã¹ãã¦ããªãã©ã¤ã³ç³»ã®ã¨ã©ã¼ã帰ã£ã¦ããã®ã§æä½éããã§ããªãã¨ããªãã¾ããããããã¯ã¼ã¯ç¶æ ãåãã£ã¦ææ¡ãããã¨ã«ãã£ã¦ã¹ã ã¼ãºãªãã³ããªã³ã°ãæé©ãªUI表示ãã§ãã¾ãã
ç»é¢é·ç§»
ã«ã¼ãã£ã³ã°ã©ã¤ãã©ãªã¨ãã¦ã¯hyperoslo/Compassãå®çªã ã¨æãã¾ãããã¹ã«å¯¾å¿ããenumã switch-case
ã§ãã³ããªã³ã°ãã¦ã©ã®ç»é¢ã«ã©ãé·ç§»ããããè£å©ããã©ã¤ãã©ãªã§ããã
ä»æããã£ã¦ãããã®è¨äºã®èª¬æãè¯ãæãã§ã:
ã¾ãã AppDelegate
ã® window
ã® rootViewController
ã®åãæ±ãã大äºã§ãããã¾ãæè¿ããã£ã¦ãããã®è¨äºã®èª¬æãè¯ãã§ãã
y.imajoããã®æ¬¡ã®ã¹ã©ã¤ããä½µèªããã¨ç解ãããããã¨æãã¾ãã
- AppRootControllerã®ãææ¡ï¼ç°¡ç¥èª¬æçï¼
- AppRootController ã使ã£ã¦ã¹ãã©ãã·ã¥ã¢ãã¡ã¼ã·ã§ã³ãå®è£ ãã 2017 å¬ // Speaker Deck
å人çã«ã¯ã ã¾ãrootViewController
ã®åãæ±ããæéè¦ã§ãããã«è¯ãæãã®ã«ã¼ãã£ã³ã°å¦çãçµã¿åããã¦ãã£ã¼ããªã³ã¯ãã³ããªã³ã°ããããããã¨ãã¿ã¼ãã¿ãããªæè¦ã§ãã¾ãã
Auto Layout
åè¿°ã®éããUIã®å®è£ ã¯Storyboardã»Xibãã¡ã¤ã³ã¨ããã®ãã¹ã¿ã³ãã¼ãã ã¨æã£ã¦ãã¾ããããã§ããã³ã¼ãã§æ¸ãå¿ è¦ã«è¿«ããããã¨ã¯ãã°ãã°ããã¾ããããã®éã¯NSLayoutAnchorã®ä½¿ããiOS 9以éã§ã¯ã©ã¤ãã©ãªä½¿ããã«æ®éã«ç´æ¸ãããã®ãè¯ãã¨æã£ã¦ãã¾ãã以åãSnapKitã使ã£ã¦æ¸ãã¦ããã³ã¼ããNSLayoutAnchorã§ç´æ¸ãããããã«æ¸ãæãã¾ããããã³ã¼ãéã¯ã»ã¨ãã©å¢ãããã¾ãã©ã¤ãã©ãªä¸ä½¿ç¨ã®æ¹ãAuto Layoutæ¦å¿µã¨1対1対å¿ããã®ã§èªä¿¡ãæã£ã¦æ¸ããæãããã¾ããã
ãã ãNSLayoutAnchorã¯ä»¥ä¸ã®å¦çãå¿ãããã¹ãããã¡ãªã®ã§ãããã¯ååæ°ãã¤ããããããã¯èãã©ããé¢æ°ãæ¸ããªã©ã¯ããæ¹ããã¿ã¼ããããã¾ããã
- UIViewã®translatesAutoresizingMaskIntoConstraintsãfalseã«ãã
- NSLayoutConstraintã®isActiveãtrueã«ãã
åã¯èªä½ã® mono0926/AutoLayoutExtension ã使ã£ã¦ãã®ããã解決ãã¦ãã¾ãã
ç»åURLã®åãæ±ã
次ã«ãUIImageViewãªã©ã§è¡¨ç¤ºããç»åã®URLã®åãæ±ãã§ãããµã¼ãã¼ã¨ã®ããã¨ããçºçããã¢ããªã§ã¯ã大æµã¯ç»åã®URLãå ã«éåæã§ãã®ãã¼ã¿ãåå¾ãã¦UIImageåãã¦ã»ããããã¨ããå¦çããªããã¦ããã¨æãã¾ããããããç°¡æã«æ¸ããã©ã¤ãã©ãªã使ãã¨ä¾¿å©ã§ãã
Objective-Cæ代ã¯rs/SDWebImageä¸æãªæè¦ã§ããããSwiftã§ã¯åæã«ãã®SDWebImageãã»ã¼ãã¿ã«Swiftã«æ¸ãæãããããªonevcat/Kingfisherãç»å ´ãã人æ°ãåãã¾ãããåã以åSDWebImageããKingfisherã«ä¹ãæãã¦ã¿ãã®ã§ãããåç´ãªæ¸ãæãã§æ¸ãã ã¨æãããããã¾ã§åãã¦ãããã®ã«ãã°ãåºãããã¦ãã®è§£æ±ºã«ããªãæéãè¦ããããã¾ãã½ã¼ã¹ãè¦ã¦ããã¾ãSwiftã½ãæãã§ã¯ãªãå¾®å¦ãªå°è±¡ã§ããã
ãããªä¸ãä»ã«è¯ãã®ç¡ãããªã¨æã£ã¦ããã¨ãã«æãã¦ããã ãã kean/Nuke ãæé«ã§ããã
ã³ã¼ãã綺éºã§ãã°ãç¹ã«æ°ã«ãªããªãã§ã(ãã£ã¦ãã¹ãã¼ãã«ãµã¯ãã¨ç´ãã¦ããããèªãã§ããã)ãkean/RxNukeãªã©ã®æ¡å¼µããã£ã¦ããããã¨ã®çµã¿åãããè¯ãæãã§ãã
ç»åãéåæåå¾ãã¦ã»ããããããããªãããããã©ã¤ãã©ãªä½¿ããã¨ãèªåã§æ¸ãã¦æ¸ã¾ãã¦è¯ãã®ã§ã¯ï¼ã¨æãããããã¾ãããããã£ãã·ã¥ã¨ãè²ã ç´°ããã¨ããèæ ®ããã¨ã©ã¤ãã©ãªä½¿ãã®ãå¾çã ã¨æã£ã¦ãã¾ãããã£ãã·ã¥å¨ãã®å¶å¾¡ãã©ã¤ãã©ãªã«ãã£ã¦å·®ãããæ°ããã¦ãã¾ãããNukeã¯ããã©ã«ãã§ããã¹ã姿ã®å®è£ ã«ãªã£ã¦ããã¨æãã¦ãã¾ãã
ãã¼ã«ã«ãã¼ã¿ãã¼ã¹
主ã«Web APIã¬ã¹ãã³ã¹ããã¼ã«ã«ã§ä¿åãã¤ã¤åãåãããã«ããã¼ã«ã«ãã¼ã¿ãã¼ã¹ãç¨ãããããã¨ãããã¾ãããã¤ã¦ã¯åºæ¬çã«Core Data使ãã·ã¼ã³ã§ããããããæ°å¹´ã¯Realmã人æ°ã§ãã
æ°è¦ã¢ããªã§ã¯Realmãé¸ã°ãããã¨ãå¤ãããªã¨æã£ã¦ãã¾ãããCore Dataãã¾ãã¾ãè¯ãã¨æã£ã¦ãã¾ãã
2å¹´åã«ããããæ¯è¼è¨äºæ¸ãã¾ããã
(å½æããããããé²åããã¾ãããããã«ã¯è¿½å¾ã§ãã¦ããªãã®ã§æ³¨æãã¦ãã ããã)
ã¾ããåè¿°ã®Firebaseã«Firestoreã¨ããããã¥ã¡ã³ãæåãã¼ã¿ãã¼ã¹ãå ããã¾ããããããããªã¢ã«ã¿ã¤ã åæå¯è½ãªãã¼ã«ã«ãã¼ã¿ãã¼ã¹æè¦ã§ä½¿ãã¨ããã®ãããå¾ã¾ãã
åã¯ä»æ°ãã«éçºä¸ã®ã¢ããªã§ã¯Core Dataã»Realmã使ããã«Firestoreã ãã§æ¸ã¾ãã¦ãã¾ãã
(Firestoreããã°Core Dataã»Realmãä¸è¦ã¨ããããã§ã¯ãªãã¢ããªè¦ä»¶æ¬¡ç¬¬ã§ãã)
Keychain
Keychain㯠KeychainAccessä¸æã§ããã
ãã ããåè¿°ã®Firebaseã®Authenticationã使ãå ´åãKeychainãç´æ¥è§¦ããã«æ¸ããå¤ãã§ãããªããªããKeychainã¯ã主㫠access token
ãã¢ã«ã¦ã³ãæ
å ±ã¨ããã»ãã¥ã¢ãªæ
å ±ãæ ¼ç´ããéã«ä½¿ããã¾ããããããã¯Firebase Authenticationã®å
é¨ã§ãªãããããã§ããFirebase SDKã使ãã¨ãã¯ãã¡ãããå¥éèªåã®APIãå©ãã¨ãããããFirebase Authenticationã®tokenã使ãæ¹å¼ã§çµãã§ããã°åæ§ã§ããåãä»æ°ãã«éçºä¸ã®ããã¸ã§ã¯ãã§ã¯ããããæ§æã«ãªã£ã¦ããã®ã§KeychainAccessãªã©ã¯ä½¿ã£ã¦ãã¾ããã
Firebase Authenticationã«ã¤ãã¦ã¯ã以åæ¸ãããã¡ããåèã«ãªããã¨æãã¾ãð
UserDefaults
UserDefaultsã®åãæ±ãã¯ãSwiftã§ã¯ä»¥ä¸ã®ããã«ããã¨ç°¡æ½ã«æ¸ããã®ã§ãã©ã¤ãã©ãªã¯ä½¿ããªãã¨ãè¯ãããªæè¦ã§ãã
// å¤ã®ä¿å
UserDefaults.standard.set(newValue, forKey: "some key")
// å¤ã®åå¾(Stringåã®å ´å)
UserDefaults.standard.string(forKey: "some key")
ã¾ããSwift 4ã§Codableæºæ ã®ãªãã¸ã§ã¯ãã¯ãµã¯ãã¨Dataåã«ã·ãªã¢ã©ã¤ãºã§ããããã«ãªã£ãã®ã§ããã®ã·ãªã¢ã©ã¤ãºãããDataãUserDefaultsã«å ¥ããã¨ããã®ãããã§ãããã®ããã大ä½ä¼¼ããããªå®è£ ã«è¡ãçãã¨æãã¾ããã Nicholas Maccharoli ããä½ã® Nirma/Default ãªã©å©ç¨ããã®ãããã ã¨ãæã£ã¦ãã¾ãã
ãã¡ã¤ã«ã¢ã¯ã»ã¹
ãã¼ã«ã«ãã¼ã¿ãã¼ã¹ã»NSUserDefaultsã¸ã®ä¿åã«é©ããªããã®ã¯ãã¢ããªé åå ã«ãã¡ã¤ã«ã¨ãã¦ä¿åããå¿ è¦ãããã¾ãã(ãã£ãã·ã¥ã§ã¯ãªã)æ°¸ç¶åãããç»åãªã©ã®å¤§ããªãµã¤ãºã®ãã¡ã¤ã«ãç½®ãã¨ãã«ä½¿ããããã¨ãå¤ãã§ãã
ã¡ãªã¿ã«ããã¼ã«ã«ãã¼ã¿ãã¼ã¹ã®å®ä½ããã®ããã«Documentsãã£ã¬ã¯ããªé ä¸ãªã©ã«ç½®ããã¦ããããã¾ãã
ã©ã®ãã£ã¬ã¯ããªã使ããã¯ãä½æ³ãããããã®ãããåèã«ãªãã¾ãã
ç´°ããã¨ããã¾ã§ç¥ãããå ´åã¯å ¬å¼ããã¥ã¡ã³ãåç §ããããããã¾ãã
ã¾ããFileManagerã¯è¥å¹²ä½¿ãã«ããã®ã§ããããæ°ã«ãªãå ´åã Saoud M. Rizwan ããä½ã® saoudrizwan/Disk ãªã©ä½¿ããããã©ãããã¦ããã¦ããã©ã¤ãã©ãªã使ãã®ããããããã¾ãã
ã¾ããä¿åããããã¡ã¤ã«ã確èªãããå ´åãã·ãã¥ã¬ã¼ã¿ã¼ã®ã¢ããªé åã人åã§æ¢ãã®ã¯ãã£ãããã¤ãã®ã§ãããã£ãã¢ããªã使ãã®ããããããã¾ããããã¯ææã§ããç¡æã®ãã®ãããã¯ãã§ãã
ãã¬ã¼
ã©ã¤ãã©ãªã¨ãã¦ã¯ä»¥ä¸ããããå®çªããªã¨æã£ã¦ãã¾ãã
- DaveWoodCom/XCGLogger: ã·ã³ãã«
- SwiftyBeaver/SwiftyBeaver: ãªãã
SwiftyBeaverã¯ãã°ã©ã¤ãã©ãªã«ã¨ã©ã¾ããªãããã°ãã©ãããã©ã¼ã ãã§ããããããã®ãæ±ãã¦ããå ´åããä¸æã§ããã
Objective-Cæ代ã¯CocoaLumberjack/CocoaLumberjackãæåã§ããããSwiftã§ä½¿ãã®ã¯å¾®å¦ãªå°è±¡ã§ãã
å人çã«ã¯ããã®ã³ã°ã¯ä»¥ä¸ã®ãããªå½¢ã§è¯ãããªã¨æã£ã¦ãã¦ãè¦ä»¶æºããç°¡åãªã¯ã©ã¹ã»é¢æ°ãªã©å®ç¾©ãã¦æ¸ã¾ãã¦ãã¾ãã
- åºæ¬çãªãã°ã¯iOS 10以éã§ã¯OSLogã«ãããã®ã³ã°ãå©ç¨ãã¦ãã¼ã«ã«ã«æ¸ãåºãã®ã¿
- ã¨ã©ã¼ã»ã¯ã©ãã·ã¥ç³»ã®ãã°ã¯Crashlytics(Firebaseã«çµ±åä¸)ã«ãéã
- éè¦ãªã¤ãã³ãã¯Firebase Analyticsã«éã(BigQueryã«ãèªåé£æº)
ãã¹ã
ãã¹ãã©ã¤ãã©ãªã¨ãã¦ã¯BDD(behavior-driven development)ãã¬ã¼ã ã¯ã¼ã¯ã§ããQuickãæåã§ããã以åæ¸ãå¿å°å¾®å¦ã«æãã¦ãã¾ã£ãããåã¯XCTestã使ã£ã¦ãã¿ã«æ¸ãã¦ãã¾ããæ£ç´ãã¢ããªã±ã¼ã·ã§ã³ã³ã¼ãã«ã¤ãã¦ã¯èªåãã¹ãã®ã³ã¹ããã¾ãè¯ããªããªã¨æã£ã¦ãã¦ããã¹ãã³ã¼ãã¯ãã¾ãæ¸ãã¦ããªãã¨ããã®ãQuickã¿ãããªãã®ãå¿
è¦ã«æããªãçç±ã®1ã¤ã§ãã Quickã®context
ã«ç¸å½ããç²åº¦ã§ãã¡ã¤ã«åå²ãã工夫ç¨åº¦ã§ããã¹ãã³ã¼ãã®è¦éãè¯ããªãæ°ããã¦ãã¾ãã
æè¿ãªãã¸ããªã«ä¸ãã£ã¦ãã kishikawakatsumi/SwiftPowerAssert ã注ç®ã§ãããã¾ã å®å©ç¨ã§ãã段éã«ã¯ãªã£ã¦ããªãããã§ãã
ã¡ãªã¿ã«ã nextstepfm ã®ææ°å#16ã®50åãããããåãä¸ãããã¦ãã¦é¢ç½ãã£ãã§ã( ´・â¿ï½¥ï½)
ã©ã¤ã»ã³ã¹ç®¡ç
å°å ¥ããã©ã¤ãã©ãªã®ã©ã¤ã»ã³ã¹ç®¡çã§ãããåã®ä½ã£ã mono0926/LicensePlistããããããã¾ãã
Carthageã»CocoaPodsã»æåã§ã½ã¼ã¹è¿½å ããªã©ã©ããªã¤ã³ã¹ãã¼ã«ãæ¹æ³ããããå ´åã§ãè¯ãæãã«ä¸ã¾ã¨ãã«ãã¦iOSè¨å®ç»é¢ä¸ã§ä¸è¦§è¡¨ç¤ºã§ãã¾ãã
ã¤ã±ã¦ãã©ã¤ãã©ãªã®è¦ã¤ãæ¹
ã¡ãªã¿ã«ãæ®æ®µã©ãã©ã¤ãã©ãªãªã©è¦ã¤ãã¦ãããã¨ããã¨ãæ®éã«ã°ã°ããã¨ãããã¾ããã以ä¸ã®ãããªæãã§ä½ãè¯ãããªãã®ãç¡ããæ¥ã ãã§ãã¯ãã¦ãã¾ã(åå趣å³ã§ã)ã
- GitHub Trendingã®Swift ãé±1ã§ãã§ãã¯
- æµ·å¤ã¡ã«ãã¬ããã§ãã¯(é±5æ¬ããããä¸éãèªãã§ãã¾ã)
ã¾ããå®éã«ä½¿ããããªã¨æã£ãéã«ã¯ã次ã®ç¹ãªã©å¤§ä¸å¤«ããã§ãã¯ãã¤ã¤å°å ¥ã決ãã¦ãã¾ãã
- æ¬å½ã«ãã®ã©ã¤ãã©ãªãå°å ¥ãããã¨ã§éçºå¹çãä¸ããããã
- ä½è ãã§ãã¯
- è¨è¨ãã³ã¼ãããã£ããæ¥ãã
- ä»å¾ã¡ã³ããã³ã¹æå¾ ã§ãããã
ãã¶ã¤ã³
ãã¶ã¤ã³ç³»ã®ç¥èãæè¿ã®ã¢ããªéçºã¨ã³ã¸ãã¢ã ã¨ããã¨ãã¿ã¼ã ã¨æã£ã¦ãã¦ã¡ããã¡ããåå¼·ã»ãã£ããã¢ãããªã©ç¶ãã¦ãã¾ããã¢ããªéçºã¯åãªãã³ã¼ãã£ã³ã°è½åãªã©ã«éããªãç·ååã ã¨æã£ã¦ãã¾ãã
ã¨ã³ã¸ãã¢ããã¶ã¤ã³ã¹ãã«ãå°ãã§ãæã¤ã¨ããã¶ã¤ãã¼ã¨ã®åæ¥ãã¹ã ã¼ãºã«ãªãã¯ãã§ãã
Sketch
ãã¶ã¤ã³ãçµãéã®ä»ä¸çªã®å®çªãã¼ã«ã§ããSketchã§ãããã·ã³ãã«ã§ä½¿ããããã®ã§é©å½ã«è§¦ã£ã¦ããã ãã§ã¾ãã¾ãæ±ããããã«ãªãã¾ãããããã«æ¬¡ã®2åèªãã¨ãã使ãããªããããã«ãªãã¨æãã¾ãã
æè¿ã¯Adobe XDãè¯ãæãã§ä»å¾ãã®2å¼·ã«ãªã£ã¦ããæ°ããã¦ãã¾ãð¤
ç»åãªã½ã¼ã¹ã®ã¨ã¯ã¹ãã¼ã
Sketchã§ã¯iOSã®ã¨ã¯ã¹ãã¼ãè¨å®ã¯ããã©ã«ãã§ã¯PNGã§@3xã¾ã§ã®3ãµã¤ãºåºåã¨ãªã£ã¦ãã¾ãã
Xcode 6ããã¯PDFå½¢å¼ã§ã¯1ãµã¤ãºã®ã¿ã§è¯ããªã£ã¦åãåããè¯ãã®ã§åã¯åºæ¬ãã¡ãã使ã£ã¦ãã¾ããã¾ããPDFå½¢å¼ã§ã¯ãã«ãæã«PNGå½¢å¼ã«ã©ã¹ã¿ã©ã¤ãºããã¾ã(Xcode 9ã§ã§ããããã«ãªã£ããã¯ã¿ã¼ç¶ææå®ãããªãå ´å)ããPNGå½¢å¼ã§ã¯ç¸æ§æªããµã¤ãºã大ãããªã£ã¦ãã¾ããã®ãªã©ã¯åããXcode 6ããæ±ããããã«ãªã£ãJPGæ¹å¼ã«ãã¦ãã¾ãã
ã¨ã¯ã¹ãã¼ãè¨å®ã¯ãåºæ¬çã«ãã®2æãããããã ã¨æã£ã¦ãã¾ãã
ãããã¿ã¤ãã³ã°
å®è£ åã«é©å®ãããã¿ã¤ãã³ã°ãçµãã®ãå®è£ ã®ææ»ãé²æ¢ãªã©ã«å½¹ç«ã¡ã¾ãã以ä¸ãæåã©ããã§ãããã
- Marvel: æ°ã«å ¥ã£ã¦å©ç¨ä¸
- InVision: 使ã£ããã¨ãªããã©è¯ããã
- Prott: å½ç£ã ãã©ä½¿ãã«ããæããã®ã¨é«ãã®ã§Marvelæ¡ç¨ãã
Sketchã®Marvelãã©ã°ã¤ã³ä½¿ã£ã¦ãµã¯ãã¨åæã§ããã®ä¾¿å©ã§ã(InVisionã»Prottãåæ§ã®ãã©ã°ã¤ã³ããããã§ã)ã
ãã®ä»è§¦ããããªãã£ãç¹
MVVMã»Reduxã»Fluxã»Clean Architectureã»VIPERã»Danger ããããããããªè©±é¡ãã¨æãã¾ãããå人çã«ã¯ãã®ããããã¾ããã£ããã¢ããã§ãã¦ããªãã®ã§ç¹ã«è§¦ãã¾ããã
ã¾ã¨ã
ãã¼ãçã«ãããªæãã«ãªãããã¨ã¯æã£ã¦ãã¾ããããã¾ã¨ã¾ãã®å¾®å¦ãªè¨äºã«ãªã£ã¦ãã¾ã£ãæãããã¾ã( ´・â¿ï½¥ï½)ã§ãè²ã ä¸æ°ã«çºæ£ã§ãã¦è¯ãã£ãæ°ããã¦ãã¾ã( ´・â¿ï½¥ï½)
æ¬è¨äºã¯ãiOS Advent Calendar 2017ã®25æ¥ç®ã§ããð¤
ã¡ãªã¿ã«ããã¡ãã®iOSçã½ãæãã«ããªãããªã¨æãã¾ããããã©ãã§ãããã( ´・?ï½¥ï½)