{"id":545,"date":"2024-10-05T22:40:12","date_gmt":"2024-10-05T22:40:12","guid":{"rendered":"https:\/\/xcode15.shimayugu.jp\/?p=545"},"modified":"2024-12-29T07:22:14","modified_gmt":"2024-12-28T22:22:14","slug":"%e6%96%b0swift%e3%81%a7%e8%a1%8c%e3%81%93%e3%81%86%e7%ac%ac%ef%bc%95%ef%bc%98%e5%9b%9e%e3%80%8c%e9%9b%bb%e5%ad%90%e3%82%b5%e3%82%a4%e3%82%b3%e3%83%ad%e8%a7%a3%e8%aa%ac%e3%80%8d%e3%80%80","status":"publish","type":"post","link":"https:\/\/xcode15.shimayugu.jp\/?p=545","title":{"rendered":"\u65b0Swift\u3067\u884c\u3053\u3046\u2026\u7b2c\uff15\uff18\u56de\u300c\u96fb\u5b50\u30b5\u30a4\u30b3\u30ed\u89e3\u8aac\u300d\u3000\u7530\u90e8\u4e95\u4fdd"},"content":{"rendered":"\n<p><a href=\"https:\/\/shimayugu.sakura.ne.jp\/?p=2473\">\u76ee\u6b21<\/a>\u3000<a href=\"https:\/\/xcode15.shimayugu.jp\/?p=88\">\u901a\u5e38\u7248<\/a><\/p>\n\n\n\n<p>\u3000\u96fb\u5b50\u30b5\u30a4\u30b3\u30ed\u306e\u89e3\u8aac\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-swift\" data-lang=\"Swift\" data-show-lang=\"1\"><code>\/\/\n\/\/  ViewController.swift\n\/\/  Dice\n\/\/\n\/\/  Created by \u4fdd Tabei on 2024\/09\/01.\n\/\/\n\nimport UIKit\n\nclass ViewController: UIViewController {\n    \/\/\/\u8868\u793a\u7528\u30e9\u30d9\u30eb\uff08\uff11\u301c\uff16\uff09\n    @IBOutlet weak var Dice: UILabel!\n    \n    override func viewDidLoad() {\n        super.viewDidLoad()\n        \/\/ Do any additional setup after loading the view.\n    }\n\n    \/\/\/\u30dc\u30bf\u30f3\u62bc\u4e0b\u6642\u51e6\u7406\n    @IBAction func Go(_ sender: Any) {\n        \/\/\u4e71\u6570\u767a\u751f\uff11\u301c\uff16\n        let dice = Int.random(in: 1 ... 6)\n        \/\/\u4e71\u6570\u8868\u793a\n        Dice.text = dice.description\n    }\n    \n}<\/code><\/pre><\/div>\n\n\n\n<p>\u3000\u3053\u308c\u306b\u3064\u3044\u3066\u306f\u3001\u96e3\u3057\u3044\u6240\u306f\u3082\u3046\u7121\u3044\u306e\u3067\u306f\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3000dice \u306b\u5024\u3092\u5165\u308c\u305f\u5f8c\u3001\u5909\u66f4\u3055\u308c\u308b\u4e8b\u306f\u7121\u3044\u306e\u3067\u3001\u3053\u3053\u3067\u306f let \u3068\u3057\u3066\u3044\u307e\u3059\u3002\u3082\u3057\u9014\u4e2d\u3067 dice += 1 \u3068\u304b dice \u306e\u5024\u304c\u5909\u66f4\u3055\u308c\u308b\u5834\u5408\u306f\u3001let \u3067\u306f\u306a\u304f var \u3067\u5ba3\u8a00\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002dice \u306f Int \u578b\u306a\u306e\u3067\u3001\u305d\u306e\u307e\u307e\u3067\u306f\u30e9\u30d9\u30eb\u306b\u51fa\u529b\u3067\u304d\u306a\u3044\u306e\u3067\u3001dice.description \u3068\u3057\u3066\u6587\u5b57\u5217\u306b\u3057\u3066\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/shimayugu.sakura.ne.jp\/?p=2473\">\u76ee\u6b21<\/a>\u3000<a href=\"https:\/\/xcode15.shimayugu.jp\/?p=88\">\u901a\u5e38\u7248<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u6b21\u3000\u901a\u5e38\u7248 \u3000\u96fb\u5b50\u30b5\u30a4\u30b3\u30ed\u306e\u89e3\u8aac\u3067\u3059\u3002 \u3000\u3053\u308c\u306b\u3064\u3044\u3066\u306f\u3001\u96e3\u3057\u3044\u6240\u306f\u3082\u3046\u7121\u3044\u306e\u3067\u306f\u3068\u601d\u3044\u307e\u3059\u3002 \u3000dice \u306b\u5024\u3092\u5165\u308c\u305f\u5f8c\u3001\u5909\u66f4\u3055\u308c\u308b\u4e8b\u306f\u7121\u3044\u306e\u3067\u3001\u3053\u3053\u3067\u306f let \u3068\u3057\u3066\u3044\u307e\u3059\u3002\u3082\u3057\u9014\u4e2d\u3067 dice += 1 \u3068\u304b  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-545","post","type-post","status-publish","format-standard","hentry","category-swift"],"_links":{"self":[{"href":"https:\/\/xcode15.shimayugu.jp\/index.php?rest_route=\/wp\/v2\/posts\/545","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xcode15.shimayugu.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xcode15.shimayugu.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xcode15.shimayugu.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xcode15.shimayugu.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=545"}],"version-history":[{"count":3,"href":"https:\/\/xcode15.shimayugu.jp\/index.php?rest_route=\/wp\/v2\/posts\/545\/revisions"}],"predecessor-version":[{"id":1054,"href":"https:\/\/xcode15.shimayugu.jp\/index.php?rest_route=\/wp\/v2\/posts\/545\/revisions\/1054"}],"wp:attachment":[{"href":"https:\/\/xcode15.shimayugu.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xcode15.shimayugu.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=545"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xcode15.shimayugu.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}