{"id":250,"date":"2017-05-30T20:26:04","date_gmt":"2017-05-30T11:26:04","guid":{"rendered":"https:\/\/do-gugan.com\/swift\/?p=250"},"modified":"2017-05-30T20:26:04","modified_gmt":"2017-05-30T11:26:04","slug":"%e6%9d%a1%e4%bb%b6%e5%88%86%e5%b2%90%e3%82%b3%e3%83%bc%e3%83%89-1-%e3%82%b9%e3%82%a4%e3%83%83%e3%83%81%e3%82%92%e8%aa%bf%e3%81%b9%e3%82%8b","status":"publish","type":"post","link":"https:\/\/do-gugan.com\/swift\/?p=250","title":{"rendered":"\u6761\u4ef6\u5206\u5c90\u30b3\u30fc\u30c9 1. \u30b9\u30a4\u30c3\u30c1\u3092\u8abf\u3079\u308b"},"content":{"rendered":"<p>\u524d\u7ae0\u307e\u3067\u3067\u7df4\u7fd2\u3057\u305f\u300c\u540c\u3058\u51e6\u7406\u3092\u7e70\u308a\u8fd4\u3059\u300d\u3068\u3044\u3046\u3053\u3068\u306f\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u306e\u5f97\u610f\u5206\u91ce\u3067\u3057\u305f\u3002\u3042\u3089\u304b\u3058\u3081\u308f\u304b\u3063\u3066\u3044\u308b\u4f5c\u696d\u5185\u7528\u3092\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u843d\u3068\u3057\u8fbc\u3093\u3067\u304a\u3051\u3070\u3001\u6bce\u56de\u81ea\u52d5\u3067\u305d\u308c\u3092\u3084\u3063\u3066\u304f\u308c\u3066\u6211\u3005\u306f\u697d\u3092\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3057\u304b\u3057\u5b9f\u969b\u306b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3067\u81ea\u52d5\u5316\u3057\u305f\u3044\u51e6\u7406\u306e\u4e2d\u306b\u306f\u300c\u3042\u3089\u304b\u3058\u3081\u308f\u304b\u3063\u3066\u3044\u308b\u300d\u3053\u3068\u3070\u304b\u308a\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002\u305d\u3053\u3067\u3001\u305d\u306e\u4f5c\u696d\u3092\u3057\u3088\u3046\u3068\u601d\u3063\u305f\u6642\u306e\u72b6\u6cc1\u306b\u5fdc\u3058\u3066\u51e6\u7406\u3092\u5207\u308a\u66ff\u3048\u3089\u308c\u308b\u300c\u5224\u65ad\u529b\u300d\u3092\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u3082\u305f\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u305f\u3089\u3001\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\u6211\u3005\u3082\u65e5\u5e38\u7684\u306b\u300c\u96e8\u3060\u3063\u305f\u3089\u5098\u3092\u6301\u3063\u3066\u3044\u304f\u300d\u306e\u3088\u3046\u306b\u3042\u308b\u7279\u5b9a\u306e\u72b6\u6cc1\u3092\u300c\u6761\u4ef6\u300d\u3068\u3057\u3001\u884c\u52d5\u3092\u5909\u3048\u308b\uff08\u5206\u5c90\u3059\u308b\uff09\u3001\u3068\u3044\u3046\u3053\u3068\u3092\u3057\u307e\u3059\u3002\u3053\u306e\u300c\u6761\u4ef6\u300d\u306b\u3088\u3063\u3066\u51e6\u7406\u3092\u300c\u5206\u5c90\u300d\u3059\u308b\u306e\u304c\u3053\u306e\u7ae0\u306e\u30c6\u30fc\u30de\u3067\u3059\u3002<\/p>\n<p>\u4f7f\u3046\u306e\u306fif\u6587\u3067\u3001\u51fa\u984c\u6587\u306b\u3042\u308b<\/p>\n<pre class=\"lang:swift decode:true \" >\r\nif isOnClosedSwitch {\r\n    toggleSwitch()\r\n}<\/pre>\n<p>\u306f\u3001\u65e5\u672c\u8a9e\u306b\u3059\u308b\u3068<\/p>\n<pre class=\"lang:swift decode:true \" >\r\n\u3082\u3057 \u9589\u30b9\u30a4\u30c3\u30c1\u306e\u4e0a\u306b\u3044\u308b {\r\n    \u30b9\u30a4\u30c3\u30c1\u3092\u5207\u308a\u66ff\u3048\u308b()\r\n}<\/pre>\n<p>\u3068\u3044\u3046\u610f\u5473\u306b\u306a\u308a\u307e\u3059\uff08if\u306f\u300c\u3082\u3057\u3082\u300d\u3068\u3044\u3046\u610f\u5473\u3067\u3059\uff09\u3002\u3053\u3046\u66f8\u3051\u3070\u306a\u3093\u3068\u304f\u610f\u5473\u304c\u898b\u3048\u3066\u304d\u307e\u305b\u3093\u304b\uff1f<br \/>\n\u6587\u6cd5\u3068\u3057\u3066\u306f\u3001<\/p>\n<pre class=\"lang:swift decode:true \" >\r\nif \uff08\u5224\u65ad\u3057\u305f\u3044\u6761\u4ef6\uff09 {\r\n    (\u5224\u65ad\u6761\u4ef6\u304c\u6210\u7acb\u3057\u305f\u6642\u306b\u3055\u305b\u305f\u3044\u51e6\u7406\uff09\r\n}<\/pre>\n<p>\u3068\u3044\u3046\u5f62\u3067\u3059\u3002func\u6587\u3084for\u6587\u3068\u540c\u3058\u304f\u3001{}\u3067\u3055\u305b\u305f\u3044\u51e6\u7406\u3092\u30b5\u30f3\u30c9\u3057\u307e\u3059\u3002<\/p>\n<p>\u30b9\u30c6\u30fc\u30b8\u306e\u4f5c\u308a\u306f\u4e00\u672c\u9053\u3067\u3001\u9014\u4e2d\u30b9\u30a4\u30c3\u30c1\u304c3\u3064\u9023\u7d9a\u3067\u4e26\u3093\u3067\u3044\u307e\u3059\u304c\u3001\u30aa\u30f3\uff08open\uff09\u306a\u3082\u306e\u3068\u30aa\u30d5\uff08Closed\uff09\u306a\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002\u307e\u305a\u306f\u306a\u306b\u3082\u3057\u306a\u3044\u3067\u300c\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u300d\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u306a\u3093\u3068\u305d\u308c\u305e\u308c\u306e\u30b9\u30a4\u30c3\u30c1\u306e\u72b6\u614b\u304c\u5909\u5316\u3057\u307e\u3059\u3002toggleSwitch\u306f\u30aa\u30f3\u306e\u3082\u306e\u306f\u30aa\u30d5\u306b\u3001\u30aa\u30d5\u306e\u3082\u306e\u306f\u30aa\u30f3\u306b\u3059\u308b\u306e\u3067\u3001\u3069\u308c\u3068\u3069\u308c\u304c\u30aa\u30d5\u304b\u3042\u3089\u304b\u3058\u3081\u308f\u304b\u3063\u3066\u3044\u306a\u3044\u3068\u3001\u5168\u3066\u3092\u30aa\u30f3\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\n\u305d\u3053\u3067\u6d3b\u8e8d\u3059\u308b\u306e\u304c\u6761\u4ef6\u5206\u5c90\u3092\u3059\u308bif\u6587\u3068\u3044\u3046\u308f\u3051\u3067\u3059\u3002\u300c\u5224\u65ad\u3057\u305f\u3044\u6761\u4ef6\u300d\u306e\u66f8\u304d\u65b9\u306f\u8272\u3005\u3042\u308b\u306e\u3067\u3059\u304c\u3053\u306e\u30b9\u30c6\u30fc\u30b8\u3067\u306f\u51fa\u984c\u5206\u306b\u3042\u308b\u3088\u3046\u306b\u5358\u7d14\u306b\u300cisOnClosedSwitch\u300d\u3068\u3057\u3066\u304a\u3051\u3070OK\u3067\u3059\u3002()\u306f\u3044\u308a\u307e\u305b\u3093\u3002<br \/>\n\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u3044\u307e\u307e\u3067\u901a\u308a3\u3064\u306e\u30b9\u30a4\u30c3\u30c1\u306e\u4e0a\u3067toggleSwitch()\u3059\u308b\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u3001\u305d\u306etoggleSwitch\u3092if\u6587\u3067\u56f2\u3080\u5f62\u306b\u5909\u5f62\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u3001\u9589\u30b9\u30a4\u30c3\u30c1\u4e0a\u306e\u6642\u3060\u3051toggleSwitch()\u304c\u5b9f\u884c\u3055\u308c\u3001\u958b\u30b9\u30a4\u30c3\u30c1\u306a\u3069\u305d\u308c\u4ee5\u5916\u306e\u5834\u5408\u306f{}\u306f\u30b9\u30ad\u30c3\u30d7\u3055\u308c\u308b\u306e\u3067\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3002\u7d50\u679c\u3068\u3057\u3066\u3001\u958b\u30b9\u30a4\u30c3\u30c1\u306f\u305d\u306e\u307e\u307e\u3001\u9589\u30b9\u30a4\u30c3\u30c1\u306f\u30aa\u30f3\u306b\u5909\u66f4\u3055\u308c\u3001\u5168\u3066\u306e\u30b9\u30a4\u30c3\u30c1\u304c\u30aa\u30f3\u306b\u306a\u308a\u307e\u3059\u3002\u305d\u306e\u5834\u305d\u306e\u5834\u3067\u5224\u65ad\u3059\u308b\u306e\u3067\u3001\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u5ea6\u306b\u9589\u30b9\u30a4\u30c3\u30c1\u306e\u5834\u6240\u304c\u304b\u308f\u3063\u3066\u3082\u67d4\u8edf\u306b\u5bfe\u5fdc\u3067\u304d\u308b\u306e\u3067\u3059\u3002<\/p>\n<pre class=\"lang:swift decode:true \" >moveForward()\r\nfor i in 1 ... 3 {\r\n    moveForward()\r\n    \/\/if\u6587\u3067\u9589\u30b9\u30a4\u30c3\u30c1\u306e\u4e0a\u304b\u3069\u3046\u304b\u30c1\u30a7\u30c3\u30af\r\n    if isOnClosedSwitch {\r\n        \/\/ {}\u306e\u4e2d\u306f\u9589\u30b9\u30a4\u30c3\u30c1\u306e\u4e0a\u3060\u3063\u305f\u5834\u5408\u3060\u3051\u5b9f\u884c\u3055\u308c\u308b\r\n        toggleSwitch()\r\n    }\r\n}\r\n<\/pre>\n<script type=\"text\/javascript\">amzn_assoc_ad_type =\"responsive_search_widget\"; amzn_assoc_tracking_id =\"doguganprojec-22\"; amzn_assoc_marketplace =\"amazon\"; amzn_assoc_region =\"JP\"; amzn_assoc_placement =\"\"; amzn_assoc_search_type = \"search_widget\";amzn_assoc_width =\"500\"; amzn_assoc_height =\"400\"; amzn_assoc_default_search_category =\"\"; amzn_assoc_default_search_key =\"iPad\";amzn_assoc_theme =\"light\"; amzn_assoc_bg_color =\"FFFFFF\"; <\/script><script src=\"\/\/z-fe.amazon-adsystem.com\/widgets\/q?ServiceVersion=20070822&Operation=GetScript&ID=OneJS&WS=1&Marketplace=JP\"><\/script>","protected":false},"excerpt":{"rendered":"<p>\u524d\u7ae0\u307e\u3067\u3067\u7df4\u7fd2\u3057\u305f\u300c\u540c\u3058\u51e6\u7406\u3092\u7e70\u308a\u8fd4\u3059\u300d\u3068\u3044\u3046\u3053\u3068\u306f\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u306e\u5f97\u610f\u5206\u91ce\u3067\u3057\u305f\u3002\u3042\u3089\u304b\u3058\u3081\u308f\u304b\u3063\u3066\u3044\u308b\u4f5c\u696d\u5185\u7528\u3092\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u843d\u3068\u3057\u8fbc\u3093\u3067\u304a\u3051\u3070\u3001\u6bce\u56de\u81ea\u52d5\u3067\u305d\u308c\u3092\u3084\u3063\u3066\u304f\u308c\u3066\u6211\u3005\u306f\u697d\u3092\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3057\u304b\u3057\u5b9f\u969b\u306b\u30d7\u30ed &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/do-gugan.com\/swift\/?p=250\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u6761\u4ef6\u5206\u5c90\u30b3\u30fc\u30c9 1. \u30b9\u30a4\u30c3\u30c1\u3092\u8abf\u3079\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,8],"tags":[],"class_list":["post-250","post","type-post","status-publish","format-standard","hentry","category-learncode1","category-ifthen"],"_links":{"self":[{"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=\/wp\/v2\/posts\/250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=250"}],"version-history":[{"count":3,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=\/wp\/v2\/posts\/250\/revisions"}],"predecessor-version":[{"id":253,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=\/wp\/v2\/posts\/250\/revisions\/253"}],"wp:attachment":[{"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}