{"id":170,"date":"2021-03-18T16:21:31","date_gmt":"2021-03-18T16:21:31","guid":{"rendered":"https:\/\/yakazoo.net\/wordpress\/?p=170"},"modified":"2021-03-18T16:21:33","modified_gmt":"2021-03-18T16:21:33","slug":"swiftui%e3%81%a7%e5%86%86%e5%bd%a2%e3%81%ae%e9%80%b2%e6%8d%97%e8%a1%a8%e7%a4%ba%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/yakazoo.net\/wordpress\/index.php\/2021\/03\/18\/170\/","title":{"rendered":"SwiftUI\u3067\u5186\u5f62\u306e\u9032\u6357\u8868\u793a\u65b9\u6cd5"},"content":{"rendered":"\n<p>SwiftUI\u3067\u5186\u5f62\u306e\u30d7\u30ed\u30b0\u30ec\u30b9\u30fb\u9032\u6357\u8868\u793a\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/yakazoo.net\/wordpress\/wp-content\/uploads\/2021\/03\/Simulator-Screen-Shot-iPhone-12-2021-03-19-at-00.51.00\u306e\u30b3\u30d2\u309a\u30fc.png\" alt=\"\" class=\"wp-image-172\" width=\"225\" height=\"220\" srcset=\"https:\/\/yakazoo.net\/wordpress\/wp-content\/uploads\/2021\/03\/Simulator-Screen-Shot-iPhone-12-2021-03-19-at-00.51.00\u306e\u30b3\u30d2\u309a\u30fc.png 790w, https:\/\/yakazoo.net\/wordpress\/wp-content\/uploads\/2021\/03\/Simulator-Screen-Shot-iPhone-12-2021-03-19-at-00.51.00\u306e\u30b3\u30d2\u309a\u30fc-300x292.png 300w, https:\/\/yakazoo.net\/wordpress\/wp-content\/uploads\/2021\/03\/Simulator-Screen-Shot-iPhone-12-2021-03-19-at-00.51.00\u306e\u30b3\u30d2\u309a\u30fc-768x749.png 768w\" sizes=\"auto, (max-width: 225px) 100vw, 225px\" \/><figcaption>\u5b8c\u6210\u30a4\u30e1\u30fc\u30b8<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u5186\u3092\u4f5c\u6210<\/h2>\n\n\n\n<p>\u307e\u305a\u306f\u3001\u30d9\u30fc\u30b9\u3068\u306a\u308b\u5186\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u5186\u306f<code>Circle<\/code>\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>ZStack\u3067\u56f2\u3080\u3053\u3068\u3067\u3001\u6b21\u306e\u4e8c\u3064\u76ee\u306e\u5186\u3092\u8ffd\u52a0\u51fa\u6765\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code swift\"><code>var body: some View {\n    ZStack {\n        Circle()\n            .stroke(lineWidth: 30.0)\n            .opacity(0.2)\n            .foregroundColor(Color(UIColor.blue))\n            .frame(width: 200, height: 200)\n    }\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/yakazoo.net\/wordpress\/wp-content\/uploads\/2021\/03\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2021-03-19-1.00.27-1.png\" alt=\"\" class=\"wp-image-174\" width=\"245\" height=\"207\" srcset=\"https:\/\/yakazoo.net\/wordpress\/wp-content\/uploads\/2021\/03\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2021-03-19-1.00.27-1.png 576w, https:\/\/yakazoo.net\/wordpress\/wp-content\/uploads\/2021\/03\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2021-03-19-1.00.27-1-300x254.png 300w\" sizes=\"auto, (max-width: 245px) 100vw, 245px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3064\u76ee\u306e\u5186\u306e\u4f5c\u6210<\/h2>\n\n\n\n<p>\u6b21\u306b\u4e8c\u3064\u76ee\u306e\u5186\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30dd\u30a4\u30f3\u30c8\u306f<code>.trim(from: 0.0, to: 0.3)<\/code>\u3067\u3059\u3002\u4e8c\u3064\u76ee\u306e\u5186\u3067\u9032\u6357\u3092\u8868\u793a\u3057\u307e\u3059\u3002\u3053\u306e0.3\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u3067\u3001\u9032\u6357\u7387\u3092\u5909\u66f4\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>.rotationEffect(Angle(degrees: -90))<\/code>\u306b\u3064\u3044\u3066\u3067\u3059\u304c\u3001\u5186\u306e\u59cb\u307e\u308a\u3092\u4e00\u756a\u4e0a\u306b\u6301\u3063\u3066\u304f\u308b\u305f\u3081\u306e\u51e6\u7406\u3067\u3059\u3002\u3053\u308c\u304c\u306a\u3044\u3068\u3001\u5186\u304c\u53f3\u7aef\u304b\u3089\u59cb\u307e\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>var body: some View {\n    ZStack {\n        Circle()\n            .stroke(lineWidth: 30.0)\n            .opacity(0.2)\n            .foregroundColor(Color(UIColor.blue))\n            .frame(width: 200, height: 200)\n\n        Circle()\n            .trim(from: 0.0, to: 0.3)\n            .stroke(style: StrokeStyle(lineWidth: 30.0, lineCap: .round, lineJoin: .round))\n            .foregroundColor(Color(UIColor.blue))\n            .frame(width: 200, height: 200)\n            .rotationEffect(Angle(degrees: -90))\n    }\n}<\/code><\/pre>\n\n\n\n<p>\u4ee5\u4e0a\u3067SwiftUI\u306e\u5186\u5f62\u306e\u30d7\u30ed\u30b0\u30ec\u30b9\u30fb\u9032\u6357\u8868\u793a\u306e\u5b9f\u88c5\u306f\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3068\u3066\u3082\u7c21\u5358\u3067\u3059\u306d\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u53c2\u8003<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.simpleswiftguide.com\/how-to-build-a-circular-progress-bar-in-swiftui\/\">https:\/\/www.simpleswiftguide.com\/how-to-build-a-circular-progress-bar-in-swiftui\/<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/yakazu\/circle_progress\">https:\/\/github.com\/yakazu\/circle_progress<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SwiftUI\u3067\u5186\u5f62\u306e\u30d7\u30ed\u30b0\u30ec\u30b9\u30fb\u9032\u6357\u8868\u793a\u3092\u5b9f\u88c5\u3059&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/yakazoo.net\/wordpress\/index.php\/2021\/03\/18\/170\/\">Continue reading<span class=\"screen-reader-text\">SwiftUI\u3067\u5186\u5f62\u306e\u9032\u6357\u8868\u793a\u65b9\u6cd5<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":163,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,17,11,10],"tags":[],"class_list":["post-170","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-swift","category-swiftui","category-11","category-10","entry"],"_links":{"self":[{"href":"https:\/\/yakazoo.net\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yakazoo.net\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yakazoo.net\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yakazoo.net\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yakazoo.net\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=170"}],"version-history":[{"count":4,"href":"https:\/\/yakazoo.net\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/170\/revisions"}],"predecessor-version":[{"id":178,"href":"https:\/\/yakazoo.net\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/170\/revisions\/178"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/yakazoo.net\/wordpress\/index.php\/wp-json\/wp\/v2\/media\/163"}],"wp:attachment":[{"href":"https:\/\/yakazoo.net\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yakazoo.net\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yakazoo.net\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}