åãã¾ãã¦ã@ukitakaã§ãã主ã«iOS/Swiftçéã«çæ¯ãã¦ãã¦ãåã«ã¤ãã¦ã®ç解ãæ·±ããã¹ãåã·ã¹ãã å ¥éãçæã«æ¥ã Swiftã³ã³ãã¤ã©ã®å®è£ ãèªãã§åå¼·ããã¦ãã¾ãã ä»å¹´ãåã·ã¹ãã ã«ã¯å ¥é失æãã¾ããããã³ã¼ããªã¼ãã£ã³ã°ã§å¾ãç¥è¦ãå ã«ããã°ã£ã¦è¨èªå®è£ ã¢ãã«ã¬ã«æ稿ãã¦ã¿ããã¨æãã¾ããã Swiftã§ã¯switchæã使ã£ã¦ãã¿ã¼ã³ããããè¡ããã¨ãã§ãã以ä¸ã®ãããªå°ãè¤éãªãã¿ã¼ã³ã§ã(defaultã±ã¼ã¹ãªãã«)ãã¿ã¼ã³ãç¶²ç¾ ããã¦ãããã¨ãã³ã³ãã¤ã©ãèªèãã¦ããã¾ãã enum MyEnum { case a case b(Bool) } let myEnumOpt: MyEnum? = MyEnum.a switch myEnumOpt { case .some(.a): print("A") case .some(.b(true)): print("
{{#tags}}- {{label}}
{{/tags}}