{"id":114,"date":"2021-09-17T15:23:44","date_gmt":"1970-01-01T00:00:00","guid":{"rendered":"http:\/\/swift.tecc0.com\/?p=114"},"modified":"2021-09-17T15:23:44","modified_gmt":"1970-01-01T00:00:00","slug":"post-114","status":"publish","type":"post","link":"https:\/\/swift.tecc0.com\/?p=114","title":{"rendered":"Swift\u3067\u4e71\u6570\u3092\u751f\u6210\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u4e3b\u306b\u4ee5\u4e0b\u306e\u95a2\u6570\u3092\u4f7f\u3046\u3002<\/p>\n<p>\u4eca\u56de\u306f\u4f8b\u3068\u3057\u3066\u30010\u301c9\u306e\u4e71\u6570\u3092\u751f\u6210\u3059\u308b\u3002<\/p>\n<h3>\u5b9f\u884c\u3054\u3068\u306b\u7570\u306a\u308b\u4e71\u6570\u306e\u00a0arc4random()<\/h3>\n<pre class=\"toolbar-overlay:false lang:swift decode:true\">let num = arc4random() % 10\nprint(num)<\/pre>\n<p>\u3061\u306a\u307f\u306b\u30e2\u30b8\u30e5\u30ed\u30d0\u30a4\u30a2\u30b9(modulo bias)\u554f\u984c\u3092\u6c17\u306b\u3059\u308b\u5834\u5408\u306f&#8230;<\/p>\n<p>\u30e2\u30b8\u30e5\u30ed\u30d0\u30a4\u30a2\u30b9\u306b\u3064\u3044\u3066\u53c2\u8003:\u00a0<a href=\"http:\/\/programming-ios.com\/objective_c-arc4random\/\" target=\"_blank\" rel=\"noopener noreferrer\">arc4random()\u304c\u751f\u6210\u3059\u308b\u4e71\u6570\u306e\u504f\u308a\u306b\u3064\u3044\u3066<\/a><\/p>\n<p>\u7c21\u5358\u306b\u8a00\u3048\u3070\u3001<span style=\"color: #ff0000;\">\u4e71\u6570\u306e\u504f\u308a<\/span>\u3067\u3059\u3002<\/p>\n<h3>\u30e2\u30b8\u30e5\u30ed\u30d0\u30a4\u30a2\u30b9\u3092\u89e3\u6c7a\u3059\u308b arc4random_uniform()<\/h3>\n<pre class=\"toolbar-overlay:false lang:swift decode:true\">let num = arc4random_uniform(10)\nprint(num)<\/pre>\n<p>\u81ea\u5206\u3067\u8a66\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u306a\u3093\u3068\u3082\u8a00\u3048\u306a\u3044\u3067\u3059\u304c\u3001\u4f53\u611f\u3067\u304d\u308b\u307b\u3069\u306e\u5dee\u306f\u3042\u307e\u308a\u306a\u3044\u304b\u3068\u306f\u601d\u3044\u307e\u3059\u304c\u3001\u5fc3\u914d\u306a\u4eba\u306f\u00a0<strong>arc4random_uniform()<\/strong> \u3092\u4f7f\u3048\u3070\u826f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3b\u306b\u4ee5\u4e0b\u306e\u95a2\u6570\u3092\u4f7f\u3046\u3002 \u4eca\u56de\u306f\u4f8b\u3068\u3057\u3066\u30010\u301c9\u306e\u4e71\u6570\u3092\u751f\u6210\u3059\u308b\u3002 \u5b9f\u884c\u3054\u3068\u306b\u7570\u306a\u308b\u4e71\u6570\u306e\u00a0arc4random() let num = arc4random() % 10 print(num) \u3061\u306a\u307f\u306b\u30e2\u30b8\u30e5\u30ed\u30d0\u30a4\u30a2\u30b9(&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[17],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts\/114"}],"collection":[{"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=114"}],"version-history":[{"count":2,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts\/114\/revisions"}],"predecessor-version":[{"id":811,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts\/114\/revisions\/811"}],"wp:attachment":[{"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}