{"id":1776,"date":"2021-03-31T13:10:56","date_gmt":"2021-03-31T04:10:56","guid":{"rendered":"http:\/\/hirlab.net\/nblog\/?p=1776"},"modified":"2021-03-31T13:15:55","modified_gmt":"2021-03-31T04:15:55","slug":"%e3%80%90%e7%ac%ac7%e5%9b%9e%e3%80%91%e6%97%a5%e6%9c%ac%e8%aa%9e%e7%89%88swiftui%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab%e3%80%90ui%e3%82%b3%e3%83%b3%e3%83%88%e3%83%ad%e3%83%bc","status":"publish","type":"post","link":"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1776\/","title":{"rendered":"\u3010\u7b2c7\u56de\u3011\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3010UI\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306e\u52d5\u4f5c\u3011"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_11 counter-hierarchy counter-decimal ez-toc-light-blue\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\">\u30b3\u30f3\u30c6\u30f3\u30c4<\/p>\n<span class=\"ez-toc-title-toggle\"><a class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\"><i class=\"ez-toc-glyphicon ez-toc-icon-toggle\"><\/i><\/a><\/span><\/div>\n<nav><ul class=\"ez-toc-list ez-toc-list-level-1\"><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1776\/#%E6%97%A5%E6%9C%AC%E8%AA%9E%E7%89%88SwiftUI%E3%83%81%E3%83%A5%E3%83%BC%E3%83%88%E3%83%AA%E3%82%A2%E3%83%AB\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1776\/#%E7%AC%AC7%E5%9B%9E%EF%BC%9AUI%E3%82%B3%E3%83%B3%E3%83%88%E3%83%AD%E3%83%BC%E3%83%AB%E3%81%AE%E5%8B%95%E4%BD%9C\" title=\"\u7b2c7\u56de\uff1aUI\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306e\u52d5\u4f5c\">\u7b2c7\u56de\uff1aUI\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306e\u52d5\u4f5c<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1776\/#Step_1_%E3%83%A6%E3%83%BC%E3%82%B6%E3%83%97%E3%83%AD%E3%83%95%E3%82%A3%E3%83%BC%E3%83%AB%E3%82%92%E8%A1%A8%E7%A4%BA%E3%81%99%E3%82%8B\" title=\"Step 1. \u30e6\u30fc\u30b6\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u3092\u8868\u793a\u3059\u308b\">Step 1. \u30e6\u30fc\u30b6\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u3092\u8868\u793a\u3059\u308b<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1776\/#Step_2_%E7%B7%A8%E9%9B%86%E3%83%A2%E3%83%BC%E3%83%89%E3%82%92%E8%BF%BD%E5%8A%A0%E3%81%99%E3%82%8B\" title=\"Step 2. \u7de8\u96c6\u30e2\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\">Step 2. \u7de8\u96c6\u30e2\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1776\/#Step_3_%E7%B7%A8%E9%9B%86%E3%83%93%E3%83%A5%E3%83%BC%E3%82%92%E5%AE%9A%E7%BE%A9%E3%81%99%E3%82%8B\" title=\"Step 3. \u7de8\u96c6\u30d3\u30e5\u30fc\u3092\u5b9a\u7fa9\u3059\u308b\">Step 3. \u7de8\u96c6\u30d3\u30e5\u30fc\u3092\u5b9a\u7fa9\u3059\u308b<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1776\/#Step_4_%E7%B7%A8%E9%9B%86%E3%81%AE%E4%BC%9D%E9%81%94%E3%82%92%E9%81%85%E3%82%89%E3%81%9B%E3%82%8B\" title=\"Step 4. \u7de8\u96c6\u306e\u4f1d\u9054\u3092\u9045\u3089\u305b\u308b\">Step 4. \u7de8\u96c6\u306e\u4f1d\u9054\u3092\u9045\u3089\u305b\u308b<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1776\/#%E7%AC%AC7%E5%9B%9E%EF%BC%9A%E3%81%8A%E3%82%8F%E3%82%8A%E3%81%AB\" title=\"\u7b2c7\u56de\uff1a\u304a\u308f\u308a\u306b\">\u7b2c7\u56de\uff1a\u304a\u308f\u308a\u306b<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"%E6%97%A5%E6%9C%AC%E8%AA%9E%E7%89%88SwiftUI%E3%83%81%E3%83%A5%E3%83%BC%E3%83%88%E3%83%AA%E3%82%A2%E3%83%AB\"><\/span>\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1379\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/0.png\" alt=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1200\" height=\"624\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/0.png 1200w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/0-300x156.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/0-768x399.png 768w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/0-1024x532.png 1024w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<p>\u672c\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306f\uff0c<a href=\"https:\/\/developer.apple.com\/tutorials\/swiftui\/\" target=\"_blank\" rel=\"noopener noreferrer\">Apple\u304c\u63b2\u8f09\u3057\u3066\u3044\u308b\u516c\u5f0f\u306eSwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb<\/a>\u3092\u300c\u65e5\u672c\u8a9e\u3067\u300d\u305d\u3057\u3066\u300c\u8a73\u7d30\u306b\u300d\u89e3\u8aac\u3057\u76f4\u3059\u3053\u3068\u3092\u76ee\u7684\u3068\u3057\u305f\u8a18\u4e8b\u3067\u3059\uff0e<\/p>\n<p>\u3053\u306e\u624b\u306e\u8a18\u4e8b\u306f\uff0c\u4ed6\u306b\u3082\u4f3c\u305f\u3088\u3046\u306a\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u304c\uff0c\u5168\u3066\u3092\u7db2\u7f85\u3057\u3066\u3044\u308b\u308f\u3051\u3067\u306f\u306a\u304f\uff0c\u90e8\u5206\u7684\u306b\u89e3\u8aac\u3057\u3066\u3044\u308b\u8a18\u4e8b\u304c\u591a\u6570\u3067\u3059\uff0e<\/p>\n<p>\u305d\u3053\u3067\uff0cSwiftUI\u3092\u4f7f\u3063\u3066\u30a2\u30d7\u30ea\u958b\u767a\u3092\u3057\u305f\u3044\u65b9\u3005\u306e\u305f\u3081\u306b\uff0c\u305d\u3057\u3066\u52c9\u5f37\u3057\u3066\u3044\u308b\u81ea\u5206\u81ea\u8eab\u306e\u305f\u3081\u306b\uff0c<strong>\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u5b8c\u5168\u7248<\/strong>\u3092\u66f8\u304d\u307e\u3059\uff0e<\/p>\n<p>\u306a\u304a\uff0c\u672c\u8a18\u4e8b\u306e\u96e3\u6613\u5ea6\u3068\u3057\u3066\u306f\uff0c\u521d\u7d1a\u8005\u3082\u898b\u69d8\u898b\u771f\u4f3c\u3067\u4f5c\u308c\u308b\u3088\u3046\u306b\u306f\u306a\u3063\u3066\u3044\u307e\u3059\u304c\uff0c<strong>\u305d\u308c\u3067\u306f\u7269\u8db3\u308a\u306a\u3044\u3068\u3044\u3046\u4e2d\u7d1a\u8005\u306e\u305f\u3081\u306b\uff0c\u7d30\u304b\u3044\u6587\u6cd5\u7684\u306a\u89e3\u8aac\u3082\u968f\u6240\u306b\u5165\u308c\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059<\/strong>\uff0e<\/p>\n<p>\u6ce8\u610f\u3068\u3057\u3066\uff0c\u672c\u8a18\u4e8b\u306fSwift\u306e\u8a00\u8a9e\u89e3\u8aac\u306f\u3042\u307e\u308a\u542b\u307e\u306a\u3044\u306e\u3067\uff0c\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3092\u5225\u30bf\u30d6\u3067\u958b\u3044\u3066\u304a\u3044\u3066\uff0c\u5206\u304b\u3089\u306a\u3051\u308c\u3070\u9010\u4e00\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3068\u826f\u3044\u3068\u601d\u3044\u307e\u3059\uff0e<\/p>\n<ol>\n<li><a href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1343\/\" target=\"_blank\" rel=\"noopener noreferrer\">Swift\u3092\u89e6\u3063\u305f\u3053\u3068\u304c\u306a\u3044\u30d7\u30ed\u30b0\u30e9\u30de\u30fc\u306e\u305f\u3081\u306eSwift\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb <i class=\"fas fa-external-link-alt\"><\/i><\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>\u3061\u306a\u307f\u306b\u51fa\u6765\u4e0a\u304c\u308b\u30a2\u30d7\u30ea\u306f\uff0c\u4e0a\u56f3\u306b\u793a\u3059\u3088\u3046\u306a<strong>\u89b3\u5149\u5730\u30a2\u30d7\u30ea<\/strong>\u3067\u3059\uff0e<\/p>\n<p>\u5404\u89b3\u5149\u5730\u306e\u4f4d\u7f6e\u60c5\u5831\u3092\u78ba\u8a8d\u3057\u305f\u308a\uff0c\u305d\u306e\u89b3\u5149\u5730\u3092\u304a\u6c17\u306b\u5165\u308a\u306b\u8ffd\u52a0\u3057\u305f\u308a\u3067\u304d\u308b\u30a2\u30d7\u30ea\u3092\u76ee\u6307\u3057\u307e\u3059\uff0e<\/p>\n<p>\u7b2c1\u56de\u306f????<\/p>\n<div style=\"max-width: 450px; height: auto;\"><a href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1375\/\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1430\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/thum1.png\" alt=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"100%\" height=\"auto\" \/><\/a><\/div>\n<h2><span class=\"ez-toc-section\" id=\"%E7%AC%AC7%E5%9B%9E%EF%BC%9AUI%E3%82%B3%E3%83%B3%E3%83%88%E3%83%AD%E3%83%BC%E3%83%AB%E3%81%AE%E5%8B%95%E4%BD%9C\"><\/span>\u7b2c7\u56de\uff1aUI\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306e\u52d5\u4f5c<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u7b2c7\u56de\u3067\u306f\uff0c\u7b2c4\u56de\u304b\u3089\u4f5c\u6210\u3057\u3066\u3044\u305f\u3082\u306e\u3092\u7528\u3044\u3066\uff0c<strong>\u30e6\u30fc\u30b6\u306e\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u60c5\u5831\u3092\u5909\u66f4\u30fb\u7ba1\u7406\u3059\u308b\u30d3\u30e5\u30fc<\/strong>\u3092\u4f5c\u6210\u3057\u3066\u3044\u304d\u307e\u3059\uff0e<\/p>\n<p>\u3053\u306e\u56de\u3067\u306f\uff0c\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u753b\u9762\u304b\u3089\u30e6\u30fc\u30b6\u306e\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u3092<strong>UI\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb<\/strong>\u3092\u7528\u3044\u3066\u7c21\u6613\u7684\u306b\u5909\u66f4\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\uff0e<\/p>\n<p>\u3064\u3044\u306b\u5168\u3066\u306e\u30d3\u30e5\u30fc\u304c\u3053\u3053\u3067\u7e4b\u304c\u308a\u307e\u3059\u306e\u3067\uff0c\u9811\u5f35\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff0e<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_1_%E3%83%A6%E3%83%BC%E3%82%B6%E3%83%97%E3%83%AD%E3%83%95%E3%82%A3%E3%83%BC%E3%83%AB%E3%82%92%E8%A1%A8%E7%A4%BA%E3%81%99%E3%82%8B\"><\/span>Step 1. \u30e6\u30fc\u30b6\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u3092\u8868\u793a\u3059\u308b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u307e\u305a\u306f\uff0c\u65b0\u305f\u306b\u300cProfiles\u300d\u3068\u3044\u3046\u30b0\u30eb\u30fc\u30d7\u3092\u4f5c\u6210\u3057\u307e\u3057\u3087\u3046\uff0e<\/p>\n<p>\u968e\u5c64\u306f\u300cHikes\u300d\u306a\u3069\u3068\u540c\u3058\u3067\u69cb\u3044\u307e\u305b\u3093\uff0e<\/p>\n<p>\u3055\u3089\u306b\uff0c\u300cProfile.swift\u300d\u3068\u8a00\u3046\u540d\u306e\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u60c5\u5831\u3092\u7ba1\u7406\u3059\u308b\u69cb\u9020\u4f53\u3092\u4f5c\u6210\u3057\u3066\u3044\u304d\u307e\u3059\uff0e<\/p>\n<p>\u3053\u306e\u69cb\u9020\u4f53\u3067\u306f\uff0c\u30e6\u30fc\u30b6\u540d\uff0c\u901a\u77e5ON\/OFF\uff0c\u5b63\u7bc0\u306e\u5199\u771f\uff0c\u30b4\u30fc\u30eb\u3057\u305f\u65e5\uff0c\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u3092\u7ba1\u7406\u3057\u307e\u3059\uff0e<\/p>\n<p>\u3057\u305f\u304c\u3063\u3066\uff0c<\/p>\n<pre class=\"lang:swift decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import Foundation\r\n\r\nstruct Profile {\r\n    var username: String\r\n    var prefersNotifications = true\r\n    var seasonalPhoto = Season.winter\r\n    var goalDate = Date()\r\n\r\n    \/\/ default\u306fswicth-case\u69cb\u6587\u3067\u4e88\u7d04\u3055\u308c\u305f\u5358\u8a9e\u306a\u306e\u3067\u901a\u5e38\u5909\u6570\u540d\u306a\u3069\u3067\u306f\u4f7f\u3048\u306a\u3044\uff0e\r\n    \/\/ \u3082\u3057\u5909\u6570\u540d\u3068\u3057\u3066\u3069\u3046\u3057\u3066\u3082\u6271\u3044\u305f\u3044\u5834\u5408\u306f\uff0c ` `\u3067\u56f2\u3080\r\n    static let `default` = Profile(username: \"g_kumar\")\r\n\r\n    enum Season: String, CaseIterable, Identifiable {\r\n        case spring = \"????\"\r\n        case summer = \"????\"\r\n        case autumn = \"????\"\r\n        case winter = \"\u2603\ufe0f\"\r\n\r\n        var id: String { self.rawValue }\r\n    }\r\n}<\/pre>\n<p>\u3072\u3068\u307e\u305a\u3053\u306e\u3088\u3046\u306a\u5f62\u306b\u3057\u307e\u3057\u3087\u3046\uff0e<\/p>\n<pre class=\"lang:swift decode:true \" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">static let `default` = Profile(username: \"g_kumar\")<\/pre>\n<p>\u3053\u306e\u90e8\u5206\uff0c\u81ea\u8eab\u306e\u69cb\u9020\u4f53\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u5185\u90e8\u3067\u30d7\u30ed\u30d1\u30c6\u30a3\u3068\u3057\u3066\u4fdd\u6301\u3057\u3066\u3044\u307e\u3059\u304c\uff0c\u3053\u308c\u306f<strong>\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3<\/strong>\u3068\u3044\u3046\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3\u306e\u4e00\u7a2e\u3067\u3059\uff0e<\/p>\n<p>\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u306f\u4e00\u8a00\u3067\u8868\u305b\u3070\u300c\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\uff08\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09\u3092\u4e00\u3064\u3057\u304b\u6301\u305f\u306a\u3044\u69cb\u9020\u4f53\u3084\u30af\u30e9\u30b9\u300d\u3092\u6307\u3057\u307e\u3059\uff0e<\/p>\n<p>\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u60c5\u5831\u306f\u5404\u30e6\u30fc\u30b6\u3067\uff0c\u305d\u308c\u305e\u308c\u8907\u6570\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u751f\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u305b\u3093\u306e\u3067\uff0c\u3053\u306e\u3088\u3046\u306b\u5236\u7d04\u3092\u304b\u3051\u308b\u306e\u3067\u3059\uff0e<\/p>\n<p>\u307e\u305f\uff0cSwift\u3067\u306f\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u306f\u901a\u5e38\uff0c<span class=\"lang:swift decode:true crayon-inline\">static<\/span>\u00a0\u3092\u7528\u3044\u3066\u5b9a\u7fa9\u3055\u308c\u307e\u3059\uff0e<\/p>\n<p>\u3055\u3066\uff0c\u3053\u306e\u69cb\u9020\u4f53\u3092\u7528\u3044\u3066\u5b9f\u969b\u306b\u30d3\u30e5\u30fc\u3092\u4f5c\u6210\u3057\u3066\u3044\u304d\u307e\u3059\uff0e<\/p>\n<p>\u307e\u305a\u52d5\u4f5c\u78ba\u8a8d\u304c\u3066\u3089\uff0cProfile\u3092\u7ba1\u7406\u3059\u308b\u300cProfileHost.swift\u300d\u3092\u4f5c\u3063\u3066\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff0e<\/p>\n<p>\u3072\u3068\u307e\u305a\u4ee5\u4e0b\u306e\u5f62\u3092\uff0c\u30d9\u30fc\u30b9\u3068\u3057\u3066\u304a\u304d\u307e\u3059\uff0e<\/p>\n<pre class=\"lang:swift decode:true \" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\n\r\nstruct ProfileHost: View {\r\n    @State private var draftProfile = Profile.default\r\n\r\n    var body: some View {\r\n        Text(\"Profile for: \\(draftProfile.username)\")\r\n    }\r\n}\r\n\r\nstruct ProfileHost_Previews: PreviewProvider {\r\n    static var previews: some View {\r\n        ProfileHost()\r\n    }\r\n}<\/pre>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1778\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-1.png\" alt=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1024\" height=\"606\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-1.png 1024w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-1-300x178.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-1-768x455.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>\u3046\u307e\u304f\u52d5\u4f5c\u3057\u3066\u3044\u307e\u3059\u306d\uff0e<\/p>\n<p>\u6b21\u306b\uff0c\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u8a73\u7d30\u3092\u7ba1\u7406\u3059\u308b\u305f\u3081\u306e\u30d3\u30e5\u30fc\u300cProfileSummary.swift\u300d\u3092\u5148\u306b\u4f5c\u6210\u3057\u307e\u3059\uff0e<\/p>\n<pre class=\"lang:swift decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\n\r\nstruct ProfileSummary: View {\r\n    var profile: Profile\r\n\r\n    var body: some View {\r\n        ScrollView {\r\n            VStack(alignment: .leading, spacing: 10) {\r\n                Text(profile.username)\r\n                    .bold()\r\n                    .font(.title)\r\n\r\n                Text(\"Notifications: \\(profile.prefersNotifications ? \"On\": \"Off\" )\")\r\n                Text(\"Seasonal Photos: \\(profile.seasonalPhoto.rawValue)\")\r\n                Text(\"Goal Date: \") + Text(profile.goalDate, style: .date)\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\nstruct ProfileSummary_Previews: PreviewProvider {\r\n    static var previews: some View {\r\n        ProfileSummary(profile: Profile.default)\r\n    }\r\n}<\/pre>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1779\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-2.png\" alt=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1024\" height=\"577\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-2.png 1024w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-2-300x169.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-2-768x433.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>\u3053\u3061\u3089\u3082\u3053\u306e\u3088\u3046\u306a\u611f\u3058\u306b\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\uff0e<\/p>\n<p>\u7279\u7b46\u3059\u3079\u304d\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\uff0e<\/p>\n<p>\u3053\u308c\u3092\uff0cProfileHost\u304b\u3089\u547c\u3073\u51fa\u3057\u307e\u3059\uff0e<\/p>\n<pre class=\"lang:swift mark:7-10 decode:true \" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\n\r\nstruct ProfileHost: View {\r\n    @State private var draftProfile = Profile.default\r\n\r\n    var body: some View {\r\n        VStack(alignment: .leading, spacing: 20) {\r\n            ProfileSummary(profile: draftProfile)\r\n        }\r\n        .padding()\r\n    }\r\n}<\/pre>\n<p>\u3053\u308c\u3082\u554f\u984c\u306a\u304f\u52d5\u4f5c\u3059\u308b\u306f\u305a\u3067\u3059\uff0e<\/p>\n<p>\u3055\u3066\u6b21\u306b\uff0cHikes\/\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u65b0\u305f\u306b\u300cHikeBadge.swift\u300d\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\uff0e<\/p>\n<p>\u524d\u306b\u4f5c\u6210\u3057\u305fBadge\u3092\u4f7f\u3063\u3066\uff0c\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u306b\u7372\u5f97\u3057\u305f\u30d0\u30c3\u30b8\u3092\u4e26\u3079\u3066\u307f\u307e\u3057\u3087\u3046\uff01<\/p>\n<pre class=\"lang:swift decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\n\r\nstruct HikeBadge: View {\r\n    var name: String  \/\/ \u30d0\u30c3\u30b8\u540d\r\n\r\n    var body: some View {\r\n        VStack(alignment: .center) {\r\n            Badge()\r\n                .frame(width: 300, height: 300)\r\n                .scaleEffect(1.0 \/ 3.0)\r\n                .frame(width: 100, height: 100)\r\n            Text(name)\r\n                .font(.caption)\r\n                .accessibilityLabel(\"Badge for \\(name).\")\r\n        }\r\n    }\r\n}\r\n\r\nstruct HikeBadge_Previews: PreviewProvider {\r\n    static var previews: some View {\r\n        HikeBadge(name: \"Preview Testing\")\r\n    }\r\n}<\/pre>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1780\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-3.png\" alt=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1024\" height=\"577\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-3.png 1024w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-3-300x169.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-3-768x433.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>\u6b21\u306b\uff0c\u3053\u308c\u3092ProfileSummary\u3067\u4e26\u3079\u3066\u307f\u307e\u3057\u3087\u3046\uff0e<\/p>\n<pre class=\"lang:swift mark:16-35 decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\n\r\nstruct ProfileSummary: View {\r\n    var profile: Profile\r\n\r\n    var body: some View {\r\n        ScrollView {\r\n            VStack(alignment: .leading, spacing: 10) {\r\n                Text(profile.username)\r\n                    .bold()\r\n                    .font(.title)\r\n\r\n                Text(\"Notifications: \\(profile.prefersNotifications ? \"On\": \"Off\" )\")\r\n                Text(\"Seasonal Photos: \\(profile.seasonalPhoto.rawValue)\")\r\n                Text(\"Goal Date: \") + Text(profile.goalDate, style: .date)\r\n                \r\n                Divider()  \/\/ \u6c34\u5e73\u7dda\u3067\u533a\u5207\u308b\r\n\r\n                VStack(alignment: .leading) {\r\n                    Text(\"Completed Badges\")\r\n                        .font(.headline)\r\n\r\n                    ScrollView(.horizontal) {\r\n                        HStack {\r\n                            HikeBadge(name: \"First Hike\")\r\n                            HikeBadge(name: \"Earth Day\")\r\n                                .hueRotation(Angle(degrees: 90))  \/\/ \u8272\u76f8\u74b0\u309290\u5ea6\u56de\u8ee2\u3055\u305b\u308b\r\n                            HikeBadge(name: \"Tenth Hike\")\r\n                                .grayscale(0.5)\r\n                                .hueRotation(Angle(degrees: 45))  \/\/ \u8272\u76f8\u74b0\u309245\u5ea6\u56de\u8ee2\u3055\u305b\u308b\r\n                        }\r\n                        .padding(.bottom)\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1783\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-4.png\" alt=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1024\" height=\"577\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-4.png 1024w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-4-300x169.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-4-768x433.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>\u6bb5\u3005\u30af\u30fc\u30eb\u306a\u30d3\u30e5\u30fc\u306b\u4ed5\u4e0a\u304c\u3063\u3066\u304d\u307e\u3057\u305f\u306d\uff0e<\/p>\n<p>\u3055\u3089\u306b\uff0cHike\u306e\u60c5\u5831\u3082\u76db\u308a\u8fbc\u3093\u3067\u3044\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n<p>\u307e\u305a\u306f<span class=\"lang:swift decode:true crayon-inline \">hikeData<\/span>\u00a0\u3092\u76e3\u8996\u53ef\u80fd\u3092\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u3057\u307e\u3059\uff0e<\/p>\n<pre class=\"lang:swift mark:7 decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\nimport Combine\r\n\r\nfinal class UserData: ObservableObject  {\r\n    @Published var showFavoritesOnly = false\r\n    @Published var landmarks = landmarkData\r\n    @Published var hikes = hikeData\r\n    @Published var features = featuresData\r\n    @Published var categories = categoriesData\r\n}<\/pre>\n<p>\u3042\u3068\u306f\uff0cProfileSummary\u3067\u547c\u3073\u51fa\u3059\u3060\u3051\u3067\u3059\uff0e<\/p>\n<pre class=\"lang:swift mark:4,36-44,53 decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">mport SwiftUI\r\n\r\nstruct ProfileSummary: View {\r\n    @EnvironmentObject var userData: UserData\r\n    var profile: Profile\r\n\r\n    var body: some View {\r\n        ScrollView {\r\n            VStack(alignment: .leading, spacing: 10) {\r\n                Text(profile.username)\r\n                    .bold()\r\n                    .font(.title)\r\n\r\n                Text(\"Notifications: \\(profile.prefersNotifications ? \"On\": \"Off\" )\")\r\n                Text(\"Seasonal Photos: \\(profile.seasonalPhoto.rawValue)\")\r\n                Text(\"Goal Date: \") + Text(profile.goalDate, style: .date)\r\n                \r\n                Divider()  \/\/ \u6c34\u5e73\u7dda\u3067\u533a\u5207\u308b\r\n\r\n                VStack(alignment: .leading) {\r\n                    Text(\"Completed Badges\")\r\n                        .font(.headline)\r\n\r\n                    ScrollView(.horizontal) {\r\n                        HStack {\r\n                            HikeBadge(name: \"First Hike\")\r\n                            HikeBadge(name: \"Earth Day\")\r\n                                .hueRotation(Angle(degrees: 90))  \/\/ \u8272\u76f8\u74b0\u309290\u5ea6\u56de\u8ee2\u3055\u305b\u308b\r\n                            HikeBadge(name: \"Tenth Hike\")\r\n                                .grayscale(0.5)\r\n                                .hueRotation(Angle(degrees: 45))  \/\/ \u8272\u76f8\u74b0\u309245\u5ea6\u56de\u8ee2\u3055\u305b\u308b\r\n                        }\r\n                        .padding(.bottom)\r\n                    }\r\n                }\r\n                \r\n                Divider()\r\n\r\n                VStack(alignment: .leading) {\r\n                    Text(\"Recent Hikes\")\r\n                        .font(.headline)\r\n\r\n                    HikeView(hike: userData.hikes[0])\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\nstruct ProfileSummary_Previews: PreviewProvider {\r\n    static var previews: some View {\r\n        ProfileSummary(profile: Profile.default)\r\n            .environmentObject(UserData())\r\n    }\r\n}\r\n<\/pre>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1785\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-5.png\" alt=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1024\" height=\"577\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-5.png 1024w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-5-300x169.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-5-768x433.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>\u3053\u3053\u307e\u3067\u304f\u308b\u3068\uff0c\u6bb5\u3005\u52dd\u624b\u304c\u308f\u304b\u3063\u3066\u304d\u307e\u3059\u306d\uff0e<\/p>\n<p>\u672c\u30b9\u30c6\u30c3\u30d7\u6700\u5f8c\u306b\uff0cCategoryHome\u304b\u3089\u3053\u306e\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\uff0e<\/p>\n<pre class=\"lang:swift mark:5,23-32 decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\n\r\nstruct CategoryHome: View {\r\n    @EnvironmentObject var userData: UserData\r\n    @State private var showingProfile = false\r\n    \r\n    var body: some View {\r\n        NavigationView{\r\n            List {\r\n                userData.features[0].image\r\n                    .resizable()\r\n                    .scaledToFill()\r\n                    .frame(height: 200)\r\n                    .clipped()\r\n                    .listRowInsets(EdgeInsets())\r\n                \r\n                ForEach(userData.categories.keys.sorted(), id: \\.self) { key in\r\n                    CategoryRow(categoryName: key, items: userData.categories[key]!)\r\n                }\r\n                .listRowInsets(EdgeInsets())\r\n            }\r\n            .navigationTitle(\"Featured\")\r\n            .toolbar {  \/\/ Navigation\u306eToolbar\u306b\u30d3\u30e5\u30fc\u3092\u8ffd\u52a0\r\n                Button(action: { showingProfile.toggle() }) {\r\n                    Image(systemName: \"person.crop.circle\")\r\n                        .accessibilityLabel(\"User Profile\")\r\n                }\r\n            }\r\n            .sheet(isPresented: $showingProfile) {  \/\/ showingProfile == true\u306a\u3089\u3070\u30b7\u30fc\u30c8\u3092\u958b\u304f\r\n                ProfileHost()\r\n                    .environmentObject(userData)\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1787\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-6.png\" alt=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1024\" height=\"577\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-6.png 1024w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-6-300x169.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-6-768x433.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1788\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-7.png\" alt=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1024\" height=\"577\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-7.png 1024w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-7-300x169.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-7-768x433.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u306e\u8868\u793a\u306f<strong>\u30b7\u30fc\u30c8\uff08Sheet\uff09<\/strong>\u3068\u547c\u3070\u308c\u308b\u30d3\u30e5\u30fc\u3092\u7528\u3044\u3066\u3044\u307e\u3059\uff0e<\/p>\n<p>\u4e0b\u304b\u3089\u30d3\u30e5\u30fc\u304c\u30cb\u30e7\u30ad\u3063\u3068\u8986\u3044\u88ab\u3055\u308b\u30d3\u30e5\u30fc\u3067\u3059\uff0e<\/p>\n<p>\u4ed5\u4e0a\u3052\u306b\uff0c\u30ea\u30b9\u30c8\u306e\u4f59\u767d\u3092\u6574\u3048\u308c\u3070\u3072\u3068\u307e\u305a\u5b8c\u6210\u3067\u3059\uff0e<\/p>\n<pre class=\"lang:swift mark:22 decode:true \" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\n\r\nstruct CategoryHome: View {\r\n    @EnvironmentObject var userData: UserData\r\n    @State private var showingProfile = false\r\n    \r\n    var body: some View {\r\n        NavigationView{\r\n            List {\r\n                userData.features[0].image\r\n                    .resizable()\r\n                    .scaledToFill()\r\n                    .frame(height: 200)\r\n                    .clipped()\r\n                    .listRowInsets(EdgeInsets())\r\n                \r\n                ForEach(userData.categories.keys.sorted(), id: \\.self) { key in\r\n                    CategoryRow(categoryName: key, items: userData.categories[key]!)\r\n                }\r\n                .listRowInsets(EdgeInsets())\r\n            }\r\n            .listStyle(InsetListStyle())\r\n            .navigationTitle(\"Featured\")\r\n            .toolbar {  \/\/ Navigation\u306eToolbar\u306b\u30d3\u30e5\u30fc\u3092\u8ffd\u52a0\r\n                Button(action: { showingProfile.toggle() }) {\r\n                    Image(systemName: \"person.crop.circle\")\r\n                        .accessibilityLabel(\"User Profile\")\r\n                }\r\n            }\r\n            .sheet(isPresented: $showingProfile) {  \/\/ showingProfile == true\u306a\u3089\u3070\u30b7\u30fc\u30c8\u3092\u958b\u304f\r\n                ProfileHost()\r\n                    .environmentObject(userData)\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1789\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-8.png\" alt=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1024\" height=\"577\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-8.png 1024w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-8-300x169.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-8-768x433.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_2_%E7%B7%A8%E9%9B%86%E3%83%A2%E3%83%BC%E3%83%89%E3%82%92%E8%BF%BD%E5%8A%A0%E3%81%99%E3%82%8B\"><\/span>Step 2. \u7de8\u96c6\u30e2\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u6b21\u306b\uff0c\u30e6\u30fc\u30b6\u306e\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u3092\u7de8\u96c6\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff0e<\/p>\n<p>\u3053\u3053\u3067\u306f\uff0c\u7c21\u6613\u7684\u306b\u300c\u30e6\u30fc\u30b6\u540d\u300d\u300c\u5b63\u7bc0\u306e\u5199\u771f\u300d\u3092\u7de8\u96c6\u3067\u304d\u308b\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u3066\u3044\u304d\u307e\u3059\uff0e<\/p>\n<p>\u65e9\u901f\u300cProfileHost.swift\u300d\u3092\u7de8\u96c6\u3057\u3066\u3044\u304d\u307e\u3059\u304c\uff0c<strong>\u4eca\u306e\u6bb5\u968e\u3067\u306f\u30d7\u30ec\u30d3\u30e5\u30fc\u304c\u52d5\u4f5c\u3057\u307e\u305b\u3093<\/strong>\uff0e<\/p>\n<p>\u3053\u308c\u306f\uff0c\u5b50\u30d3\u30e5\u30fc\u3067\u3042\u308b\u300cProfileSummary\u300d\u3067\u74b0\u5883\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u304b\u3089\u3067\u3059\uff0e<\/p>\n<p>\u306a\u306e\u3067\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306bProfileHost\u3067\u3082\u74b0\u5883\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u6e21\u3057\u3066\u3042\u3052\u307e\u3057\u3087\u3046\uff0e<\/p>\n<pre class=\"lang:swift mark:17 decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\n\r\nstruct ProfileHost: View {\r\n    @State private var draftProfile = Profile.default\r\n\r\n    var body: some View {\r\n        VStack(alignment: .leading, spacing: 20) {\r\n            ProfileSummary(profile: draftProfile)\r\n        }\r\n        .padding()\r\n    }\r\n}\r\n\r\nstruct ProfileHost_Previews: PreviewProvider {\r\n    static var previews: some View {\r\n        ProfileHost()\r\n            .environmentObject(UserData())\r\n    }\r\n}<\/pre>\n<p>\u3053\u308c\u3067\uff0c\u518d\u3073\u30d7\u30ec\u30d3\u30e5\u30fc\u304c\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u306f\u305a\u3067\u3059\uff0e<\/p>\n<p>\u3055\u3066\u672c\u984c\u306b\u79fb\u308a\u307e\u3059\u304c\uff0cSwiftUI\u3067\u306f\u3042\u3089\u304b\u3058\u3081\u300c\u7de8\u96c6\u30e2\u30fc\u30c9 (EditMode)\u300d\u3068\u3044\u3046\u6a5f\u80fd\u304c\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\uff0e<\/p>\n<p>\u3053\u308c\u306f\u305d\u306e\u540d\u306e\u901a\u308a\uff0c<strong>\u3082\u3068\u3082\u3068\u306e\u30d3\u30e5\u30fc\u3068\u7de8\u96c6\u30d3\u30e5\u30fc\u3092\u5207\u308a\u66ff\u3048\u308b<\/strong>\u305f\u3081\u306b\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\uff0e<\/p>\n<p>\u307e\u305a\u306f\u898b\u69d8\u898b\u771f\u4f3c\u3067\u5b9f\u88c5\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff0e<\/p>\n<pre class=\"lang:swift mark:4 decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\n\r\nstruct ProfileHost: View {\r\n    @Environment(\\.editMode) var editMode\r\n    @State private var draftProfile = Profile.default\r\n\r\n    var body: some View {\r\n        VStack(alignment: .leading, spacing: 20) {\r\n            ProfileSummary(profile: draftProfile)\r\n        }\r\n        .padding()\r\n    }\r\n}<\/pre>\n<p>\u6700\u521d\u306b\uff0c<strong>\u7de8\u96c6\u30e2\u30fc\u30c9\u304b\u5426\u304b\u3092\u4fdd\u6301\u3059\u308b\u30d7\u30ed\u30d1\u30c6\u30a3<span class=\"lang:swift decode:true crayon-inline \">editMode<\/span>\u00a0<\/strong>\u3092\u5b9a\u7fa9\u3057\u307e\u3057\u305f\uff0e<\/p>\n<p><span class=\"lang:swift decode:true crayon-inline \">\\.editMode<\/span> \u306fKeyPath\u3067\uff0c\u540d\u524d\u304c\u30d7\u30ed\u30d1\u30c6\u30a3\u540d\u3068\u540c\u3058\u3067\u3084\u3084\u3053\u3057\u3044\u3067\u3059\u304c\uff0c\u3053\u308c\u3068\u306f\u5225\u3067\u3059\uff0e<\/p>\n<p>\u305d\u3046\u3057\u305f\u3089\uff0c\u7de8\u96c6\u30dc\u30bf\u30f3\u3082\u3042\u3089\u304b\u3058\u3081\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u30d3\u30e5\u30fc\u306b\u8ffd\u52a0\u3057\u307e\u3057\u3087\u3046\uff0e<\/p>\n<pre class=\"lang:swift mark:9-13 decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\n\r\nstruct ProfileHost: View {\r\n    @Environment(\\.editMode) var editMode\r\n    @State private var draftProfile = Profile.default\r\n\r\n    var body: some View {\r\n        VStack(alignment: .leading, spacing: 20) {\r\n            HStack {\r\n                Spacer()\r\n                EditButton()\r\n            }\r\n            \r\n            ProfileSummary(profile: draftProfile)\r\n        }\r\n        .padding()\r\n    }\r\n}<\/pre>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1793\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-9.png\" alt=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1024\" height=\"610\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-9.png 1024w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-9-300x179.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-9-768x458.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>\u53f3\u4e0a\u306b\u7de8\u96c6\u30dc\u30bf\u30f3\u304c\u73fe\u308c\u307e\u3057\u305f\uff0e<\/p>\n<p>\u307e\u3060\u62bc\u3057\u3066\u3082\u30d3\u30e5\u30fc\u306f\u4f55\u3082\u5909\u308f\u308a\u307e\u305b\u3093\uff0e<\/p>\n<p>\u4eca\u304b\u3089\u7de8\u96c6\u30d3\u30e5\u30fc\u3092\u5b9f\u88c5\u3057\u3066\u3044\u304f\u306e\u3067\u3059\u304c\uff0c\u30e6\u30fc\u30b6\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u304c\u74b0\u5883\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u306a\u3044\u305f\u3081\u7de8\u96c6\u3057\u305f\u3068\u3057\u3066\u3082\uff0c\u305d\u306e\u5185\u5bb9\u304c\u4ed6\u306e\u30d3\u30e5\u30fc\u306b\u5171\u6709\u3055\u308c\u307e\u305b\u3093\uff0e<\/p>\n<p>\u305d\u3053\u3067\uff0c\u3042\u3089\u304b\u3058\u3081UserData\u306b\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\uff0e<\/p>\n<pre class=\"lang:swift mark:10 decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\nimport Combine\r\n\r\nfinal class UserData: ObservableObject  {\r\n    @Published var showFavoritesOnly = false\r\n    @Published var landmarks = landmarkData\r\n    @Published var hikes = hikeData\r\n    @Published var features = featuresData\r\n    @Published var categories = categoriesData\r\n    @Published var profile = Profile.default\r\n}<\/pre>\n<p>\u305d\u3046\u3057\u305f\u3089\uff0cProfileHost\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4fee\u6b63\u3057\u307e\u3059\uff0e<\/p>\n<pre class=\"lang:swift mark:5,6,15 decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\n\r\nstruct ProfileHost: View {\r\n    @Environment(\\.editMode) var editMode\r\n    @EnvironmentObject var userData: UserData\r\n\/\/    @State private var draftProfile = Profile.default\r\n\r\n    var body: some View {\r\n        VStack(alignment: .leading, spacing: 20) {\r\n            HStack {\r\n                Spacer()\r\n                EditButton()\r\n            }\r\n            \r\n            ProfileSummary(profile: userData.profile)\r\n        }\r\n        .padding()\r\n    }\r\n}<\/pre>\n<p>\u3053\u3053\u307e\u3067\u306f\uff0c\u30d7\u30ec\u30d3\u30e5\u30fc\u306b\u306a\u3093\u3089\u5909\u5316\u306f\u306a\u3044\u3067\u3059\uff0e<\/p>\n<p>\u3053\u3053\u3067\u7de8\u96c6\u30d3\u30e5\u30fc\u306f\u307e\u3060\u4f5c\u6210\u3057\u3066\u3044\u307e\u305b\u3093\u304c\uff0c\u7de8\u96c6\u30e2\u30fc\u30c9\u5207\u308a\u66ff\u3048\u304c\u3046\u307e\u304f\u52d5\u4f5c\u3059\u308b\u304b\u3060\u3051\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff0e<\/p>\n<pre class=\"lang:swift mark:15-19 decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\n\r\nstruct ProfileHost: View {\r\n    @Environment(\\.editMode) var editMode\r\n    @EnvironmentObject var userData: UserData\r\n\/\/    @State private var draftProfile = Profile.default\r\n\r\n    var body: some View {\r\n        VStack(alignment: .leading, spacing: 20) {\r\n            HStack {\r\n                Spacer()\r\n                EditButton()\r\n            }\r\n            \r\n            if editMode?.wrappedValue == .inactive {\r\n                ProfileSummary(profile: userData.profile)\r\n            } else {\r\n                Text(\"Profile Editor\")\r\n            }\r\n        }\r\n        .padding()\r\n    }\r\n}<\/pre>\n<p>\u3053\u308c\u3067\u300cEdit\u300d\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3053\u3068\u3067\u30d3\u30e5\u30fc\u306e\u5207\u308a\u66ff\u3048\u304c\u3067\u304d\u308b\u306f\u305a\u3067\u3059\uff08\u307e\u3060\u30c6\u30ad\u30b9\u30c8\u3060\u3051\u306e\u8cea\u7d20\u306a\u30d3\u30e5\u30fc\u3067\u3059\u304c...\uff09\uff0e<\/p>\n<p>\u307e\u305f\uff0c\u4e00\u65e6<span class=\"lang:swift decode:true crayon-inline \">draftProfile<\/span> \u306f\u7f6e\u3044\u3066\u304a\u304d\u307e\u3059 (\u5225\u306b\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u306f\u3057\u306a\u304f\u3066\u3082\u826f\u3044\u3067\u3059)\uff0e<\/p>\n<p>...<\/p>\n<p>\u3055\u3066\uff0c<span class=\"lang:swift decode:true crayon-inline\">editMode?.wrappedValue<\/span>\u00a0\u306f\uff0cOptional\u578b\u3067\u3042\u308b<span class=\"lang:swift decode:true crayon-inline\">editMode<\/span> \u3092\u30a2\u30f3\u30e9\u30c3\u30d7\u3057\u3066\u3044\u308b\u308f\u3051\u3067\u3059\u304c\uff0c<strong><span class=\"lang:swift decode:true crayon-inline\">?<\/span> (\u306f\u3066\u306a\/\u30af\u30a8\u30b9\u30c1\u30e7\u30f3\u30de\u30fc\u30af)\u306b\u3088\u308b\u30a2\u30f3\u30e9\u30c3\u30d7<\/strong>\u306f\u521d\u3081\u307e\u3057\u3066\u306e\u65b9\u3082\u591a\u3044\u3067\u3057\u3087\u3046\uff0e<\/p>\n<p>\u901a\u5e38\uff0c\u5f37\u5236\u7684\u306a\u30a2\u30f3\u30e9\u30c3\u30d7\u3067\u306f<span class=\"lang:swift decode:true crayon-inline \">!<\/span>\u00a0\u3092\u7528\u3044\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u304c\uff0c\u3053\u308c\u3092\u5229\u7528\u3057\u305f\u5834\u5408\uff0c<strong><span class=\"lang:swift decode:true crayon-inline\">nil<\/span>\u00a0\u304c\u51fa\u305f\u3068\u304d\u306b\u30e9\u30f3\u30bf\u30a4\u30e0\u30a8\u30e9\u30fc\u304c\u51fa\u529b\u3055\u308c\u30a2\u30d7\u30ea\u304c\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u307e\u3059<\/strong>\uff0e<\/p>\n<p>\u305d\u3053\u3067\uff0c<span class=\"lang:swift decode:true crayon-inline\">?<\/span> \u3092\u4f7f\u3063\u305f\u30a2\u30f3\u30e9\u30c3\u30d7\u3092\u3059\u308b\u308f\u3051\u3067\u3059\u304c\uff0c\u3053\u308c\u3092<strong>Optional Chaining<\/strong>\u3068\u547c\u3093\u3067\u3044\u307e\u3059\uff0e<\/p>\n<p>Optional Chaining\u306e\u5834\u5408\u306f\u30e9\u30f3\u30bf\u30a4\u30e0\u30a8\u30e9\u30fc\u306f\u767a\u751f\u3057\u307e\u305b\u3093\uff0e<\/p>\n<p>\u516c\u5f0f\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u300c<a href=\"https:\/\/docs.swift.org\/swift-book\/LanguageGuide\/OptionalChaining.html\" target=\"_blank\" rel=\"noopener noreferrer\">Optional Chaining<\/a>\u300d\u3067\u306f\uff0cOptional Chaining\u3067<span class=\"lang:swift decode:true crayon-inline \">nil<\/span>\u00a0\u304c\u51fa\u305f\u6642\u306f\u300cfails gracefully (\u6f54\u304f\u5931\u6557\u3059\u308b)\u300d\u3068\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u306d\uff0e<\/p>\n<p>\u307e\u3042\u3053\u308c\u306f\u3068\u3082\u304b\u304f\uff0c<span class=\"lang:swift decode:true crayon-inline\">editMode<\/span>\u00a0\u306f\u5217\u6319\u578b\u306a\u306e\u3067<span class=\"lang:swift decode:true crayon-inline \">.wrappedValue<\/span> \u3067\uff0c\u305d\u306e\u5024\u3092\u53d6\u308a\u51fa\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u610f\u5473\u3057\u3066\u3044\u307e\u3059\uff0e<\/p>\n<p>\u305d\u308c\u304c\uff0c<span class=\"lang:swift decode:true crayon-inline \">.inactive<\/span> (\u30a2\u30af\u30c6\u30a3\u30d6\u3067\u306a\u3044) \u306a\u3089\u3070ProfileSummary\u3092\u8868\u793a\u3059\u308b\uff0c\u305d\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\uff0e<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_3_%E7%B7%A8%E9%9B%86%E3%83%93%E3%83%A5%E3%83%BC%E3%82%92%E5%AE%9A%E7%BE%A9%E3%81%99%E3%82%8B\"><\/span>Step 3. \u7de8\u96c6\u30d3\u30e5\u30fc\u3092\u5b9a\u7fa9\u3059\u308b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u305d\u3046\u3057\u305f\u3089\u6700\u5f8c\u306b\uff0c\u7de8\u96c6\u30d3\u30e5\u30fc\u3092\u4f5c\u6210\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n<p>\u7de8\u96c6\u30d3\u30e5\u30fc\u306f\uff0c\u30e6\u30fc\u30b6\u30c7\u30fc\u30bf\u3092\u7de8\u96c6\u3059\u308b\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u304c\uff0c\u3082\u3061\u308d\u3093\u7de8\u96c6\u3055\u308c\u3066\u306f\u3044\u3051\u306a\u3044\u3082\u306e\u3082\u3042\u308a\u307e\u3059\uff08\u4f8b\u3048\u3070\u30d0\u30c3\u30b8\u3068\u304b\uff09\uff0e<\/p>\n<p>\u305d\u3046\u3044\u3063\u305f\u3082\u306e\u4ee5\u5916\u3092\u7de8\u96c6\u3067\u304d\u308b\u3088\u3046\u306a\u30d3\u30e5\u30fc\u3092\u69cb\u7bc9\u3057\u3066\u3044\u304d\u307e\u3059\uff0e<\/p>\n<p>\u307e\u305a\u306f\u65b0\u305f\u306b\u300cProfileEditor.swift\u300d\u3092\u4f5c\u6210\u3057\u307e\u3057\u3087\u3046\uff0e<\/p>\n<p>\u521d\u671f\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u306b\u3057\u3066\u304a\u304d\u307e\u3059\uff0e<\/p>\n<pre class=\"lang:swift decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\n\r\nstruct ProfileEditor: View {\r\n    @Binding var profile: Profile\r\n    \r\n    var body: some View {\r\n        List {\r\n            HStack {\r\n                Text(\"Username\").bold()\r\n                Divider()\r\n                TextField(\"Username\", text: $profile.username)\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\nstruct ProfileEditor_Previews: PreviewProvider {\r\n    static var previews: some View {\r\n        ProfileEditor(profile: .constant(.default))\r\n    }\r\n}<\/pre>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1798\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-10.png\" alt=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1024\" height=\"610\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-10.png 1024w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-10-300x179.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-10-768x458.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>\u3053\u3053\u3067\uff0c<span class=\"lang:swift decode:true crayon-inline \">@Binding<\/span>\u00a0\u304c\u521d\u767b\u5834\u3067\u3059\u304c\uff0c\u3053\u308c\u306f<span class=\"lang:swift decode:true crayon-inline \">@State<\/span>\u00a0\u3068\u540c\u3058\u304f\u300c\u30d3\u30e5\u30fc\u3092\u8d85\u3048\u3066\u5909\u66f4\u3092\u901a\u77e5\u3059\u308b\u300d\u305f\u3081\u306ePropatyWrapper\u3067\u3059\uff0e<\/p>\n<p>\u57fa\u672c\u7684\u306b\u306f2\u3064\u3068\u3082\u540c\u3058\u3088\u3046\u306a\u6319\u52d5\u3092\u3068\u308b\u306e\u3067\u3059\u304c\uff0c\u9055\u3044\u306f\u306a\u3093\u3067\u3057\u3087\u3046\uff1f<\/p>\n<p>\u9055\u3044\u306f\u89aa\u30d3\u30e5\u30fc\u3067\u5b9a\u7fa9\u3055\u308c\u305f<strong><span class=\"lang:swift decode:true crayon-inline\">@State<\/span>\u00a0\u30d7\u30ed\u30d1\u30c6\u30a3\u306f\u5916\u90e8\u30d3\u30e5\u30fc\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u3092\u57fa\u672c\u7684\u306b\u53d7\u3051\u4ed8\u3051\u306a\u3044<\/strong>\u3068\u3044\u3046\u70b9\u3067\u3059\uff08<span class=\"lang:swift decode:true crayon-inline \">private<\/span> \u4fee\u98fe\u5b50\u3092\u4ed8\u3051\u308b\u306e\u3092\u63a8\u5968\u3057\u3066\u3044\u308b\u305f\u3081\uff09\uff0e<\/p>\n<p>\u3057\u304b\u3057\uff0c\u5b50\u30d3\u30e5\u30fc\u306b\u304a\u3044\u3066\u3082\u540c\u3058\u304f\u305d\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u5024\u3092\u76f4\u63a5\u5909\u66f4\u3057\u305f\u3044\u5834\u5408\u304c\u3088\u304f\u3042\u308a\u307e\u3059\uff0e<\/p>\n<p>\u305d\u306e\u3088\u3046\u306a\u3068\u304d\u306b\uff0c<span class=\"lang:swift decode:true crayon-inline\">@Binding<\/span>\u00a0\u30d7\u30ed\u30d1\u30c6\u30a3\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u3066\u3042\u3052\u308b\u306e\u3067\u3059\uff0e<\/p>\n<p>\u8981\u3059\u308b\u306b\uff0c\u89aa\u30d3\u30e5\u30fc\u3067\u5b9a\u7fa9\u3055\u308c\u305f<span class=\"lang:swift decode:true crayon-inline\">@State<\/span> \u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u5b50\u30d3\u30e5\u30fc\u3067\u6271\u3046\u305f\u3081\u306b\u306f\uff0c<span class=\"lang:swift decode:true crayon-inline\">@Binding<\/span>\u00a0\u30d7\u30ed\u30d1\u30c6\u30a3\u3068\u3057\u3066\u5b9a\u7fa9\u3059\u308b\uff0c\u3068\u3044\u3046\u3053\u3068\u3067\u3059\uff0e<\/p>\n<p>\u307e\u305f\uff0c\u524d\u306b\u3082\u767b\u5834\u3057\u307e\u3057\u305f\u304c\uff0c<strong><span class=\"lang:swift decode:true crayon-inline\">@State<\/span>\u00a0\u304a\u3088\u3073<span class=\"lang:swift decode:true crayon-inline\">@Binding<\/span>\u00a0\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u5024\u3092\u7de8\u96c6\u3059\u308b\u3068\u304d\u306b\u306f\uff0c<span class=\"lang:swift decode:true crayon-inline \">$<\/span>\u00a0\u3092\u4ed8\u3051\u3066\u3042\u3052\u307e\u3057\u3087\u3046<\/strong>\uff0e<\/p>\n<p>\u305d\u3046\u3057\u305f\u3089\uff0cProfileHost\u306b\u623b\u308a\u4eca\u4f5c\u6210\u3057\u305f\u7de8\u96c6\u30d3\u30e5\u30fc\u3092\u7d10\u4ed8\u3051\u307e\u3059\uff0e<\/p>\n<pre class=\"lang:swift mark:6,18 decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\n\r\nstruct ProfileHost: View {\r\n    @Environment(\\.editMode) var editMode\r\n    @EnvironmentObject var userData: UserData\r\n    @State private var draftProfile = Profile.default\r\n\r\n    var body: some View {\r\n        VStack(alignment: .leading, spacing: 20) {\r\n            HStack {\r\n                Spacer()\r\n                EditButton()\r\n            }\r\n            \r\n            if editMode?.wrappedValue == .inactive {\r\n                ProfileSummary(profile: userData.profile)\r\n            } else {\r\n                ProfileEditor(profile: $draftProfile)\r\n            }\r\n        }\r\n        .padding()\r\n    }\r\n}<\/pre>\n<p>\u3053\u3053\u3067\uff0c<span class=\"lang:swift decode:true crayon-inline \">draftProfile<\/span>\u00a0\u3092\u6e21\u3059\u5f62\u306b\u3057\u3066\u304a\u304d\u307e\u3059\uff0e<\/p>\n<p>\u4eca\u306e\u6bb5\u968e\u3067\u306f\uff0c<strong>\u7de8\u96c6\u30d3\u30e5\u30fc\u3067\u7de8\u96c6\u3057\u305f\u30e6\u30fc\u30b6\u540d\u306e\u53cd\u6620\u306f\u307e\u3060\u3055\u308c\u307e\u305b\u3093<\/strong>\u304c\uff0c\u30d3\u30e5\u30fc\u306e\u5207\u308a\u66ff\u3048\u304c\u3046\u307e\u304f\u3044\u3063\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\uff0e<\/p>\n<p>\u307e\u305f\uff0cProfileEditor\u306b\u623b\u308a\u307e\u3059\uff0e<\/p>\n<p>\u6b21\u306b\uff0c\u89b3\u5149\u5730\u306b\u95a2\u3059\u308b\u30a4\u30d9\u30f3\u30c8\u901a\u77e5\u3092\u884c\u3046\u304b\u5426\u304b\uff0c\u3092\u5207\u308a\u66ff\u3048\u308b<strong>\u30c8\u30b0\u30eb\u30b9\u30a4\u30c3\u30c1<\/strong>\u3092\u8ffd\u52a0\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff0e<\/p>\n<pre class=\"lang:swift mark:13-16 decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\n\r\nstruct ProfileEditor: View {\r\n    @Binding var profile: Profile\r\n    \r\n    var body: some View {\r\n        List {\r\n            HStack {\r\n                Text(\"Username\").bold()\r\n                Divider()\r\n                TextField(\"Username\", text: $profile.username)\r\n            }\r\n            \r\n            Toggle(isOn: $profile.prefersNotifications) {\r\n                Text(\"Enable Notifications\").bold()\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1801\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-11.png\" alt=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1024\" height=\"610\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-11.png 1024w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-11-300x179.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-11-768x458.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>\u7d9a\u3044\u3066\uff0c\u5b63\u7bc0\u306e\u5199\u771f\u3092\u9078\u3076\u305f\u3081\u306e\uff0c<strong>Picker\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb<\/strong>\u3092\u914d\u7f6e\u3057\u307e\u3059\uff0e<\/p>\n<p>\u3053\u3053\u3067\u5217\u6319\u578b\u306e\u5168\u30b1\u30fc\u30b9\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3082\u899a\u3048\u3066\u304a\u304d\u307e\u3057\u3087\u3046\uff0e<\/p>\n<pre class=\"lang:swift mark:17-27 decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\n\r\nstruct ProfileEditor: View {\r\n    @Binding var profile: Profile\r\n    \r\n    var body: some View {\r\n        List {\r\n            HStack {\r\n                Text(\"Username\").bold()\r\n                Divider()\r\n                TextField(\"Username\", text: $profile.username)\r\n            }\r\n            \r\n            Toggle(isOn: $profile.prefersNotifications) {\r\n                Text(\"Enable Notifications\").bold()\r\n            }\r\n            \r\n            VStack(alignment: .leading, spacing: 20) {  \/\/ \u5de6\u3088\u305b\r\n                Text(\"Seasonal Photo\").bold()\r\n                \r\n                Picker(\"Seasonal Photo\", selection: $profile.seasonalPhoto) {  \/\/ Picker\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\r\n                    ForEach(Profile.Season.allCases) { season in  \/\/ \u5217\u6319\u578b\u306e\u5168\u30b1\u30fc\u30b9\u3092\u53d6\u5f97\u3057\u8868\u793a\r\n                        Text(season.rawValue).tag(season)  \/\/ .tag()\u3067\u9078\u3070\u308c\u3066\u3044\u308b\u3082\u306e\u3092\u5f37\u8abf\r\n                    }\r\n                }\r\n                .pickerStyle(SegmentedPickerStyle())  \/\/ \u6a2a\u4e26\u3073\u306ePicker\u30b9\u30bf\u30a4\u30eb\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1802\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-12.png\" alt=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1024\" height=\"610\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-12.png 1024w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-12-300x179.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-12-768x458.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>\u3061\u306a\u307f\u306b\uff0c<span class=\"lang:swift decode:true crayon-inline \">.pickerStyle(SegmentedPickerStyle())<\/span> \u3092\u8a18\u8ff0\u3057\u306a\u3044\u3068\uff0c\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u7e26\u578b\u30ed\u30fc\u30eb\u306ePicker\u30b9\u30bf\u30a4\u30eb\u306b\u306a\u308a\u307e\u3059\uff0e<\/p>\n<p>\u6700\u5f8c\u306b\uff0cDatePicker (\u65e5\u4ed8\u9078\u629e\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb) \u3092\u8ffd\u52a0\u3057\u3066\uff0c\u89b3\u5149\u5730\u8a2a\u554f\u306e\u76ee\u6a19\u65e5\u4ed8\u3092\u9078\u629e\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\uff0e<\/p>\n<pre class=\"lang:swift mark:5-11,35-38 decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\n\r\nstruct ProfileEditor: View {\r\n    @Binding var profile: Profile\r\n    \r\n    var dateRange: ClosedRange&lt;Date&gt; {\r\n        \/\/ \u524d\u5f8c1\u5e74\u9593\u306e\u30ab\u30ec\u30f3\u30c0\u30fc\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308bComputed propaty\r\n        let min = Calendar.current.date(byAdding: .year, value: -1, to: profile.goalDate)!\r\n        let max = Calendar.current.date(byAdding: .year, value: 1, to: profile.goalDate)!\r\n        return min...max\r\n    }\r\n    \r\n    var body: some View {\r\n        List {\r\n            HStack {\r\n                Text(\"Username\").bold()\r\n                Divider()\r\n                TextField(\"Username\", text: $profile.username)\r\n            }\r\n            \r\n            Toggle(isOn: $profile.prefersNotifications) {\r\n                Text(\"Enable Notifications\").bold()\r\n            }\r\n            \r\n            VStack(alignment: .leading, spacing: 20) {\r\n                Text(\"Seasonal Photo\").bold()\r\n                \r\n                Picker(\"Seasonal Photo\", selection: $profile.seasonalPhoto) {\r\n                    ForEach(Profile.Season.allCases) { season in\r\n                        Text(season.rawValue).tag(season)\r\n                    }\r\n                }\r\n                .pickerStyle(SegmentedPickerStyle())\r\n            }\r\n            \r\n            DatePicker(selection: $profile.goalDate, in: dateRange, displayedComponents: .date) {\r\n                Text(\"Goal Date\").bold()\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p>Swift\u306e<span class=\"lang:swift decode:true crayon-inline\">Calendar<\/span>\u00a0\u306e\u4f7f\u3044\u65b9\u3082\u76f4\u611f\u7684\u3067\u308f\u304b\u308a\u3084\u3059\u3044\u3067\u3059\u306d\uff0e<\/p>\n<p>\u3061\u306a\u307f\u306b\uff0c<span class=\"lang:swift decode:true crayon-inline \">a..&lt;b<\/span>\u00a0\u306fRange\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff0c<span class=\"lang:swift decode:true crayon-inline \">a...b<\/span>\u00a0\u306fClosedRange\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u306a\u308a\u307e\u3059\uff0e<\/p>\n<p>Countable\u304b\u5426\u304b\u3082Range\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u306f\u5b58\u5728\u3057\u307e\u3059\u304c\uff0c\u305d\u306e\u3042\u305f\u308a\u306f\u3053\u308c\u3089\u306e\u5358\u8a9e\u3067\u8abf\u3079\u3066\u307f\u308b\u3068\u826f\u3044\u3067\u3057\u3087\u3046\uff0e<\/p>\n<p>\u4eca\u56de\u306f\u5272\u611b\u3057\u307e\u3059\uff0e<\/p>\n<p>\u3046\u307e\u304f\u5b9f\u88c5\u3067\u304d\u3066\u3044\u308c\u3070\uff0c\u4e0b\u56f3\u306e\u3088\u3046\u306b\u30ab\u30ec\u30f3\u30c0\u30fc\u3067\u65e5\u4ed8\u8a2d\u5b9a\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u306f\u305a\u3067\u3059\uff0e<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1804\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-13.png\" alt=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1024\" height=\"610\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-13.png 1024w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-13-300x179.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-13-768x458.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_4_%E7%B7%A8%E9%9B%86%E3%81%AE%E4%BC%9D%E9%81%94%E3%82%92%E9%81%85%E3%82%89%E3%81%9B%E3%82%8B\"><\/span>Step 4. \u7de8\u96c6\u306e\u4f1d\u9054\u3092\u9045\u3089\u305b\u308b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u7b2c7\u56de\u6700\u5f8c\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u3059\uff0e<\/p>\n<p>\u30e6\u30fc\u30b6\u306e\u7de8\u96c6\u4e2d\u306b\u306f\uff0c\u305d\u306e\u5185\u5bb9\u5909\u66f4\u3092\u4ed6\u306e\u30d3\u30e5\u30fc\u306b\u4f1d\u9054\u3057\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\uff0e<\/p>\n<p>\u3082\u3057\uff0c<strong>\u9014\u4e2d\u3067\u7de8\u96c6\u5185\u5bb9\u3092\u7834\u68c4 (Cancel) \u3057\u305f\u304f\u306a\u3063\u305f\u3089\uff1f<\/strong><\/p>\n<p>\u305d\u306e\u3088\u3046\u306a\u3068\u304d\u306f\uff0c<strong>\u7de8\u96c6\u5185\u5bb9\u3092\u78ba\u5b9a\u3059\u308b\u307e\u3067\uff0c\u4e0b\u66f8\u304d\u4fdd\u5b58\u306b\u5272\u308a\u5f53\u3066<\/strong>\u3066\u304a\u304d\uff0c\u7de8\u96c6\u304c\u78ba\u5b9a\u3057\u305f\u3089\u672c\u7269\u306e\u30b3\u30d4\u30fc\u3092\u53d6\u308b\u3088\u3046\u306b\u3059\u308c\u3070\u826f\u3044\u306e\u3067\u3059\uff0e<\/p>\n<p>\u307e\u305a\u6700\u521d\u306b\uff0cProfileHost\u306eEdit\u30dc\u30bf\u30f3\u306e\u6a2a\u306b\uff0c\u65b0\u305f\u306b\u300cCancel\u300d\u30dc\u30bf\u30f3\u3092\u8ffd\u52a0\u3057\u307e\u3057\u3087\u3046\uff0e<\/p>\n<p>\u305d\u306e\u3068\u304d\u306b\uff0c<span class=\"lang:swift decode:true crayon-inline \">draftProfile<\/span> (\u4e0b\u66f8\u304d\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb) \u3092\u5229\u7528\u3057\u3066\uff0c\u7de8\u96c6\u524d\u306e\u30c7\u30fc\u30bf\u3092\u4fdd\u6301\u3057\u3066\u304a\u304d\u307e\u3059\uff0e<\/p>\n<pre class=\"lang:swift mark:11-16 decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\n\r\nstruct ProfileHost: View {\r\n    @Environment(\\.editMode) var editMode\r\n    @EnvironmentObject var userData: UserData\r\n    @State private var draftProfile = Profile.default\r\n\r\n    var body: some View {\r\n        VStack(alignment: .leading, spacing: 20) {\r\n            HStack {\r\n                if editMode?.wrappedValue == .active {\r\n                    Button(\"Cancel\") {\r\n                        draftProfile = userData.profile\r\n                        editMode?.animation().wrappedValue = .inactive\r\n                    }\r\n                }\r\n                Spacer()\r\n                EditButton()\r\n            }\r\n            \r\n            if editMode?.wrappedValue == .inactive {\r\n                ProfileSummary(profile: userData.profile)\r\n            } else {\r\n                ProfileEditor(profile: $draftProfile)\r\n            }\r\n        }\r\n        .padding()\r\n    }\r\n}<\/pre>\n<p>\u6700\u5f8c\u306b\uff0c\u7de8\u96c6\u3057\u305f\u5185\u5bb9\u3092\u66f4\u65b0\u3059\u308b\u3088\u3046\u306b\u3059\u308c\u3070\u7de8\u96c6\u6a5f\u80fd\u304c\u5168\u3066\u3046\u307e\u304f\u52d5\u4f5c\u3059\u308b\u306f\u305a\u3067\u3059\uff0e<\/p>\n<p>\u3053\u306e\u3068\u304d\uff0c<span class=\"lang:swift decode:true crayon-inline\">onAppear(perform:)<\/span>\u00a0\u4fee\u98fe\u5b50\u3068<span class=\"lang:swift decode:true crayon-inline\">onDisappear(perform:)<\/span>\u00a0\u4fee\u98fe\u5b50\u3092\u5229\u7528\u3057\u307e\u3059\uff0e<\/p>\n<p>\u7de8\u96c6\u30e2\u30fc\u30c9\u3067\u300cDone\u300d\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u305f\u3068\u304d\u306b\u306f\u524d\u8005\uff0c\u300cCancel\u300d\u30dc\u30bf\u30f3\u306e\u3068\u304d\u306f\u5f8c\u8005\u304c\u53cd\u5fdc\u3057\u307e\u3059\uff0e<\/p>\n<pre class=\"lang:swift mark:25-30 decode:true\" title=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\n\r\nstruct ProfileHost: View {\r\n    @Environment(\\.editMode) var editMode\r\n    @EnvironmentObject var userData: UserData\r\n    @State private var draftProfile = Profile.default\r\n\r\n    var body: some View {\r\n        VStack(alignment: .leading, spacing: 20) {\r\n            HStack {\r\n                if editMode?.wrappedValue == .active {\r\n                    Button(\"Cancel\") {\r\n                        draftProfile = userData.profile\r\n                        editMode?.animation().wrappedValue = .inactive\r\n                    }\r\n                }\r\n                Spacer()\r\n                EditButton()\r\n            }\r\n            \r\n            if editMode?.wrappedValue == .inactive {\r\n                ProfileSummary(profile: userData.profile)\r\n            } else {\r\n                ProfileEditor(profile: $draftProfile)\r\n                    .onAppear {  \/\/ Done\r\n                        draftProfile = userData.profile\r\n                    }\r\n                    .onDisappear {  \/\/ Cancel\r\n                        userData.profile = draftProfile\r\n                    }\r\n            }\r\n        }\r\n        .padding()\r\n    }\r\n}<\/pre>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1806\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-14.png\" alt=\"\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1024\" height=\"610\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-14.png 1024w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-14-300x179.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2021\/03\/7-14-768x458.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>\u3046\u307e\u304f\u7de8\u96c6\u304c\u540c\u671f\u3067\u304d\u307e\u3057\u305f\u304b\uff1f<\/p>\n<p>Done\/Cancel\u3069\u3061\u3089\u3082\u3046\u307e\u304f\u52d5\u4f5c\u3059\u308b\u304b\u78ba\u8a8d\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff0e<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E7%AC%AC7%E5%9B%9E%EF%BC%9A%E3%81%8A%E3%82%8F%E3%82%8A%E3%81%AB\"><\/span>\u7b2c7\u56de\uff1a\u304a\u308f\u308a\u306b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\uff0e<\/p>\n<p>\u3044\u3088\u3044\u3088\u672c\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3082\u7d42\u76e4\u306b\u5165\u308a\u307e\u3059\uff0e<\/p>\n<p>\u3042\u3068\u306f\uff0cUI\u3092\u3082\u3046\u5c11\u3057\u6574\u3048\u3066\u5b8c\u6210\u3055\u305b\u308b\u3060\u3051\u3067\u3059\u304c\uff0cApple watchOS\u3084macOS\u306b\u3082\u5bfe\u5fdc\u3055\u305b\u308b\u306b\u306f\u3069\u3046\u3059\u308c\u3070\u826f\u3044\u306e\u304b\u306a\u3069\u3082\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306b\u542b\u307e\u308c\u3066\u3044\u307e\u3059\uff0e<\/p>\n<p>\u6b8b\u3059\u3068\u3053\u308d\uff0c\u3042\u30683\u56de\u9811\u5f35\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n<p>&nbsp;<\/p>\n<div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306f\uff0c\u57fa\u672c\u7684\u306b\u672c\u5bb6SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306b\u5023\u3063\u3066\u9032\u3081\u3066\u3044\u304d\u307e\u3059\uff0e\u305f\u3060\u516c\u5f0f\u3068\u9055\u3046\u70b9\u306f\u300c\u65e5\u672c\u8a9e\u3067\u3042\u308b\u3053\u3068\u300d\u3068\u300c\u89e3\u8aac\u3092\u7d30\u304b\u304f\u5165\u308c\u3066\u3042\u308b\u3053\u3068\u300d\u3067\u3059\uff0e\u306a\u306e\u3067\uff0c\u521d\u5fc3\u8005\u306f\u3082\u3061\u308d\u3093\uff0c\u4e2d\u7d1a\u8005\u30d7\u30ed\u30b0\u30e9\u30de\u306e\u65b9\u306b\u3082\u6e80\u8db3\u3057\u3066\u3082\u3089\u3048\u308b\u3088\u3046\u306a\u3082\u306e\u3092\u76ee\u6307\u3057\u3066\u3044\u307e\u3059\uff0e\u3055\u3066\u7b2c7\u56de\u76ee\u306fUI\u3092\u4f7f\u3063\u305f\u30c7\u30fc\u30bf\u306e\u7de8\u96c6\u3092\u5b9f\u88c5\u3057\u3066\u3044\u304d\u307e\u3059\uff0e<\/p>\n","protected":false},"author":1,"featured_media":1808,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[83,81,82],"_links":{"self":[{"href":"https:\/\/hirlab.net\/nblog\/wp-json\/wp\/v2\/posts\/1776"}],"collection":[{"href":"https:\/\/hirlab.net\/nblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hirlab.net\/nblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hirlab.net\/nblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hirlab.net\/nblog\/wp-json\/wp\/v2\/comments?post=1776"}],"version-history":[{"count":17,"href":"https:\/\/hirlab.net\/nblog\/wp-json\/wp\/v2\/posts\/1776\/revisions"}],"predecessor-version":[{"id":1813,"href":"https:\/\/hirlab.net\/nblog\/wp-json\/wp\/v2\/posts\/1776\/revisions\/1813"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hirlab.net\/nblog\/wp-json\/wp\/v2\/media\/1808"}],"wp:attachment":[{"href":"https:\/\/hirlab.net\/nblog\/wp-json\/wp\/v2\/media?parent=1776"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hirlab.net\/nblog\/wp-json\/wp\/v2\/categories?post=1776"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hirlab.net\/nblog\/wp-json\/wp\/v2\/tags?post=1776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}