Swiftã§Optionalå¤ãunwrapããã¨ãã«ä¸çªä½¿ã if let æ§æã ãã®ã¨ãã®å¤æ°åã®æ±ãã«ã¤ãã¦ã¿ãªããã¯ã©ããã¦ããã§ããããã if let Swiftã§å°å ¥ãããOptionalããã®Optionalå¤æ°ãOptionalã§ã¯ãªãå¤æ°ã«ãã unwrap å¦çã¨ãã¦ä¸è¬çãªã®ã if let æ§æã§ãã ä¸è¨ã®ã³ã¼ãã§ã¯ãaã¯Int?åãªã®ã§Intã¾ãã¯nilãå ¥ã£ã¦ããã®ã§ãå®éã«ãã®ãªãã®å¤ãå¤å®ããæã«ã¯ãif letæ§æã§unwrapããå¿ è¦ãããã¾ãã let a : Int? // (change a value) if let b = a { print("a : \(a)") print("b : \(b)") } ä¸è¨ã®ããã«if letããã¨ã a ã¯Int?åãbã¯Intåã¨ãªããaãunwrapãããã®ãbã¨ãªãã¾ããã ãã¦ããã®å ´åãã¿
{{#tags}}- {{label}}
{{/tags}}