{"id":1294,"date":"2020-08-18T23:15:56","date_gmt":"2020-08-18T14:15:56","guid":{"rendered":"http:\/\/hirlab.net\/nblog\/?p=1294"},"modified":"2020-08-19T20:59:21","modified_gmt":"2020-08-19T11:59:21","slug":"%e4%bb%96%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%9f%e3%83%b3%e3%82%b0%e8%a8%80%e8%aa%9e%e3%82%92%e6%99%ae%e6%ae%b5%e4%bd%bf%e3%81%86%e4%ba%ba%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e6%97%a5%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1294\/","title":{"rendered":"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb"},"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_1294\/#%E3%81%AF%E3%81%98%E3%82%81%E3%81%AB\" title=\"\u306f\u3058\u3081\u306b\">\u306f\u3058\u3081\u306b<\/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_1294\/#Swift%E3%81%A8SwiftUI\" title=\"Swift\u3068SwiftUI\">Swift\u3068SwiftUI<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1294\/#%E5%85%AC%E5%BC%8F%E3%83%81%E3%83%A5%E3%83%BC%E3%83%88%E3%83%AA%E3%82%A2%E3%83%AB\" title=\"\u516c\u5f0f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">\u516c\u5f0f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1294\/#Handling_User_Input\" title=\"Handling User Input\">Handling User Input<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1294\/#%E4%BB%96%E8%A8%80%E8%AA%9E%E5%AD%A6%E8%80%85%E3%81%AE%E3%81%9F%E3%82%81%E3%81%AESwiftUI%E8%A7%A3%E8%AA%AC\" title=\"\u4ed6\u8a00\u8a9e\u5b66\u8005\u306e\u305f\u3081\u306eSwiftUI\u89e3\u8aac\">\u4ed6\u8a00\u8a9e\u5b66\u8005\u306e\u305f\u3081\u306eSwiftUI\u89e3\u8aac<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1294\/#%E6%BA%96%E5%82%99\" title=\"\u6e96\u5099\">\u6e96\u5099<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1294\/#%E4%B8%80%E5%BA%A6%E5%AE%9F%E8%A1%8C%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B\" title=\"\u4e00\u5ea6\u5b9f\u884c\u3057\u3066\u307f\u308b\">\u4e00\u5ea6\u5b9f\u884c\u3057\u3066\u307f\u308b<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1294\/#Models_%3E_Landmark_swift%E3%82%92%E8%AA%AD%E3%82%80\" title=\"Models &gt; Landmark.swift\u3092\u8aad\u3080\">Models &gt; Landmark.swift\u3092\u8aad\u3080<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1294\/#LandmarkRow_swift\" title=\"LandmarkRow.swift\">LandmarkRow.swift<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1294\/#%E3%81%8A%E6%B0%97%E3%81%AB%E5%85%A5%E3%82%8A%E3%81%AE%E3%83%9E%E3%83%BC%E3%82%AF%E3%82%92%E8%BF%BD%E5%8A%A0%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B\" title=\"\u304a\u6c17\u306b\u5165\u308a\u306e\u30de\u30fc\u30af\u3092\u8ffd\u52a0\u3057\u3066\u307f\u308b\">\u304a\u6c17\u306b\u5165\u308a\u306e\u30de\u30fc\u30af\u3092\u8ffd\u52a0\u3057\u3066\u307f\u308b<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1294\/#LandmarkDetail_swift\" title=\"LandmarkDetail.swift\">LandmarkDetail.swift<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1294\/#LandmarkList_swift\" title=\"LandmarkList.swift\">LandmarkList.swift<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1294\/#%E3%83%95%E3%82%A3%E3%83%AB%E3%82%BF%E3%83%AA%E3%83%B3%E3%82%B0\" title=\"\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\">\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1294\/#%E7%9B%A3%E8%A6%96%E5%8F%AF%E8%83%BD%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88\" title=\"\u76e3\u8996\u53ef\u80fd\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\">\u76e3\u8996\u53ef\u80fd\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1294\/#%E3%81%93%E3%81%93%E3%81%BE%E3%81%A7%E3%81%A7%E3%81%AE%E7%96%91%E5%95%8F\" title=\"\u3053\u3053\u307e\u3067\u3067\u306e\u7591\u554f\">\u3053\u3053\u307e\u3067\u3067\u306e\u7591\u554f<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1294\/#%E8%A9%B3%E7%B4%B0%E3%83%93%E3%83%A5%E3%83%BC%E3%81%A8%E3%81%AE%E5%90%8C%E6%9C%9F\" title=\"\u8a73\u7d30\u30d3\u30e5\u30fc\u3068\u306e\u540c\u671f\">\u8a73\u7d30\u30d3\u30e5\u30fc\u3068\u306e\u540c\u671f<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1294\/#%E3%81%8A%E3%82%8F%E3%82%8A%E3%81%AB%EF%BC%9ASwift%E3%81%AB%E5%AF%BE%E3%81%99%E3%82%8B%E6%89%80%E6%84%9F\" title=\"\u304a\u308f\u308a\u306b\uff1aSwift\u306b\u5bfe\u3059\u308b\u6240\u611f\">\u304a\u308f\u308a\u306b\uff1aSwift\u306b\u5bfe\u3059\u308b\u6240\u611f<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/hirlab.net\/nblog\/category\/programming\/art_1294\/#_Swift%E3%81%A7%E3%81%AE%E3%82%A2%E3%83%97%E3%83%AA%E9%96%8B%E7%99%BA%E3%82%92%E5%AD%A6%E3%81%B6%E3%81%AA%E3%82%89\" title=\"???? Swift\u3067\u306e\u30a2\u30d7\u30ea\u958b\u767a\u3092\u5b66\u3076\u306a\u3089\">???? Swift\u3067\u306e\u30a2\u30d7\u30ea\u958b\u767a\u3092\u5b66\u3076\u306a\u3089<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"%E3%81%AF%E3%81%98%E3%82%81%E3%81%AB\"><\/span>\u306f\u3058\u3081\u306b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u3053\u306e\u8a18\u4e8b\u306f\uff0c\u666e\u6bb5Python\u3084C++\uff0cJava\u306a\u3069\u3092\u666e\u6bb5\u4f7f\u3063\u3066\u3044\u308b<strong>Swift\u3068\u306f\u7e01\u3082\u3086\u304b\u308a\u3082\u306a\u3044\u65b9\u9054<\/strong>\u306e\u4e2d\u3067\u300cSwift\u3067\u30a2\u30d7\u30ea\u4f5c\u3063\u3066\u307f\u305f\u3044\u3051\u3069\u3044\u307e\u3044\u3061\u4e57\u308a\u6c17\u306b\u306a\u3089\u3093\u300d\u3068\u3044\u3046\u4eba\u306b\u3080\u3051\u305f\u8a18\u4e8b\u3067\u3059\uff0e<\/p>\n<p>\u3057\u304b\u3057\uff0c\u79c1\u3082\u305d\u306e1\u4eba\u3067\u305a\u3063\u3068Swift\u3092\u5f8c\u56de\u3057\u306b\u3057\u7d9a\u3051\u3053\u3053\u307e\u3067\u304d\u307e\u3057\u305f\uff0e(\u7b46\u8005\u306fC++\u3084Python\u3092\u3088\u304f\u4f7f\u3046\u4eba)<\/p>\n<p>\u305d\u3053\u3067\uff0c\u306a\u3093\u3068\u304b\u5b66\u3073\u304d\u308b\u305f\u3081\u306b\u300c\u8a18\u4e8b\u3092\u66f8\u304d\u306a\u304c\u3089\u5b66\u307c\u3046\u300d\u3068\u601d\u3044\u7acb\u3061\u8a18\u4e8b\u3092\u66f8\u3044\u3066\u3044\u308b\u6b21\u7b2c\u3067\u3059\uff0e<\/p>\n<p>\u3057\u305f\u304c\u3063\u3066\uff0c\u3053\u308c\u306f\u5358\u306a\u308b\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u7ffb\u8a33\u3067\u306f\u306a\u304f\uff0c\u3042\u304f\u307e\u3067<strong>\u4ed6\u8a00\u8a9e\u3092\u3059\u3067\u306b\u3042\u308b\u7a0b\u5ea6\u7fd2\u5f97\u3057\u3066\u3044\u308b\u4e2d\u7d1a\u8005\u5411\u3051\u306eSwiftUI (iOS\u30a2\u30d7\u30ea\u958b\u767a) \u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb<\/strong>\u3067\u3042\u308b\u3053\u3068\u3092\u3054\u4e86\u627f\u304f\u3060\u3055\u3044\uff0e<\/p>\n<p>\u3061\u306a\u307f\u306b\u3053\u306e\u8a18\u4e8b\u3067\u306fSwift\u306e\u69cb\u6587\u5358\u4f53\u306e\u89e3\u8aac\u306f\u3057\u307e\u305b\u3093\u304c\uff0c<strong>Swift\u3068SwiftUI\u4e21\u65b9\u306e\u89e3\u8aac\u3092\u76db\u308a\u8fbc\u307f\u307e\u3059<\/strong>\uff0e<\/p>\n<p>\u516c\u5f0f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u9032\u3081\u306a\u304c\u3089\uff0c\u300c\u3053\u3053\u306f\u3053\u3046\u3044\u3046\u610f\u5473\u3060\u300d\u3068\u3044\u3046\u30c4\u30c3\u30b3\u30df\u3092\u7d30\u304b\u304f\u5165\u308c\u3066\u3044\u304f\uff0c\u305d\u308c\u3060\u3051\u306e\u8a18\u4e8b\u3067\u3059\uff0e<\/p>\n<p>\u5225\u306b\uff0c<strong>\u3053\u306e\u8a18\u4e8b\u3068\u4e00\u7dd2\u306b\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u9032\u3081\u306a\u304f\u3066\u3082\u826f\u3044\u3067\u3059\uff0c\u6d41\u3057\u898b\u3059\u308b\u3060\u3051\u3067\u3082\u591a\u5206\u9762\u767d\u3044\u3067\u3059<\/strong>\uff0e\u7b11<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Swift%E3%81%A8SwiftUI\"><\/span>Swift\u3068SwiftUI<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><strong>Swift<\/strong>\u306fApple\u304c\u958b\u767a\u3057\u305f\u8a00\u8a9e\u3067\uff0c\u904e\u53bb\u306b\u4f7f\u308f\u308c\u3066\u3044\u305fObjective-C\u306e\u5f8c\u7d99\u3068\u306a\u308b\u8a00\u8a9e\u3092\u6307\u3057\u307e\u3059\uff0e<\/p>\n<p>\u4e00\u65b9\u3067<strong>SwiftUI<\/strong>\u306f\uff0cSwift\u3067\u30a2\u30d7\u30ea\u958b\u767a\u3092\u5bb9\u6613\u306b\u3059\u308b\u305f\u3081\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9 (\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af) \u3067\u3059\uff0e<\/p>\n<p>\u30b3\u30f3\u30bb\u30d7\u30c8\u3068\u3057\u3066\u306f\uff0c\u300c\u3088\u308a\u30b3\u30fc\u30c9\u3068\u30c7\u30b6\u30a4\u30f3\u306e\u8abf\u548c\u6027\u3092\u3042\u3052\u308b\u300d\u3068\u3044\u3046\u3082\u306e\u3089\u3057\u3044\u3067\u3059\uff0e<\/p>\n<p>\u300cTHE \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u7684\u306a\u30a2\u30a4\u30c7\u30a2\u300d\u3063\u3066\u611f\u3058\u3067\u3059\uff0e<\/p>\n<p>\u3061\u306a\u307f\u306b\u4eca\u307e\u3067\u4f7f\u308f\u308c\u3066\u3044\u305fStoryBoard\u306b\u3064\u3044\u3066\u306f\u79c1\u306f\u89e6\u3063\u305f\u3053\u3068\u304c\u306a\u3044\u306e\u3067\u3053\u3053\u3067\u306f\u5272\u611b\u3057\u307e\u3059\uff0e<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%85%AC%E5%BC%8F%E3%83%81%E3%83%A5%E3%83%BC%E3%83%88%E3%83%AA%E3%82%A2%E3%83%AB\"><\/span>\u516c\u5f0f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u5148\u307b\u3069\u8a00\u3063\u305f\u3088\u3046\u306b\uff0c\u672c\u8a18\u4e8b\u3067\u306f\u516c\u5f0f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306b\u5023\u3063\u3066\u9032\u3081\u307e\u3059\uff0e<\/p>\n<ol>\n<li><a href=\"https:\/\/developer.apple.com\/tutorials\/swiftui\/\" target=\"_blank\" rel=\"noopener noreferrer\">Apple Developer Documentation (\u82f1\u8a9e)<\/a><\/li>\n<\/ol>\n<p>\u3068\u3044\u3063\u3066\u3082\uff0c\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306f\u3044\u304f\u3064\u304b\u3042\u308b\u306e\u3067\uff0c\u5168\u3066\u306f\u7d39\u4ecb\u3057\u304d\u308c\u307e\u305b\u3093\uff0e<\/p>\n<p>\u305d\u3053\u3067\uff0c\u672c\u8a18\u4e8b\u3067\u306f\u3082\u3063\u3068\u3082\u3088\u304f\u4f7f\u308f\u308c\u3066\u3044\u308b<a href=\"https:\/\/developer.apple.com\/tutorials\/swiftui\/handling-user-input\" target=\"_blank\" rel=\"noopener noreferrer\">Handling User Input<\/a>\u3092\u3082\u3068\u306b\u9032\u3081\u3066\u3044\u304d\u307e\u3059\uff0e<\/p>\n<p>\u968f\u6240\uff0c\u4ed6\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3084\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304b\u3089\u3082\u60c5\u5831\u3092\u88dc\u8db3\u3057\u3066\u3044\u304d\u307e\u3059\uff0e<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Handling_User_Input\"><\/span>Handling User Input<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\uff0c\u4f4d\u7f6e\u60c5\u5831\u3084\u5199\u771f\u306a\u3069\u306e\u60c5\u5831\u3092\u542b\u3080\u30e9\u30f3\u30c9\u30de\u30fc\u30af\u30ea\u30b9\u30c8\u3092\u7ba1\u7406\u3059\u308b\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3057\u307e\u3059\uff0e<\/p>\n<p>\u6a5f\u80fd\u3068\u3057\u3066\u306f\uff0c\u304a\u6c17\u306b\u5165\u308a\u306b\u767b\u9332\u3057\u305f\u308a\uff0c\u7c21\u5358\u306a\u30d5\u30a3\u30eb\u30bf\u6a5f\u80fd\u3092\u6301\u305f\u305b\u305f\u3082\u306e\u3067\u3059\uff0e<\/p>\n<p>\u3053\u308c\u306b\u3064\u3044\u3066\u306f\uff0c<strong>\u4e00\u5ea6\u516c\u5f0f\u30da\u30fc\u30b8\u3092\u6d41\u3057\u898b\u3057\u3066\u307f\u308b\u3068\u826f\u3044<\/strong>\u3067\u3057\u3087\u3046\uff0e<br \/>\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br \/>\n<ins class=\"adsbygoogle\" style=\"display: block; text-align: center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-7123758399787647\" data-ad-slot=\"1665651601\"><\/ins><br \/>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E4%BB%96%E8%A8%80%E8%AA%9E%E5%AD%A6%E8%80%85%E3%81%AE%E3%81%9F%E3%82%81%E3%81%AESwiftUI%E8%A7%A3%E8%AA%AC\"><\/span>\u4ed6\u8a00\u8a9e\u5b66\u8005\u306e\u305f\u3081\u306eSwiftUI\u89e3\u8aac<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%E6%BA%96%E5%82%99\"><\/span>\u6e96\u5099<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u3055\u3066\u65e9\u901f\u59cb\u3081\u307e\u3057\u3087\u3046\uff0e<\/p>\n<p>\u307e\u305a\u306f<a href=\"https:\/\/docs-assets.developer.apple.com\/published\/d68f7f7caeb0db1ecdf2292224a91c77\/110\/HandlingUserInput.zip\">\u30b3\u30fc\u30c9<\/a>\u3092\u843d\u3068\u3057\u3066\u304f\u3060\u3055\u3044\uff0e<\/p>\n<p>\u3084\u306f\u308a\uff0c\u65b0\u3057\u3044\u8a00\u8a9e\u3092\u5b66\u3076\u6642\u306f\u3059\u3067\u306b\u3042\u308b\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u89e3\u304f\u65b9\u304c\u65e9\u3044\u3067\u3059\uff0e<\/p>\n<p>\u305d\u3046\u3057\u305f\u3089Xcode\u3092\u7acb\u3061\u4e0a\u3052\u3066\uff0cOpen anotor project\u304b\u3089\u300cHandlingUserInput &gt; StartingPoint &gt; Landmarks &gt; HandlingUserInput.xcodeproj\u300d\u3092\u958b\u304d\u307e\u3059\uff0e<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E4%B8%80%E5%BA%A6%E5%AE%9F%E8%A1%8C%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B\"><\/span>\u4e00\u5ea6\u5b9f\u884c\u3057\u3066\u307f\u308b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u305d\u3046\u3057\u305f\u3089\u53d6\u308a\u6025\u304e\u5b9f\u884c\u3057\u3066\u307f\u3066\uff0c\u4eca\u3069\u306e\u3088\u3046\u306a\u72b6\u614b\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\uff0e<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1296\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/1.png\" alt=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1800\" height=\"1082\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/1.png 1800w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/1-300x180.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/1-768x462.png 768w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/1-1024x616.png 1024w\" sizes=\"(max-width: 1800px) 100vw, 1800px\" \/><\/p>\n<p>\u3053\u3053\u307e\u3067\uff0c\u3068\u308a\u3042\u3048\u305a\u51fa\u6765\u4e0a\u304c\u3063\u3066\u3044\u307e\u3059\uff0e<\/p>\n<p>\u3053\u306e\u3042\u3068\uff0c\u304a\u6c17\u306b\u5165\u308a\u6a5f\u80fd\u3084\u30d5\u30a3\u30eb\u30bf\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u3066\u3044\u304f\u306e\u3067\u3059\u304c\uff0c\u305d\u306e\u524d\u306b\u30b3\u30fc\u30c9\u3092\u5c11\u3057\u3060\u3051\u8aad\u307f\u89e3\u3044\u3066\u3044\u304d\u307e\u3059\uff0e<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Models_%3E_Landmark_swift%E3%82%92%E8%AA%AD%E3%82%80\"><\/span>Models &gt; Landmark.swift\u3092\u8aad\u3080<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u307e\u305a\u306f\u30e2\u30c7\u30eb\u304b\u3089\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff0e<\/p>\n<p>\u3061\u306a\u307f\u306b\u30e2\u30c7\u30eb\u3068\u306f\uff0c\u3056\u3063\u304f\u308a\u3068<strong>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c6\u30fc\u30d6\u30eb\u60c5\u5831\u3092\u30af\u30e9\u30b9\u3084\u69cb\u9020\u4f53\u3067\u793a\u3057\u305f\u3082\u306e<\/strong>\u3067\u3059\uff0e<\/p>\n<p>\u3055\u3042\uff0c\u65e9\u901f\u5b9f\u969b\u306e\u30e2\u30c7\u30eb\u5b9a\u7fa9\u3068\u30b3\u30fc\u30c9\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\uff0e<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-large wp-image-1298\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/2-1024x397.png\" alt=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1024\" height=\"397\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/2-1024x397.png 1024w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/2-300x116.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/2-768x297.png 768w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/2.png 1580w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<pre class=\"lang:swift decode:true\" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">\/\/ landmark.swift\r\nstruct Landmark: Hashable, Codable, Identifiable {\r\n    var id: Int\r\n    var name: String\r\n    fileprivate var imageName: String\r\n    fileprivate var coordinates: Coordinates\r\n    var state: String\r\n    var park: String\r\n    var category: Category\r\n    var isFavorite: Bool\r\n\r\n    var locationCoordinate: CLLocationCoordinate2D {\r\n        CLLocationCoordinate2D(\r\n            latitude: coordinates.latitude,\r\n            longitude: coordinates.longitude)\r\n    }\r\n\r\n    enum Category: String, CaseIterable, Codable, Hashable {\r\n        case featured = \"Featured\"\r\n        case lakes = \"Lakes\"\r\n        case rivers = \"Rivers\"\r\n        case mountains = \"Mountains\"\r\n    }\r\n}\r\n\r\nextension Landmark {\r\n    var image: Image {\r\n        ImageStore.shared.image(name: imageName)\r\n    }\r\n}\r\n\r\nstruct Coordinates: Hashable, Codable {\r\n    var latitude: Double\r\n    var longitude: Double\r\n}<\/pre>\n<p>\u6bd4\u8f03\u3057\u3066\u307f\u308b\u3068\uff0c\u30b3\u30fc\u30c9\u306e\u66f8\u304d\u65b9\u306f\u3061\u3087\u3063\u3068Python\u30e9\u30a4\u30af\u306a\u69cb\u6587\u3067\u3059\u306d\uff0e<\/p>\n<p>\u3072\u3068\u3064\u3072\u3068\u3064\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff0e<\/p>\n<pre class=\"lang:swift decode:true \" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">struct Landmark: Hashable, Codable, Identifiable {}<\/pre>\n<p>\u3053\u3053\u3067\u306f\u30e2\u30c7\u30eb\u3092\u69cb\u9020\u4f53\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3059\uff0e<\/p>\n<p>\u7279\u306b\u7d99\u627f\u3057\u305f\u308a\u3057\u306a\u3044\u306e\u3067\uff0c\u69cb\u9020\u4f53\u3068\u3044\u3046\u5f62\u3092\u53d6\u3063\u3066\u3044\u307e\u3059\u304c\uff0c\u5f8c\u308d\u306b<span class=\"lang:swift decode:true crayon-inline \">Hashable<\/span> \u306a\u3069\u306e\u8b0e\u306e\u5ba3\u8a00\u304c\u3042\u308a\u307e\u3059\uff0e<\/p>\n<p>\u3044\u305a\u308c\u3082\u30d7\u30ed\u30c8\u30b3\u30eb (<span class=\"lang:swift decode:true crayon-inline \">protcol<\/span> ) \u3068\u547c\u3070\u308c\u308b\u3082\u306e (\u3068\u3044\u3046\u304b\u4e00\u7a2e\u306e\u578b) \u3067\uff0cPHP\u306a\u3069\u3067\u306f\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3068\u547c\u3070\u308c\u3066\u3044\u308b\u3082\u306e\u3068\u4f7f\u3044\u65b9\u306f\u540c\u3058\u3067\u3042\u308b\u3088\u3046\u3067\u3059\uff0e<\/p>\n<p>Swift\u3067\u306f\u30af\u30e9\u30b9\u30d9\u30fc\u30b9\u3068\u3044\u3046\u3088\u308a<strong>\u30d7\u30ed\u30c8\u30b3\u30eb\u30d9\u30fc\u30b9\u306e\u958b\u767a<\/strong>\u304c\u57fa\u672c\u306a\u3088\u3046\u3067\u3059\uff0e<\/p>\n<p>\u3053\u3053\u3067\u305d\u308c\u305e\u308c\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u306b\u3064\u3044\u3066\u307e\u3068\u3081\u3066\u307f\u307e\u3059\uff0e<\/p>\n<ol>\n<li><span class=\"lang:swift decode:true crayon-inline\">Hashable<\/span><br \/>\n\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u751f\u6210\u3057\u3066\u304f\u308c\u308b\u30d7\u30ed\u30c8\u30b3\u30eb\uff0e<\/li>\n<li><span class=\"lang:swift decode:true crayon-inline \">Codable<\/span><br \/>\nJSON\u3092\u4efb\u610f\u306e\u30c7\u30fc\u30bf\u578b\u306b\u5909\u63db\u3057\u3066\u304f\u308c\u308b\u30d7\u30ed\u30c8\u30b3\u30eb\uff0e\u4eca\u56de\u306e\u5834\u5408\uff0c\u300cResources &gt; landmarkData.json\u300d\u304b\u3089\u5909\u63db\u3055\u308c\u308b\uff0e<\/li>\n<li><span class=\"lang:swift decode:true crayon-inline \">Identifiable<\/span><br \/>\n\u30c7\u30fc\u30bf\u3092\u8b58\u5225\u53ef\u80fd\u306b\u3059\u308b\u305f\u3081\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\uff0e\u5fc5\u305a\u305d\u306e\u69cb\u9020\u4f53\u3084\u30af\u30e9\u30b9\u306b\u306fid\u304c\u5fc5\u8981\u3089\u3057\u3044\uff0e<\/li>\n<\/ol>\n<p>\u3053\u3053\u307e\u3067\u3067\u3082Swift\u521d\u898b\u3067\u306f\uff0c\u306a\u304b\u306a\u304b\u60c5\u5831\u904e\u591a\u3067\u3059\uff0e<\/p>\n<p>\u6b21\u306b\uff0c<strong>\u5909\u6570\u5b9a\u7fa9<\/strong>\u306b\u3064\u3044\u3066\uff0e<\/p>\n<p>Swift\u3067\u306f\uff0cPython\u306eType Hints (\u578b\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3) \u306e\u3088\u3046\u306b\u5f8c\u7f6e\u3067\u578b\u3092\u5ba3\u8a00\u3057\u307e\u3059\uff0e<\/p>\n<p>\u7121\u304f\u3066\u3082\u578b\u63a8\u8ad6\u3092\u3057\u3066\u304f\u308c\u308b\u305d\u3046\u3067\u3059\u304c\uff0cSwift\u3067\u306f\u578b\u306e\u6271\u3044\u306fPyhon\u3088\u308a\u53b3\u3057\u3044\u3088\u3046\u306a\u306e\u3067\uff0c\u57fa\u672c\u7684\u306b\u3064\u3051\u305f\u65b9\u304c\u826f\u3044\u3067\u3057\u3087\u3046\uff0e<\/p>\n<p><span class=\"lang:swift decode:true crayon-inline \">fileprivate<\/span> \u306f\u30a2\u30af\u30bb\u30b9\u4fee\u98fe\u5b50\u306e\u4e00\u7a2e\u3067\uff0c\u540c\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u307f\u30a2\u30af\u30bb\u30b9\u53ef\u80fd\u306a\u4fee\u98fe\u5b50\u3067\u3059\uff0e<\/p>\n<p>\u3082\u3061\u308d\u3093\uff0c<span class=\"lang:swift decode:true crayon-inline \">public<\/span> \u3084<span class=\"lang:swift decode:true crayon-inline \">private<\/span>\u00a0\u3082\u3042\u308a\u307e\u3059\u304c\uff0c\u5225\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u547c\u3073\u51fa\u3057\u305f\u308a\uff0c\u7d99\u627f\uff0c\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b\u5834\u5408\u306f<span class=\"lang:swift decode:true crayon-inline \">open<\/span> \u3092\u3064\u3051\u307e\u3059\uff0e<\/p>\n<p>\u3059\u3067\u306b\u304b\u306a\u308a\u9577\u304f\u306a\u3063\u3066\u304d\u3066\u3044\u307e\u3059\u304c\uff0c\u6700\u5f8c\u306b\u3053\u306e\u90e8\u5206\uff0e<\/p>\n<pre class=\"lang:swift decode:true \" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">extension Landmark {\r\n    var image: Image {\r\n        ImageStore.shared.image(name: imageName)\r\n    }\r\n}<\/pre>\n<p><span class=\"lang:swift decode:true crayon-inline\">extention<\/span>\u00a0 \u306f\u69cb\u9020\u4f53\u3084\u30af\u30e9\u30b9\u306b\u5b9a\u7fa9\u3092\u8ffd\u52a0\u3067\u304d\u307e\u3059\uff0e<\/p>\n<p>\u306a\u305c\uff0c\u6700\u521d\u304b\u3089\u542b\u3081\u306a\u3044\u306e\u304b\uff1f\u3068\u3044\u3046\u30c4\u30c3\u30b3\u30df\u306f\u3042\u308a\u307e\u3059\u304c\uff0c\u307e\u3042\u4f7f\u3044\u65b9\u306f\u57fa\u672c\u7684\u306b\u306f\u524d\u8ff0\u306e\u901a\u308a\u3067\u3059\uff0e<\/p>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3067\u306f\uff0c<span class=\"lang:swift decode:true crayon-inline \">image<\/span> \u3068\u3044\u3046\u5909\u6570\u3092\u65b0\u305f\u306b\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3059\u304c\uff0c\u5148\u307b\u3069\u306e\u5909\u6570\u5b9a\u7fa9\u3068\u306f\u4f55\u3084\u3089\u69d8\u5b50\u304c\u7570\u306a\u308a\u307e\u3059\uff0e<\/p>\n<p>\u3069\u3046\u3084\u3089<strong>Swift\u306b\u306f\u30d7\u30ed\u30d1\u30c6\u30a3 (\u30e1\u30f3\u30d0\u5909\u6570) \u306e\u5b9a\u7fa9\u306e\u4ed5\u65b9\u304c\u5927\u304d\u304f2\u3064\u3042\u308b<\/strong>\u3088\u3046\u3067\u3059\uff0e<\/p>\n<ol>\n<li><strong>\u30b9\u30c8\u30a2\u30c9\u30d7\u30ed\u30d1\u30c6\u30a3 (Stored Propaty)<\/strong><br \/>\n<span class=\"lang:swift decode:true crayon-inline \">var num: Int = 10<\/span> \u306e\u3088\u3046\u306b\u5024\u3092\u4fdd\u6301\u3059\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u6307\u3059\uff0e\u3044\u308f\u3070\u666e\u901a\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\uff0e<\/li>\n<li><strong>\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30c3\u30c9\u30d7\u30ed\u30d1\u30c6\u30a3 (Computed Propaty)<\/strong>\n<pre class=\"lang:swift decode:true \" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb FacebookTwitterHatenaLine\">var contry: String {\r\n        get {\r\n            if state == \"New York\" {\r\n                return \"America\"\r\n            }\r\n            else {\r\n                return \"Canada\"\r\n            }\r\n        }\r\n        set {\r\n            if newValue == \"America\" {\r\n                state = \"New York\"\r\n            }\r\n            else {\r\n                state = \"Ottawa\"\r\n            }\r\n        }\r\n    }<\/pre>\n<p>\u306e\u3088\u3046\u306b\uff0c\u4e00\u7a2e\u306e\u30af\u30ed\u30fc\u30b8\u30e3\u306e\u3088\u3046\u306a\uff0c\u6c7a\u307e\u3063\u305f\u5024\u3092\u4fdd\u6301\u3057\u306a\u3044\u30d7\u30ed\u30d1\u30c6\u30a3\uff0e<span class=\"lang:swift decode:true crayon-inline \">get {}<\/span>\u00a0\u306f\u5fc5\u9808\u3067<span class=\"lang:swift decode:true crayon-inline \">set {}<\/span>\u00a0\u306f\u4efb\u610f\uff0e<span class=\"lang:swift decode:true crayon-inline \">get {}<\/span> \u306e\u307f\u3067\u3042\u308c\u3070\u7701\u7565\u53ef\u80fd\u3067\uff0c<span class=\"lang:swift decode:true crayon-inline \">return<\/span> \u3082\u7701\u7565\u5316 (?)\uff0e\u30bb\u30c3\u30bf\u30fc\u306f<span class=\"lang:swift decode:true crayon-inline \">set(hoge) {}<\/span> \u306e\u3088\u3046\u306b\u5f15\u6570\u3082\u4e0e\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u308b\uff0e<br \/>\n\u6240\u611f\u3068\u3057\u3066\u306f\u7c21\u6613\u30af\u30ed\u30fc\u30b8\u30e3\u3063\u3066\u611f\u3058\u304c\u3059\u308b\u3051\u3069\uff0c\u30af\u30ed\u30fc\u30b8\u30e3\u306f\u30b9\u30c8\u30a2\u30c9\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u5c5e\u3057\uff0c\u30b9\u30b3\u30fc\u30d7 (<span class=\"lang:swift decode:true crayon-inline \">{ }<\/span> ) \u5185\u306f\u4e00\u5ea6\u3057\u304b\u547c\u3070\u308c\u306a\u3044\uff0e<\/li>\n<\/ol>\n<p>\u3057\u305f\u304c\u3063\u3066\uff0c\u3053\u306e<span class=\"lang:swift decode:true crayon-inline \">image<\/span> \u306f\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30c3\u30c9\u30d7\u30ed\u30d1\u30c6\u30a3\u3068\u547c\u3070\u308c\u308b\uff0c\u5b9a\u7fa9\u306e\u4ed5\u65b9\u3092\u53d6\u3063\u3066\u3044\u307e\u3059\uff0e<\/p>\n<p>\u3053\u3053\u3067\uff0c\u30b9\u30c8\u30a2\u30c9\u30d7\u30ed\u30d1\u30c6\u30a3\u3068\u3057\u3066<\/p>\n<pre class=\"lang:swift decode:true\" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">var image: Image = ImageStore.shared.image(name: imageName)<\/pre>\n<p>\u306e\u3088\u3046\u306b\u5b9a\u7fa9\u3057\u3066\u3057\u307e\u3046\u3068\uff0c<span class=\"lang:swift decode:true crayon-inline \">imageName<\/span>\u00a0\u304c\u521d\u671f\u5316\u3055\u308c\u3066\u3044\u306a\u3044\u306e\u3067\u6012\u3089\u308c\u307e\u3059\uff0e<\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\uff0c<strong>\u5225\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u5f15\u6570\u3068\u3059\u308b\u95a2\u6570\u306e\u623b\u308a\u5024\u3092\u4f7f\u3063\u3066\uff0c\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u5b9a\u7fa9\u3059\u308b\u5834\u5408\u306f\uff0c\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30c3\u30c9\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u4f7f\u3046<\/strong>\u3088\u3046\u3067\u3059 (\u3084\u3084\u3053\u3057\u3044)\uff0e<\/p>\n<p>\u3053\u308c\u3067\u5927\u4f53\u89e3\u8aac\u3067\u304d\u305f\u304b\u306a\uff0e<\/p>\n<p>\u9577\u3044\u3067\u3059\u306d\uff0c\u6b21\u3044\u304d\u307e\u3057\u3087\u3046\uff0e<\/p>\n<h3><span class=\"ez-toc-section\" id=\"LandmarkRow_swift\"><\/span>LandmarkRow.swift<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1304\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/3.png\" alt=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"832\" height=\"572\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/3.png 832w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/3-300x206.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/3-768x528.png 768w\" sizes=\"(max-width: 832px) 100vw, 832px\" \/><\/p>\n<p>UI\u3092\u69cb\u6210\u3059\u308b\u30b3\u30fc\u30c9\u306e\u4e2d\u3067\u6700\u5c0f\u5358\u4f4d\u306e\u3082\u306e\u304b\u3089\u898b\u3066\u3044\u304d\u305f\u3044\u306e\u3067\uff0c\u6b21\u306f<strong>\u5404\u30c7\u30fc\u30bf\u3092\u884c\u65b9\u5411\u306b\u3069\u306e\u3088\u3046\u306b\u8868\u793a\u3059\u308b\u304b\u3092\u7ba1\u7406\u3057\u3066\u3044\u308bLandmarkRow.swift<\/strong>\u3092\u898b\u3066\u3044\u304d\u307e\u3059\uff0e<\/p>\n<p>\u307e\u305a\u306f\u3053\u306e\u90e8\u5206\uff0e<\/p>\n<pre class=\"lang:swift decode:true \" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">struct LandmarkRow: View {\r\n    var landmark: Landmark\r\n\r\n    var body: some View {\r\n        HStack {\r\n            landmark.image\r\n                .resizable()\r\n                .frame(width: 50, height: 50)\r\n            Text(landmark.name)\r\n            Spacer()\r\n        }\r\n    }\r\n}<\/pre>\n<p>\u30b3\u30fc\u30c9\u3092\u898b\u308b\u3068\u300c\u3042\u3042\uff0c\u30d3\u30e5\u30fc\u306b\u95a2\u3059\u308b\u30b3\u30fc\u30c9\u3067\u753b\u50cf\u3084\u3089\u306a\u3093\u3084\u3089\u8868\u793a\u3055\u305b\u3066\u308b\u3093\u3060\u306a\u300d\u3068\u306a\u3093\u3068\u306a\u304f\u5206\u304b\u308a\u307e\u3059\u306d\uff0e<\/p>\n<p>\u3055\u3066\uff0c<span class=\"lang:swift decode:true crayon-inline \">View<\/span>\u00a0\u30d7\u30ed\u30d1\u30c6\u30a3\u306fSwiftUI\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u305d\u306e\u540d\u306e\u901a\u308a\u30d3\u30e5\u30fc\u306b\u95a2\u3059\u308b\u30d7\u30ed\u30c8\u30b3\u30eb\u3067\u3059\uff0e<\/p>\n<p>\u30d7\u30ed\u30d1\u30c6\u30a3\u306f2\u3064\u3042\u308a\u307e\u3059\u304c\uff0c\u5927\u4e8b\u306a\u306e\u306f<span class=\"lang:swift decode:true crayon-inline\">body<\/span>\u00a0\u3067\u3059\uff0e<\/p>\n<p>\u3053\u3053\u3067\uff0c\u578b\u306b<span class=\"lang:swift decode:true crayon-inline \">some<\/span>\u00a0\u3068\u3044\u3046\u30ad\u30fc\u30ef\u30fc\u30c9\u304c\u3064\u3044\u3066\u3044\u307e\u3059\uff0e<\/p>\n<p>\u3053\u308c\u306f<strong>Opaque Type (\u4e0d\u900f\u660e\u578b)<\/strong> \u3068\u547c\u3070\u308c\u3066\u3044\u308b\u3082\u306e\u3067\uff0c\u540c\u3058\u578b\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u3082<span class=\"lang:swift decode:true crayon-inline \">some<\/span>\u00a0\u3092\u4ed8\u4e0e\u3059\u308c\u3070\u7b49\u4fa1\u3067\u306f\u306a\u304f<strong>\u5225\u306e\u62bd\u8c61\u7684\u306a\u578b\u3068\u3057\u3066\u6271\u308f\u308c\u308b<\/strong>\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff0e<\/p>\n<p>\u307e\u3063\u305f\u304f\u9055\u3046\u30d3\u30e5\u30fc\u3067\u3082\u540c\u3058\u578b (<span class=\"lang:swift decode:true crayon-inline \">View<\/span>\u00a0)\u3068\u3057\u3066\u6271\u308f\u305a\uff0c\u5225\u306e\u30d3\u30e5\u30fc\u3068\u3057\u3066\u6271\u308f\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff0e<\/p>\n<p>\u305d\u3057\u3066\uff0c<span class=\"lang:swift decode:true crayon-inline \">body<\/span> \u306f\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30c3\u30c9\u30d7\u30ed\u30d1\u30c6\u30a3\u3068\u3057\u3066\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u304c\uff0c<span class=\"lang:python decode:true crayon-inline \">HStack {}<\/span> \u306fHorizontal Stack\uff0c\u3064\u307e\u308a\u6c34\u5e73\u65b9\u5411\u306b\u30b9\u30bf\u30c3\u30af\u3059\u308b\u3068\u304d\u306b\u4f7f\u308f\u308c\u308b\u69cb\u9020\u4f53\u3067\u3059\uff0e<\/p>\n<p>\u307e\u305f\uff0c\u305d\u306e\u4e2d\u306b\u7a4d\u307e\u308c\u3066\u3044\u308b\u3082\u306e\u3092\u8aad\u307f\u89e3\u304f\u3068\u3053\u3093\u306a\u611f\u3058\u3067\u3059\uff0e<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1305\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/4.png\" alt=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1200\" height=\"237\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/4.png 1200w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/4-300x59.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/4-768x152.png 768w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/4-1024x202.png 1024w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<p><span class=\"lang:swift decode:true crayon-inline \">Spacer()<\/span> \u306f\u52d5\u7684\u306b\u30b9\u30da\u30fc\u30b9\u3092\u78ba\u4fdd\u3057\u3066\u304f\u308c\u308b\u4fbf\u5229\u306a\u30c4\u30fc\u30eb\u3067\u3059\uff0e<\/p>\n<p><span class=\"lang:swift decode:true crayon-inline \">Spacer().frame(width: 20)<\/span>\u00a0\u306e\u3088\u3046\u306b\u56fa\u5b9a\u9577\u306e\u4f59\u767d\u3082\u633f\u5165\u53ef\u80fd\u3067\u3059\uff0e<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E3%81%8A%E6%B0%97%E3%81%AB%E5%85%A5%E3%82%8A%E3%81%AE%E3%83%9E%E3%83%BC%E3%82%AF%E3%82%92%E8%BF%BD%E5%8A%A0%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B\"><\/span>\u304a\u6c17\u306b\u5165\u308a\u306e\u30de\u30fc\u30af\u3092\u8ffd\u52a0\u3057\u3066\u307f\u308b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u3055\u3066\uff0c\u3053\u3053\u3067\u3084\u3063\u3068\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u5185\u5bb9\u306b\u5165\u308a\u307e\u3059\u304c\uff0c\u3053\u306e<span class=\"lang:swift decode:true crayon-inline \">HStack {}<\/span>\u00a0\u5185\u306b\u304a\u6c17\u306b\u5165\u308a\u306e\u661f\u30de\u30fc\u30af\u3092\u8868\u793a\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff0e<\/p>\n<pre class=\"lang:swift mark:12-16 decode:true\" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">struct LandmarkRow: View {\r\n    var landmark: Landmark\r\n\r\n    var body: some View {\r\n        HStack {\r\n            landmark.image\r\n                .resizable()\r\n                .frame(width: 50, height: 50)\r\n            Text(landmark.name)\r\n            Spacer()\r\n            \r\n            if landmark.isFavorite {\r\n                Image(systemName: \"star.fill\")\r\n                    .imageScale(.medium)\r\n                    .foregroundColor(.yellow)\r\n            }\r\n        }\r\n<\/pre>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1306\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/5.png\" alt=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"768\" height=\"562\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/5.png 768w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/5-300x220.png 300w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/p>\n<p>\u3053\u3053\u3067\u304a\u6c17\u306b\u5165\u308a\u306b\u306a\u3063\u3066\u3044\u308b\u3082\u306e\u306b\u306f\uff0c\u53f3\u5bc4\u305b\u3067\u9ec4\u8272\u306e\u661f\u30de\u30fc\u30af\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\uff0e<\/p>\n<p><span class=\"lang:swift decode:true crayon-inline \">Spacer()<\/span>\u00a0\u304c\u52d5\u7684\u306b\u5927\u304d\u3055\u3092\u5909\u3048\u3066\u3044\u308b\u3053\u3068\u3082\u78ba\u8a8d\u3067\u304d\u307e\u3059\u306d\uff0e<\/p>\n<p>\u307e\u305f\u3053\u3053\u3067\uff0c<span class=\"lang:swift decode:true crayon-inline \">Image(systemName: \"star.fill\")<\/span> \u3068\u3042\u308a\u307e\u3059\u304c\uff0cSwift\u3067\u306f\u4e88\u3081\u4fbf\u5229\u306a\u30a2\u30a4\u30b3\u30f3\u304c\u7528\u610f\u3055\u308c\u3066\u304a\u308a\uff0c<span class=\"lang:swift decode:true crayon-inline \">Image(systemName: \"xxx\")<\/span> \u3068\u3044\u3046\u5f62\u3067\u5229\u7528\u3067\u304d\u307e\u3059\uff0e<\/p>\n<p>\u4f7f\u3048\u308b\u3082\u306e\u306f<a href=\"https:\/\/developer.apple.com\/design\/resources\/\" target=\"_blank\" rel=\"noopener noreferrer\">SF Symbols<\/a>\u3068\u3044\u3046\u30a2\u30d7\u30ea\u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\uff0e<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1308\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/6.png\" alt=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1200\" height=\"689\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/6.png 1200w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/6-300x172.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/6-768x441.png 768w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/6-1024x588.png 1024w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<p>\u3081\u3061\u3083\u304f\u3061\u3083\u7a2e\u985e\u304c\u3042\u308a\u307e\u3059\uff0e<\/p>\n<p>\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30b8\u30cb\u30a2\u3055\u3093\u3067\u3042\u308c\u3070\uff0c\u30a2\u30d7\u30ea\u7248FontAwesome\u3068\u8a00\u3048\u3070\u5206\u304b\u308a\u3084\u3059\u3044\u3067\u3059\u304b\u306d\uff0e<\/p>\n<p>\u6b21\u306b\u3053\u306e\u90e8\u5206\uff0e<\/p>\n<pre class=\"lang:swift decode:true \" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">struct LandmarkRow_Previews: PreviewProvider {\r\n    static var previews: some View {\r\n        Group {\r\n            LandmarkRow(landmark: landmarkData[0])\r\n            LandmarkRow(landmark: landmarkData[1])\r\n        }\r\n        .previewLayout(.fixed(width: 300, height: 70))\r\n    }\r\n}<\/pre>\n<p><span class=\"lang:swift decode:true crayon-inline \">PreviewProvider<\/span> \u306f\uff0c\u305f\u3060\u306e\u30d7\u30ec\u30d3\u30e5\u30fc\u8868\u793a\u3092\u3057\u3066\u304f\u308c\u308b\uff0c\u3044\u308f\u3070\u30c6\u30b9\u30c8\u30d7\u30ed\u30c8\u30b3\u30eb\uff0e<\/p>\n<p>\u5b9f\u6a5f\u30a2\u30d7\u30ea\u306b\u306f\u95a2\u4e0e\u3057\u306a\u3044\u90e8\u5206\uff0e<br \/>\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br \/>\n<ins class=\"adsbygoogle\" style=\"display: block; text-align: center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-7123758399787647\" data-ad-slot=\"1665651601\"><\/ins><br \/>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><\/p>\n<h3><span class=\"ez-toc-section\" id=\"LandmarkDetail_swift\"><\/span>LandmarkDetail.swift<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1310\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/7.png\" alt=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"968\" height=\"826\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/7.png 968w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/7-300x256.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/7-768x655.png 768w\" sizes=\"(max-width: 968px) 100vw, 968px\" \/><\/p>\n<p>\u6b21\u306f\uff0c\u30ea\u30b9\u30c8 (\u5217\u65b9\u5411) \u306b\u95a2\u3059\u308b\u30b3\u30fc\u30c9\u3092\u898b\u308b\u524d\u306b\uff0c\u8a73\u7d30\u30da\u30fc\u30b8\u306b\u3064\u3044\u3066\u898b\u3066\u3044\u304d\u307e\u3059\uff0e<\/p>\n<pre class=\"lang:swift decode:true\" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">struct LandmarkDetail: View {\r\n    var landmark: Landmark\r\n\r\n    var body: some View {\r\n        VStack {\r\n            MapView(coordinate: landmark.locationCoordinate)\r\n                .edgesIgnoringSafeArea(.top)\r\n                .frame(height: 300)\r\n\r\n            CircleImage(image: landmark.image)\r\n                .offset(x: 0, y: -130)\r\n                .padding(.bottom, -130)\r\n\r\n            VStack(alignment: .leading) {\r\n                Text(landmark.name)\r\n                    .font(.title)\r\n\r\n                HStack(alignment: .top) {\r\n                    Text(landmark.park)\r\n                        .font(.subheadline)\r\n                    Spacer()\r\n                    Text(landmark.state)\r\n                        .font(.subheadline)\r\n                }\r\n            }\r\n            .padding()\r\n\r\n            Spacer()\r\n        }\r\n        .navigationBarTitle(Text(landmark.name), displayMode: .inline)\r\n    }\r\n}<\/pre>\n<p>\u5148\u306e\u30b3\u30fc\u30c9\u3068\u3088\u304f\u4f3c\u3066\u3044\u308b\u304c\uff0c\u3053\u3061\u3089\u306f<span class=\"lang:swift decode:true crayon-inline \">VStack {}<\/span>\u00a0\u3067\u5782\u76f4\u65b9\u5411\u306b\u7a4d\u307f\u4e0a\u3052\u308b\u30bf\u30a4\u30d7\uff0e<\/p>\n<p>\u305f\u3060\uff0c\u305d\u306e\u4e2d\u306b\u516c\u5712\u540d\u3068\u5dde\u306e\u540d\u524d\u304c<span class=\"lang:swift decode:true crayon-inline \">HStack {}<\/span> \u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306b\uff0c\u30cd\u30b9\u30c8\u304c\u53ef\u80fd\u3067\u3059\uff0e<\/p>\n<p>\u3053\u308c\u306b\u3064\u3044\u3066\u306f\uff0c<a href=\"https:\/\/developer.apple.com\/tutorials\/swiftui\/creating-and-combining-views#Compose-the-Detail-View\" target=\"_blank\" rel=\"noopener noreferrer\">Section 6 Compose the Detail View<\/a>\u3092\u898b\u305f\u65b9\u304c\u65e9\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\uff0e<\/p>\n<h3><span class=\"ez-toc-section\" id=\"LandmarkList_swift\"><\/span>LandmarkList.swift<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u6b21\u306f\uff0cRow\u30c7\u30fc\u30bf\u306e\u30b9\u30bf\u30c3\u30af\u306b\u3064\u3044\u3066\uff0e<\/p>\n<pre class=\"lang:swift decode:true\" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">struct LandmarkList: View {\r\n    \r\n    var body: some View {\r\n        NavigationView {\r\n            List(landmarkData) { landmark in\r\n                NavigationLink(destination: LandmarkDetail(landmark: landmark)) {\r\n                    LandmarkRow(landmark: landmark)\r\n                }\r\n            }\r\n            .navigationBarTitle(Text(\"Landmarks\"))\r\n        }\r\n    }\r\n}<\/pre>\n<p>\u3053\u308c\u3082\uff0c\u5148\u307b\u3069\u306e\u884c\u65b9\u5411\u306e\u30b3\u30fc\u30c9\u3068\u5927\u67a0\u306f\u5909\u308f\u308a\u3042\u308a\u307e\u305b\u3093\uff0e<\/p>\n<p>\u305f\u3060\uff0c\u30b9\u30bf\u30c3\u30af\u3059\u308b\u30ea\u30b9\u30c8\u306e\u66f8\u304d\u65b9\u304c\u5c11\u3057\u7279\u6b8a\u3067\uff0c<span class=\"lang:swift decode:true crayon-inline\">landmarkData<\/span>\u00a0\u3092\u30ea\u30b9\u30c8\u5316\u3057\u3066\uff0c\u5404\u30c7\u30fc\u30bf\u3092<span class=\"lang:swift decode:true crayon-inline \">landmark<\/span> \u3068\u3044\u3046\u540d\u524d\u306e\u4e00\u6642\u5909\u6570\u3067\u305d\u306e\u4e2d\u8eab\u306e\u51e6\u7406\u3092\u8a18\u8ff0\u3057\u3066\u3044\u307e\u3059\uff0e<\/p>\n<p><span class=\"lang:swift decode:true crayon-inline\">NavigationLink(destination: xxx) { XXX }<\/span>\u00a0\u306fHTML\u3067\u8a00\u3046<span class=\"lang:xhtml decode:true crayon-inline\">&lt;a href=\"xxx\"&gt;XXX&lt;\/a&gt;<\/span>\u00a0\u3068\u4e00\u7dd2\u3067\uff0c\u305d\u306e\u30ea\u30f3\u30af\u7bc4\u56f2\u3092\u30ab\u30c3\u30b3\u5185\u306b\u8a18\u8ff0\u3057\u307e\u3059\uff0e<\/p>\n<p>\u4eca\u56de\u306f\u305d\u308c\u305e\u308c\uff0c\u5148\u307b\u3069\u5b9a\u7fa9\u3057\u305f\u30d3\u30e5\u30fc\u304c\u5165\u3063\u3066\u3044\u307e\u3059\u306d\uff0e<\/p>\n<p>\u305d\u3057\u3066\uff0c\u8a73\u7d30\u30d3\u30e5\u30fc\u3067\u3082\u3042\u3063\u305f\u3088\u3046\u306b<span class=\"lang:swift decode:true crayon-inline\">.navigationBarTitle()<\/span> \u306f\u305d\u306e\u30d3\u30e5\u30fc\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u6307\u3057\u307e\u3059\uff0e<\/p>\n<p>\u3053\u308c\u306f\uff0c\u753b\u9762\u9077\u79fb\u306e\u969b\u306b\uff0c\u524d\u30da\u30fc\u30b8\u306b\u623b\u308b\u969b\u306e\u30c6\u30ad\u30b9\u30c8\u306b\u4f7f\u308f\u308c\u305f\u308a\u3057\u307e\u3059\uff0e<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1311\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/8.png\" alt=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1200\" height=\"413\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/8.png 1200w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/8-300x103.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/8-768x264.png 768w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/8-1024x352.png 1024w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E3%83%95%E3%82%A3%E3%83%AB%E3%82%BF%E3%83%AA%E3%83%B3%E3%82%B0\"><\/span>\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u3055\u3066\uff0c\u3053\u3053\u3067\u307e\u305f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u5185\u5bb9\u306b\u5fa9\u5e30\u3057\u307e\u3059\uff0e<\/p>\n<p>\u3053\u3053\u3067\u306f\uff0c\u304a\u6c17\u306b\u5165\u308a\u306e\u3082\u306e\u3060\u3051\u3092\u62bd\u51fa\u3057\u3066\u8868\u793a\u3059\u308b\u30d5\u30a3\u30eb\u30bf\u3092\u8ffd\u52a0\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff0e<\/p>\n<pre class=\"lang:swift mark:2,6-13 decode:true \" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">struct LandmarkList: View {\r\n    @State var showFavoritesOnly = true\r\n    \r\n    var body: some View {\r\n        NavigationView {\r\n            List{\r\n                ForEach(landmarkData){ landmark in\r\n                    if !self.showFavoritesOnly || landmark.isFavorite {\r\n                        NavigationLink(destination: LandmarkDetail(landmark: landmark)) {\r\n                            LandmarkRow(landmark: landmark)\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n            .navigationBarTitle(Text(\"Landmarks\"))\r\n        }\r\n    }\r\n}<\/pre>\n<p>\u30d7\u30ec\u30d3\u30e5\u30fc\u3092\u8868\u793a\u3055\u305b\u3066\u307f\u308b\u3068\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u308a\u307e\u3059\uff0e<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1314\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/9.png\" alt=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1200\" height=\"591\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/9.png 1200w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/9-300x148.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/9-768x378.png 768w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/9-1024x504.png 1024w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\uff0c\u304a\u6c17\u306b\u5165\u308a\u3060\u3051\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u306f\u3067\u304d\u307e\u3057\u305f\uff0e<\/p>\n<p>\u3053\u3053\u3067\uff0c\u3044\u304f\u3064\u304b\u521d\u898b\u3060\u3068\u6c17\u306b\u306a\u308b\u30dd\u30a4\u30f3\u30c8\u3092\u6574\u7406\u3057\u3066\u304a\u304d\u307e\u3059\uff0e<\/p>\n<p>\u307e\u305a\u306f<span class=\"lang:swift decode:true crayon-inline \">@State<\/span> \uff0c\u3053\u308c\u3092\u4ed8\u4e0e\u3057\u305f\u30d7\u30ed\u30d1\u30c6\u30a3\u306f<strong>\u5909\u66f4\u3055\u308c\u308b\u305f\u3073\u306b\u30d3\u30e5\u30fc\u306e\u518d\u63cf\u753b\u304c\u884c\u308f\u308c\u308b<\/strong>\u3088\u3046\u306b\u306a\u308b (\u3089\u3057\u3044)\uff0e<\/p>\n<p>\u3053\u308c\u306b\u3088\u308a\u753b\u9762\u9077\u79fb\u306e\u5b9f\u88c5\u304c\u304b\u306a\u308a\u697d\u306b\u306a\u3063\u305f\u3068\u306e\u3053\u3068\uff0e<\/p>\n<p>\u6b21\u306b\uff0c<span class=\"lang:swift decode:true crayon-inline \">List {}<\/span>\u00a0\u3068<span class=\"lang:swift decode:true crayon-inline \">ForEach {}<\/span>\u00a0\uff0e<\/p>\n<p>\u6700\u521d\u307f\u305f\u6642\uff0c<span class=\"lang:swift decode:true crayon-inline \">List(landmarkData) {}<\/span> \u3060\u3051\u3067\u3088\u304f\u306a\u3044\uff1f\u3068\u601d\u3063\u305f\u304c\uff0c\u3053\u308c\u3060\u3068\u5168\u3066\u306e\u30c7\u30fc\u30bf\u304c\u30b9\u30bf\u30c3\u30af\u3055\u308c\u3066\u3057\u307e\u3044\uff0c<strong>\u304a\u6c17\u306b\u5165\u308a\u3058\u3083\u306a\u3044\u30c7\u30fc\u30bf\u3082\u7a7a\u6b04\u3068\u3057\u3066\u63cf\u753b\u3055\u308c\u3066\u3057\u307e\u3046<\/strong>\uff0e<\/p>\n<p>\u3057\u305f\u304c\u3063\u3066\uff0c\u30ea\u30b9\u30c8\u5316\u3059\u308b\u30c7\u30fc\u30bf\u3092<span class=\"lang:swift decode:true crayon-inline \">ForEach {}<\/span> \u3067\u307e\u305a\u306f\u634c\u304f\u3068\u3044\u3063\u305f\u5f62\u3092\u53d6\u3063\u3066\u3044\u308b\uff0e<\/p>\n<p>&nbsp;<\/p>\n<p>\u8b0e\u304c\u3042\u308b\u7a0b\u5ea6\u89e3\u3051\u305f\u3068\u3053\u308d\u3067\uff0c\u30d5\u30a3\u30eb\u30bf\u6a5f\u80fd\u3092\u5b8c\u6210\u3055\u305b\u307e\u3057\u3087\u3046\uff0e<\/p>\n<pre class=\"lang:swift mark:8-9 decode:true \" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">struct LandmarkList: View {\r\n    @State var showFavoritesOnly = true\r\n    \r\n    var body: some View {\r\n        NavigationView {\r\n            List{\r\n                \r\n                Toggle(isOn: $showFavoritesOnly) {\r\n                    Text(\"Favorites only\")\r\n                }\r\n                \r\n                ForEach(landmarkData){ landmark in\r\n                    if !self.showFavoritesOnly || landmark.isFavorite {\r\n                        NavigationLink(destination: LandmarkDetail(landmark: landmark)) {\r\n                            LandmarkRow(landmark: landmark)\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n            .navigationBarTitle(Text(\"Landmarks\"))\r\n        }\r\n    }\r\n}<\/pre>\n<p>\u30c8\u30b0\u30eb\u3092\u8ffd\u8a18\u3057\u307e\u3059\uff0e<\/p>\n<p>\u305d\u3046\u3059\u308b\u3068\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u304a\u6c17\u306b\u5165\u308a\u8868\u793a\u306e\u5207\u308a\u66ff\u3048\u6a5f\u80fd\u304c\u5b9f\u88c5\u3067\u304d\u307e\u3057\u305f\uff0e<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1316\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/10.png\" alt=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"1200\" height=\"860\" srcset=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/10.png 1200w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/10-300x215.png 300w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/10-768x550.png 768w, https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/10-1024x734.png 1024w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<p>\u3084\u306f\u308aSwiftUI\u306f\uff0c\u304b\u306a\u308a\u4f7f\u3044\u3084\u3059\u3055\u306b\u91cd\u8996\u3057\u3066\u3044\u307e\u3059\uff0e<\/p>\n<p><span class=\"lang:swift decode:true crayon-inline \">Toggle(isOn: $showFavoritesOnly)<\/span> \u306f\u30b3\u30fc\u30c9\u3060\u3051\u3067\u4f55\u3092\u3057\u3066\u3044\u308b\u306e\u304b\u304c\u3059\u3050\u306b\u5206\u304b\u308a\u307e\u3059\u306d\uff0e<\/p>\n<p><span class=\"lang:swift decode:true crayon-inline\">$<\/span>\u00a0\u63a5\u982d\u8f9e\u306f\uff0c<span class=\"lang:swift decode:true crayon-inline \">@State<\/span> \u5909\u6570 (\u3082\u3063\u3068\u7d30\u304b\u304f\u3044\u3048\u3070<span class=\"lang:swift decode:true crayon-inline \">State&lt;Bool&gt;<\/span> ) \u3092\u4fbf\u5229\u306b\u6271\u3046\u305f\u3081\u306b\u4f7f\u3046\u3082\u306e\u3089\u3057\u304f\uff0c\u8a73\u7d30\u306a\u5b9a\u7fa9\u306f\u5206\u304b\u308a\u307e\u305b\u3093\u304c\uff0c\u3069\u3046\u3084\u3089<span class=\"lang:swift decode:true crayon-inline \">@State<\/span> \u304c\u81ea\u52d5\u751f\u6210\u3057\u305f\uff0c<strong>\u6295\u5f71\u30d7\u30ed\u30d1\u30c6\u30a3 (projected propaty)<\/strong>\u3068\u547c\u3070\u308c\u308b\u3082\u306e\u3089\u3057\u3044\u3067\u3059\uff0e<\/p>\n<p>\u3053\u3053\u307e\u3067\u3067\uff0c\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30ebSection 3\u307e\u3067\u7d42\u308f\u308a\u307e\u3057\u305f\uff0e<\/p>\n<p>\u3042\u3068\u306f\uff0c\u30e6\u30fc\u30b6\u3054\u3068\u306b\u304a\u6c17\u306b\u5165\u308a\u3092\u5909\u66f4\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308c\u3070\uff0c\u3053\u306e\u30a2\u30d7\u30ea\u306f\u3072\u3068\u307e\u305a\u5b8c\u6210\u306b\u306a\u308a\u307e\u3059\uff0e<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E7%9B%A3%E8%A6%96%E5%8F%AF%E8%83%BD%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88\"><\/span>\u76e3\u8996\u53ef\u80fd\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u3055\u3066\uff0c\u4eca\u307e\u3067\u6271\u3063\u3066\u304d\u305f<span class=\"lang:swift decode:true crayon-inline\">landmarkData<\/span>\u00a0\u3084\uff0c\u304a\u6c17\u306b\u5165\u308a\u8868\u793a\u306e\u305f\u3081\u306e<span class=\"lang:swift decode:true crayon-inline\">showFavoritesOnly<\/span> \u3068\u3044\u3063\u305f\u5909\u6570\u306f\uff0c\u305d\u308c\u305e\u308c\u30d0\u30e9\u30d0\u30e9\u3067\u6271\u3063\u3066\u304d\u307e\u3057\u305f\uff0e<\/p>\n<p>\u3053\u308c\u304b\u3089\u5404<span class=\"lang:swift decode:true crayon-inline\">landmarkData<\/span>\u306b\u5bfe\u3057\u3066\uff0c\u304a\u6c17\u306b\u5165\u308a\u306b\u3057\u305f\u308a\uff0c\u89e3\u9664\u3057\u305f\u308a\uff0c\u3068\u3044\u3063\u305f\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u3066\u3044\u304f\u306e\u3067\u3059\u304c\uff0c\u4f55\u304b\u3057\u3089\u306e\u30e6\u30fc\u30b6\u30a2\u30af\u30b7\u30e7\u30f3\u306b\u5bfe\u3057\u3066\u30d3\u30e5\u30fc\u306e\u518d\u63cf\u753b\u3092\u5b8c\u74a7\u306b\u884c\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\uff0e<\/p>\n<p><span class=\"lang:swift decode:true crayon-inline\">showFavoritesOnly<\/span>\u00a0\u306f<span class=\"lang:swift decode:true crayon-inline \">@State<\/span> \u3067\u300c\u5909\u66f4\u3055\u308c\u305f\u3089\u518d\u63cf\u753b\u300d\u304c\u884c\u308f\u308c\u3066\u3044\u307e\u3057\u305f\u304c\uff0c\u305d\u3046\u3044\u3063\u305f\u5909\u6570\u304c\u8907\u6570\u3042\u308b\u5834\u5408\uff0cSwiftUI\u3067\u306f<strong>\u76e3\u8996\u53ef\u80fd\u30aa\u30d6\u30b8\u30a7\u30af\u30c8 (Observable Object)<\/strong> \u3068\u3044\u3046\u3082\u306e\u3067\u307e\u3068\u3081\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff0e<\/p>\n<p>\u76e3\u8996\u53ef\u80fd\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u306f\uff0c\u5148\u307b\u3069\u8a00\u3063\u305f\u3088\u3046\u306b\uff0c<strong>\u30d3\u30e5\u30fc\u306e\u63cf\u753b\u306b\u5f71\u97ff\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u76e3\u8996\u5bfe\u8c61\u306b\u7f6e\u304f\u3053\u3068\u3067\uff0c\u5909\u66f4\u5f8c\u306b\u6b63\u3057\u304f\u30d3\u30e5\u30fc\u306e\u518d\u63cf\u753b\u3092\u884c\u3046\u305f\u3081\u306e\u3082\u306e<\/strong>\u3067\u3059\uff0e<\/p>\n<p>\u4eca\u56de\u306e\u5834\u5408\uff0c\u5148\u306e<span class=\"lang:swift decode:true crayon-inline\">landmarkData<\/span> \u3068<span class=\"lang:swift decode:true crayon-inline\">showFavoritesOnly<\/span> \u304c\u305d\u308c\u306b\u3042\u305f\u308a\u307e\u3059\uff0e<\/p>\n<p>\u305d\u308c\u3089\u3092<span class=\"lang:swift decode:true crayon-inline\">UserData<\/span>\u00a0\u3068\u3044\u3046\u540d\u524d\u3068\u3057\u3066\u307e\u3068\u3081\uff0c\u76e3\u8996\u5bfe\u8c61\u3068\u3057\u3066\u3044\u304d\u307e\u3059\uff0e<\/p>\n<p>\u307e\u305a\u306f\uff0cModels\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306b<span class=\"lang:swift decode:true crayon-inline \">UserData.swift<\/span>\u00a0\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\uff0e<\/p>\n<p>\u305d\u3057\u3066\u5927\u67a0\u3092\u66f8\u304d\u307e\u3059\uff0e<\/p>\n<pre class=\"lang:swift decode:true \" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">import SwiftUI\r\nimport Combine\r\n\r\n\r\nfinal class UserData: ObservableObject {\r\n    \r\n}<\/pre>\n<p><span class=\"lang:swift decode:true crayon-inline \">ObservableObject<\/span>\u00a0\u30d7\u30ed\u30c8\u30b3\u30eb\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306b\uff0c<span class=\"lang:swift decode:true crayon-inline \">import Combine<\/span> \u304c\u5fc5\u8981\u3067\u3059\uff0e<\/p>\n<p>\u306a\u305c\uff0c\u4eca\u307e\u3067\u69cb\u9020\u4f53\u3092\u4f7f\u3063\u3066\u304d\u305f\u306e\u306b\uff0c<span class=\"lang:swift decode:true crayon-inline \">final class<\/span> \u306a\u306e\u304b\u3068\u3044\u3046\u3068\uff0c\u7d99\u627f\u3055\u308c\u308b\u3053\u3068\u304c\u306a\u3044\u304b\u3089\uff0c\u3067\u3057\u3087\u3046\u304b (\u771f\u610f\u306f\u5206\u304b\u308a\u307e\u305b\u3093)\uff0e<\/p>\n<p>\u305d\u3057\u3066\u3053\u3053\u306b\uff0c<strong>\u76e3\u8996\u5bfe\u8c61\u3068\u3059\u308b\u5909\u6570\u3092\u5b9a\u7fa9<\/strong>\u3057\u3066\u3044\u304d\u307e\u3059\uff0e<\/p>\n<pre class=\"lang:swift decode:true \" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">final class UserData: ObservableObject {\r\n    @Published var showFavoritesOnly = false\r\n    @Published var landmarks = landmarkData\r\n}<\/pre>\n<p>\u3053\u3053\u3067\u3082\uff0c\u65b0\u3057\u304f<span class=\"lang:swift decode:true crayon-inline \">@Published<\/span> \u3068\u3044\u3046\u5ba3\u8a00\u304c\u3067\u3066\u304d\u307e\u3057\u305f\uff0e<\/p>\n<p>\u3053\u308c\u306f\uff0c\u30c7\u30fc\u30bf\u306e\u5909\u66f4\u3092\u516c\u958b\u3059\u308b\u5909\u6570\u306b\u4ed8\u4e0e\u3059\u308b\u3082\u306e\u3067\u3059\uff0e<\/p>\n<p>\u305d\u3057\u305f\u3089\uff0c\u30ea\u30b9\u30c8\u30d3\u30e5\u30fc\u3092\u4fee\u6b63\u3057\u307e\u3059\uff0e<\/p>\n<pre class=\"lang:swift mark:2,8,12,13,31 decode:true\" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">struct LandmarkList: View {\r\n    @EnvironmentObject var userData: UserData\r\n    \r\n    var body: some View {\r\n        NavigationView {\r\n            List{\r\n                \r\n                Toggle(isOn: $userData.showFavoritesOnly) {\r\n                    Text(\"Favorites only\")\r\n                }\r\n                \r\n                ForEach(userData.landmarks){ landmark in\r\n                    if !self.userData.showFavoritesOnly || landmark.isFavorite {\r\n                        NavigationLink(destination: LandmarkDetail(landmark: landmark)) {\r\n                            LandmarkRow(landmark: landmark)\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n            .navigationBarTitle(Text(\"Landmarks\"))\r\n        }\r\n    }\r\n}\r\n\r\nstruct LandmarkList_Previews: PreviewProvider {\r\n    static var previews: some View {\r\n        ForEach([\"iPhone SE\", \"iPhone XS Max\"], id: \\.self) { deviceName in\r\n            LandmarkList()\r\n                .previewDevice(PreviewDevice(rawValue: deviceName))\r\n                .previewDisplayName(deviceName)\r\n                .environmentObject(UserData())\r\n        }\r\n    }\r\n}<\/pre>\n<p><span class=\"lang:swift decode:true crayon-inline \">ObservableObject<\/span>\u00a0\u306f\uff0c<span class=\"lang:swift decode:true crayon-inline \">@EnvironmentObject<\/span>\u00a0\u5c5e\u6027\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u307e\u3059\uff0e<\/p>\n<p>\u305d\u306e\u5f8c\uff0c\u95a2\u4fc2\u3059\u308b\u7b87\u6240\u3092\u66f8\u304d\u76f4\u3057\u3066\u3044\u304d\u307e\u3059\u304c\uff0c<span class=\"lang:swift decode:true crayon-inline \">@State<\/span>\u00a0\u5909\u6570\u3068\u540c\u3058\u3088\u3046\u306b\uff0c<span class=\"lang:swift decode:true crayon-inline \">$<\/span>\u00a0\u63a5\u982d\u8f9e\u3092\u3064\u3051\u3066\u6271\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff0e<\/p>\n<p>\u306a\u304a\uff0c\u3053\u306e\u6642\u70b9\u3067\u306f\u307e\u3060\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u3059\u306e\u3067\uff0c\u7126\u3089\u305a\u8aad\u307f\u9032\u3081\u3066\u304f\u3060\u3055\u3044\uff0e<\/p>\n<pre class=\"lang:sh decode:true \" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">Thread 1: Fatal error: No ObservableObject of type UserData found. A View.environmentObject(_:) for UserData may be missing as an ancestor of this view.<\/pre>\n<p>\u3053\u306e\u6642\u70b9\u3067\u6c17\u306b\u306a\u308b\u7b87\u6240\u306f\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u304c\uff0c\u3072\u3068\u307e\u305a\u52d5\u4f5c\u3059\u308b\u30dd\u30a4\u30f3\u30c8\u307e\u3067\u9032\u3081\u307e\u3059\uff0e<\/p>\n<p>&nbsp;<\/p>\n<p><strong>\u6b21\u306b\u4fee\u6b63\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u306f<span class=\"lang:c++ decode:true crayon-inline \">SceneDelegate.swift<\/span>\u00a0\u3067\u3059<\/strong>\uff0e<\/p>\n<pre class=\"lang:swift mark:14-19 decode:true\" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">class SceneDelegate: UIResponder, UIWindowSceneDelegate {\r\n\r\n    var window: UIWindow?\r\n\r\n    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {\r\n        \/\/ Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.\r\n        \/\/ If using a storyboard, the `window` property will automatically be initialized and attached to the scene.\r\n        \/\/ This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).\r\n\r\n        \/\/ Use a UIHostingController as window root view controller\r\n        if let windowScene = scene as? UIWindowScene {\r\n            let window = UIWindow(windowScene: windowScene)\r\n            \r\n            window.rootViewController = UIHostingController(\r\n                rootView: LandmarkList()\r\n                    .environmentObject(UserData())\r\n            )\r\n            \r\n            \/\/ window.rootViewController = UIHostingController(rootView: LandmarkList())\r\n            self.window = window\r\n            window.makeKeyAndVisible()\r\n        }\r\n    }<\/pre>\n<p>\u3053\u3053\u3067\u306f\uff0c<span class=\"lang:swift decode:true crayon-inline \">environmentObject(_:)<\/span> \u4fee\u98fe\u5b50 (\u539f\u6587\u306fmodifier\u3068\u66f8\u3044\u3066\u3042\u3063\u305f\u304c\u65e5\u672c\u8a9e\u3067\u306f\u306a\u3093\u3068\u547c\u3076\u306e\u304c\u9069\u5207\u306a\u3093\u3060\u308d\u3046\u304b) \u3092<span class=\"lang:swift decode:true crayon-inline \">LandmarkList()<\/span>\u00a0\u306b\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\uff0e<\/p>\n<p>\u4f55\u3092\u3057\u3066\u3044\u308b\u304b\u3068\u8a00\u3046\u3068\uff0c<span class=\"lang:swift decode:true crayon-inline \">ObservableObject<\/span> \u306f\u547c\u3073\u51fa\u3057\u306e\u969b\uff0c\u521d\u671f\u5316\u3059\u308b\u3053\u3068\u3082\u306a\u304f\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3082\u306a\u3044\u305f\u3081\uff0c\u666e\u901a\u306b\u4f7f\u3046\u3068\u30e9\u30f3\u30bf\u30a4\u30e0\u30a8\u30e9\u30fc\u3068\u306a\u308b\uff0e<\/p>\n<p>\u304c\uff0c\u74b0\u5883\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066modifier\u3068\u3057\u3066\u4eee\u306e\u521d\u671f\u5024\u3092\u4e0e\u3048\uff0c\u7279\u5225\u6271\u3044\u3067\u304d\u308b (\uff1f\u3089\u3057\u3044\uff0e\u3053\u3053\u306f\u6b63\u76f4\u3088\u304f\u308f\u304b\u3089\u306a\u3044)\uff0e<\/p>\n<p>\u3053\u3053\u307e\u3067\u3067\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u9069\u5207\u306b\u52d5\u4f5c\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff0e<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1327\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/11.gif\" alt=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"640\" height=\"400\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E3%81%93%E3%81%93%E3%81%BE%E3%81%A7%E3%81%A7%E3%81%AE%E7%96%91%E5%95%8F\"><\/span>\u3053\u3053\u307e\u3067\u3067\u306e\u7591\u554f<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u3053\u3053\u3067\uff0c\u4e00\u65e6\u533a\u5207\u308a\u307e\u3059\uff0e<\/p>\n<p>\u79c1\u304c\u73fe\u6642\u70b9\u3067\u7591\u554f\u306b\u601d\u3063\u3066\u3044\u308b\u3053\u3068\u306f\uff0c<span class=\"lang:swift decode:true crayon-inline \">self<\/span>\u00a0\u306e\u6709\u7121\u3067\u3059\uff0e<\/p>\n<p>\u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\uff0e<\/p>\n<pre class=\"lang:swift decode:true \" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">ForEach(userData.landmarks){ landmark in\r\n    if !self.userData.showFavoritesOnly || landmark.isFavorite {\r\n       NavigationLink(destination: LandmarkDetail(landmark: landmark)) {\r\n           LandmarkRow(landmark: landmark)\r\n        }\r\n    }\r\n}<\/pre>\n<p><span class=\"lang:swift decode:true crayon-inline\">ForEach()<\/span>\u00a0\u306e\u4e2d\u3067\u306f<span class=\"lang:swift decode:true crayon-inline \">self<\/span>\u00a0\u3064\u3044\u3066\u3044\u306a\u3044\u3051\u308c\u3069\uff0c<span class=\"lang:swift decode:true crayon-inline \">if<\/span>\u00a0\u5206\u306e\u6761\u4ef6\u5f0f\u3067\u306f\u3064\u3044\u3066\u3044\u307e\u3059\u306d\uff0e<\/p>\n<p>\u3061\u306a\u307f\u306b\uff0c\u524d\u8005\u306f<span class=\"lang:swift decode:true crayon-inline \">self.<\/span>\u00a0\u304c\u3042\u3063\u3066\u3082\u52d5\u4f5c\u3057\u307e\u3059\u304c\uff0c\u5f8c\u8005\u306f\u7121\u3044\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\uff0e<\/p>\n<p>\u306a\u305c\uff0c\u3053\u3046\u306a\u308b\u304b\u8abf\u3079\u3066\u307f\u308b\u3068\uff0c<strong>\u300c\u30af\u30ed\u30fc\u30b8\u30e3\u5185\u3067\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u53c2\u7167\u306f\u660e\u793a\u7684\u306b<span class=\"lang:swift decode:true crayon-inline \">self.<\/span>\u00a0\u3067\u53c2\u7167\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u300d<\/strong>\u3068\u306e\u3053\u3068\uff0e<\/p>\n<p>\u500b\u4eba\u7684\u306b\u306f\uff0c\u5168\u3066\u660e\u793a\u7684\u306b<span class=\"lang:swift decode:true crayon-inline \">self.<\/span> \u3092\u3064\u3051\u305f\u304f\u306a\u308b\u4eba\u3060\u3051\u3069\uff0c\u306a\u3093\u304b\u4e2d\u9014\u534a\u7aef\u3060\u306d\uff0e<br \/>\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br \/>\n<ins class=\"adsbygoogle\" style=\"display: block; text-align: center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-7123758399787647\" data-ad-slot=\"1665651601\"><\/ins><br \/>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E8%A9%B3%E7%B4%B0%E3%83%93%E3%83%A5%E3%83%BC%E3%81%A8%E3%81%AE%E5%90%8C%E6%9C%9F\"><\/span>\u8a73\u7d30\u30d3\u30e5\u30fc\u3068\u306e\u540c\u671f<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u6700\u5f8c\u306b\uff0c\u8a73\u7d30\u30d3\u30e5\u30fc\u3067\u304a\u6c17\u306b\u5165\u308a\u306e\u8ffd\u52a0\u30fb\u89e3\u9664\u6a5f\u80fd\u3092\u3064\u3051\u3066\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306f\u7d42\u308f\u308a\u3067\u3059\uff0e<\/p>\n<p>\u5148\u307b\u3069\u4f5c\u6210\u3057\u305f<span class=\"lang:swift decode:true crayon-inline \">ObservableObject<\/span>\u00a0\u3068\uff0c<span class=\"lang:swift decode:true crayon-inline\">EnvironmentObject(_: )<\/span> \u306e\u304a\u304b\u3052\u3067\uff0c\u30d3\u30e5\u30fc\u3092\u8de8\u3044\u3060\u30c7\u30fc\u30bf\u306e\u540c\u671f\u3068\u63cf\u753b\u304c\u7c21\u5358\u306b\u884c\u3048\u307e\u3059\uff0e<\/p>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4fee\u6b63\uff0e<\/p>\n<pre class=\"lang:swift mark:2,5-7,42 decode:true\" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">struct LandmarkDetail: View {\r\n    @EnvironmentObject var userData: UserData\r\n    var landmark: Landmark\r\n    \r\n    var landmarkIndex: Int {\r\n        userData.landmarks.firstIndex(where: { $0.id == landmark.id })!\r\n    }\r\n\r\n    var body: some View {\r\n        VStack {\r\n            MapView(coordinate: landmark.locationCoordinate)\r\n                .edgesIgnoringSafeArea(.top)\r\n                .frame(height: 300)\r\n\r\n            CircleImage(image: landmark.image)\r\n                .offset(x: 0, y: -130)\r\n                .padding(.bottom, -130)\r\n\r\n            VStack(alignment: .leading) {\r\n                Text(landmark.name)\r\n                    .font(.title)\r\n\r\n                HStack(alignment: .top) {\r\n                    Text(landmark.park)\r\n                        .font(.subheadline)\r\n                    Spacer()\r\n                    Text(landmark.state)\r\n                        .font(.subheadline)\r\n                }\r\n            }\r\n            .padding()\r\n            \r\n            Spacer()\r\n        }\r\n        .navigationBarTitle(Text(landmark.name), displayMode: .inline)\r\n    }\r\n}\r\n\r\nstruct LandmarkDetail_Previews: PreviewProvider {\r\n    static var previews: some View {\r\n        LandmarkDetail(landmark: landmarkData[0])\r\n        .environmentObject(UserData())\r\n    }\r\n}<\/pre>\n<p>\u57fa\u672c\uff0c\u74b0\u5883\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5b9a\u7fa9\u306b\u95a2\u3059\u308b\u3082\u306e\u3067\u3059\u304c\uff0c\u4e00\u90e8\u521d\u3081\u3066\u898b\u308b\u3088\u3046\u306a\u30b3\u30fc\u30c9\u304c\u3042\u308a\u307e\u3059\u306d\uff0e<\/p>\n<pre class=\"lang:swift decode:true\" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">var landmarkIndex: Int {\r\n    userData.landmarks.firstIndex(where: { $0.id == landmark.id })!\r\n}<\/pre>\n<p>\u3053\u308c\u3067\u3059\uff0e<\/p>\n<p>\u3053\u308c\u306f\uff0c\u304a\u6c17\u306b\u5165\u308a\u306e\u8ffd\u52a0\u30fb\u89e3\u9664\u306b\u304a\u3044\u3066\uff0c\u305d\u306e\u5207\u308a\u66ff\u3048\u3092\u884c\u3046\u969b\u306b\u4f7f\u3046\uff0c\u4eca\u53c2\u7167\u3057\u3066\u3044\u308b\u30e9\u30f3\u30c9\u30de\u30fc\u30af\u914d\u5217\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\uff0e<\/p>\n<p>\u307e\u305a\uff0c<span class=\"lang:swift decode:true crayon-inline\">firstIndex()<\/span> \u306f\u914d\u5217\u306b\u5bfe\u3057\u3066\uff0c\u6307\u5b9a\u3057\u305f\u6761\u4ef6\u306b\u5408\u81f4\u3057\u305f\u6700\u521d\u306e\u30c7\u30fc\u30bf\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u8fd4\u3059\u95a2\u6570\u3067\u3059\uff0e<\/p>\n<p>\u305d\u3057\u3066\u305d\u306e\u4e2d\u8eab (\u6761\u4ef6\u5f0f) \u3067\u3059\u304c\uff0c<span class=\"lang:swift decode:true crayon-inline \">(where: { $0.id == landmark.id })<\/span>\u00a0\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u306d\uff0e<\/p>\n<p><strong>\u5b8c\u5168\u306b\u521d\u898b\u6bba\u3057\u306a\u30b3\u30fc\u30c9<\/strong>\u3060\u3068\u601d\u3044\u307e\u3059\uff0e<\/p>\n<p>\u307e\u305a\uff0c<span class=\"lang:swift decode:true crayon-inline \">where<\/span> \u3068\u3044\u3046\u5f15\u6570\u306b\u4f55\u304b\u3092\u6e21\u3057\u3066\u3044\u307e\u3059\u304c\uff0c\u3053\u306e\u300c\u4f55\u304b\u300d\u304c\u521d\u898b\u3060\u3068\u5206\u304b\u308a\u3065\u3089\u3044\u3067\u3059\uff0e<br \/>\n(\u3068\u3044\u3046\u304b\uff0c\u3053\u3053\u3067\u95a2\u6570\u3084\u30af\u30ed\u30fc\u30b8\u30e3\uff0c\u69cb\u9020\u4f53\uff0c\u30af\u30e9\u30b9\u3078\u306e\u5f15\u6570\u306e\u6307\u5b9a\u306e\u4ed5\u65b9\u3092\u77e5\u308b)<\/p>\n<p><strong>\u6b63\u4f53\u306f\u30af\u30ed\u30fc\u30b8\u30e3<\/strong>\u3067\uff0c<span class=\"lang:swift decode:true crayon-inline \">$0<\/span> \u306f\u7b2c\u4e00\u5f15\u6570\u3092\u8868\u3057\u3066\u3044\u307e\u3059\uff0e<\/p>\n<p>\u8a73\u3057\u3044\u5b9a\u7fa9\u306f\u5206\u304b\u308a\u307e\u305b\u3093\u304c\uff0c\u304a\u305d\u3089\u304f<span class=\"lang:swift decode:true crayon-inline\">firstIndex()<\/span>\u3067\u306f\u914d\u5217\u306e\u4e2d\u8eab\u3092\u4e00\u3064\u305a\u3064\u53d6\u308a\u51fa\u3057\uff0c\u305d\u308c\u3092\u305d\u306e\u307e\u307e\u5f15\u6570\u3068\u3057\u3066\u53d7\u3051\u53d6\u3063\u305f\u30af\u30ed\u30fc\u30b8\u30e3\u306b\u6e21\u3057\u3066\u3044\u308b\u306e\u3060\u3068\u601d\u3044\u307e\u3059\uff0e<\/p>\n<p>\u3068\u3044\u3046\u304b\u305d\u3082\u305d\u3082\uff0c\u306a\u3093\u3067<strong>\u6700\u521d\u304b\u3089\u53c2\u7167\u578b\u306e\u30af\u30e9\u30b9\u3092\u4f7f\u308f\u306a\u3044\u3093\u3060\u308d\u3046<\/strong>\uff0c\u3068\u3044\u3046\u7591\u554f\u304c\u6b8b\u308a\u307e\u3059\uff0e<\/p>\n<p>\u307e\u3042\uff0c\u5024\u578b\u306e\u69cb\u9020\u4f53\u3067<span class=\"lang:swift decode:true crayon-inline \">Landmark<\/span>\u00a0\u3092\u5b9a\u7fa9\u3057\u3061\u3083\u3063\u305f\u3093\u3060\u304b\u3089\u4ed5\u65b9\u306a\u3044\u306d\uff0e<\/p>\n<p>&nbsp;<\/p>\n<p>\u3055\u3066\uff0c\u8a73\u7d30\u30d3\u30e5\u30fc\u306b\u304a\u6c17\u306b\u5165\u308a\u30dc\u30bf\u30f3\u3092\u8ffd\u52a0\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff0e<\/p>\n<p>\u304a\u6c17\u306b\u5165\u308a\u30dc\u30bf\u30f3\u306f\uff0c\u30e9\u30f3\u30c9\u30de\u30fc\u30af\u540d\u306e\u53f3\u96a3\u306b\u7f6e\u304d\u305f\u3044\u306e\u3067\uff0c\u307e\u305a\u306f\u30e9\u30f3\u30c9\u30de\u30fc\u30af\u540d\u3092<span class=\"lang:swift decode:true crayon-inline \">VStack {}<\/span> \u306b\u5165\u308c\u3066\uff0c\u3055\u3089\u306b\u305d\u3053\u306b\u30dc\u30bf\u30f3\u3092\u6c34\u5e73\u65b9\u5411\u306b\u4e26\u3079\u307e\u3059\uff0e<\/p>\n<pre class=\"lang:swift mark:20-35 decode:true\" title=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\">struct LandmarkDetail: View {\r\n    @EnvironmentObject var userData: UserData\r\n    var landmark: Landmark\r\n    \r\n    var landmarkIndex: Int {\r\n        userData.landmarks.firstIndex(where: { $0.id == landmark.id })!\r\n    }\r\n\r\n    var body: some View {\r\n        VStack {\r\n            MapView(coordinate: landmark.locationCoordinate)\r\n                .edgesIgnoringSafeArea(.top)\r\n                .frame(height: 300)\r\n\r\n            CircleImage(image: landmark.image)\r\n                .offset(x: 0, y: -130)\r\n                .padding(.bottom, -130)\r\n\r\n            VStack(alignment: .leading) {\r\n                HStack {\r\n                    Text(landmark.name)\r\n                        .font(.title)\r\n                    \r\n                    Button(action: {\r\n                        self.userData.landmarks[self.landmarkIndex].isFavorite.toggle()\r\n                    }) {\r\n                        if self.userData.landmarks[self.landmarkIndex].isFavorite {\r\n                            Image(systemName: \"star.fill\")\r\n                                .foregroundColor(Color.yellow)\r\n                        } else {\r\n                            Image(systemName: \"star\")\r\n                                .foregroundColor(Color.gray)\r\n                        }\r\n                    }\r\n                }\r\n                \r\n\r\n                HStack(alignment: .top) {\r\n                    Text(landmark.park)\r\n                        .font(.subheadline)\r\n                    Spacer()\r\n                    Text(landmark.state)\r\n                        .font(.subheadline)\r\n                }\r\n            }\r\n            .padding()\r\n            \r\n            Spacer()\r\n        }\r\n        .navigationBarTitle(Text(landmark.name), displayMode: .inline)\r\n    }\r\n}<\/pre>\n<p>\u3053\u308c\u3067\u672c\u30a2\u30d7\u30ea\u306f\u5b8c\u6210\u3067\u3059\uff0e<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1332\" src=\"https:\/\/hirlab.net\/nblog\/wp-content\/uploads\/2020\/08\/12.gif\" alt=\"\u4ed6\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u666e\u6bb5\u4f7f\u3046\u4eba\u306e\u305f\u3081\u306e\u65e5\u672c\u8a9e\u7248SwiftUI\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" width=\"640\" height=\"400\" \/><\/p>\n<p>\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\uff0e<\/p>\n<p>\u6700\u5f8c\u306b\uff0c\u5168\u4f53\u3092\u901a\u3057\u3066\u6c17\u306b\u306a\u3063\u305f\u3053\u3068\u3092\u307e\u3068\u3081\u3066\u7d42\u308f\u308a\u307e\u3059\uff0e<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E3%81%8A%E3%82%8F%E3%82%8A%E3%81%AB%EF%BC%9ASwift%E3%81%AB%E5%AF%BE%E3%81%99%E3%82%8B%E6%89%80%E6%84%9F\"><\/span>\u304a\u308f\u308a\u306b\uff1aSwift\u306b\u5bfe\u3059\u308b\u6240\u611f<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u5404\u6240\u7a81\u3063\u8fbc\u307f\u306a\u304c\u3089\u9032\u3081\u308b\u3068\uff0c\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3068\u8a00\u3048\u3069\u9577\u3044\u3067\u3059\u306d\uff0e<\/p>\n<p>\u3053\u3053\u307e\u3067\u304a\u4ed8\u304d\u5408\u3044\u3057\u3066\u304f\u308c\u3066\u3044\u308b\u307f\u306a\u3055\u3093\uff0c\u672c\u5f53\u306b\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\uff0e (\u591a\u5206\u6700\u5f8c\u307e\u3067\u8aad\u3093\u3067\u304f\u308c\u3066\u3044\u308b\u4eba\u3042\u307e\u308a\u3044\u306a\u3044\u3093\u3058\u3083\u306a\u3044\u304b\u306a...)<\/p>\n<p>\u6700\u5f8c\u306b\uff0cSwift\u306b\u5bfe\u3059\u308b\u6240\u611f\u3068\uff0c\u3061\u3087\u3063\u3068\u3057\u305f\u307e\u3068\u3081\u3092\u66f8\u304d\u307e\u3059\uff0e<\/p>\n<p>\u307e\u305a\u6240\u611f\u3067\u3059\u304c\uff0c<strong>Swift (\u3068\u3044\u3046\u304bSwiftUI) \u306f\u591a\u6a5f\u80fd\u3059\u304e\u3066\uff0c\u7d30\u304b\u304f\u3072\u3068\u3064\u3072\u3068\u3064\u8ffd\u3046\u306b\u306f\u304b\u306a\u308a\u6642\u9593\u304c\u304b\u304b\u308b\u305f\u3081\u3042\u308b\u7a0b\u5ea6\u59a5\u5354\u304c\u5fc5\u8981\u3060\u306a<\/strong>\uff0c\u3068\u611f\u3058\u307e\u3057\u305f\uff0e<\/p>\n<p>\u307e\u3042\uff0c\u79c1\u81ea\u8eab\u3053\u306e\u8a18\u4e8b\u3092\u66f8\u304d\u306a\u304c\u3089\u521d\u3081\u3066Swift\u81ea\u4f53\u306b\u3082\u89e6\u3063\u3066\u3044\u308b\u308f\u3051\u3067\u3059\u3057\uff0c\u3082\u3057Swift\u81ea\u4f53\u306e\u77e5\u8b58\u304c\u3082\u3046\u5c11\u3057\u3042\u308c\u3070\uff0c\u3082\u3063\u3068\u826f\u3044\u611f\u3058\u306b\u8aac\u660e\u3067\u304d\u305f\u304b\u3082\u3057\u308c\u307e\u305b\u3093...\u7121\u5ff5\uff0e<\/p>\n<p>\u305d\u3057\u3066\u305d\u306e\u4ed6\u306b\u3082\uff0c\u30b3\u30fc\u30c9\u3092\u8aad\u3093\u3060\u611f\u60f3\u3068\u3057\u3066\u306f\uff0c<strong>\u69cb\u9020\u4f53\u3068\u95a2\u6570\u3068\u30af\u30ed\u30fc\u30b8\u30e3\u306e\u547c\u3073\u51fa\u3057\u65b9\u304c\u5206\u304b\u308a\u3065\u3089\u3044<\/strong>\u306a\uff0c\u3068\u3082\u611f\u3058\u307e\u3057\u305f\uff0e<\/p>\n<p>\u3068\u3044\u3046\u3088\u308a\uff0c<strong><span class=\"lang:swift decode:true crayon-inline\">{ }<\/span>\u00a0\u306e\u610f\u5473\u3092\u898b\u5931\u3044\u3084\u3059\u3044<\/strong>\uff0c\u3068\u8a00\u3063\u305f\u611f\u3058\u3067\u3057\u3087\u3046\u304b\uff0e<\/p>\n<p>\u8ab0\u304b\u3053\u306e\u6c17\u6301\u3061\u308f\u304b\u3063\u3066\u304f\u308c\u306a\u3044\u304b\u306a\u3042...<\/p>\n<p>\u7279\u306b\uff0c<span class=\"lang:swift decode:true crayon-inline \">VStack {}, HStack {}<\/span> \u7cfb\uff0e<\/p>\n<p>\u5b9a\u7fa9\u3068\u3057\u3066\u306f\uff0c\u69cb\u9020\u4f53\u306a\u3093\u3060\u3051\u308c\u3069\u3082\uff0c\u306a\u3093\u3067<span class=\"lang:swift decode:true crayon-inline \">{ }<\/span>\u00a0\u3092\u4f7f\u3063\u305f\u547c\u3073\u51fa\u3057\u304c\u3067\u304d\u308b\u306e\u304b\u304c\u307e\u3060\u7406\u89e3\u3067\u304d\u3066\u3044\u306a\u3044\uff0e<\/p>\n<p>\u7279\u5225\u306a\u69cb\u9020\u4f53\u306a\u3093\u3060\u308d\u3046\u304b...<\/p>\n<p>\u305d\u308c\u306f\u307e\u305f\u3044\u3064\u304b\u89e3\u6c7a\u3057\u305f\u3044\uff0e<\/p>\n<h3><span class=\"ez-toc-section\" id=\"_Swift%E3%81%A7%E3%81%AE%E3%82%A2%E3%83%97%E3%83%AA%E9%96%8B%E7%99%BA%E3%82%92%E5%AD%A6%E3%81%B6%E3%81%AA%E3%82%89\"><\/span>???? Swift\u3067\u306e\u30a2\u30d7\u30ea\u958b\u767a\u3092\u5b66\u3076\u306a\u3089<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><a href=\"\/\/af.moshimo.com\/af\/c\/click?a_id=2143215&p_id=2786&pc_id=6331&pl_id=36086&url=https%3A%2F%2Fplayground.style%2Fofficial%2Fsupport%2F\" rel=\"nofollow\"><img src=\"https:\/\/image.moshimo.com\/af-img\/2217\/000000036086.jpg\" style=\"border:none;\"><\/a><img loading=\"lazy\" src=\"\/\/i.moshimo.com\/af\/i\/impression?a_id=2143215&p_id=2786&pc_id=6331&pl_id=36086\" width=\"1\" height=\"1\" style=\"border:none;\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u666e\u6bb5Java\u3068\u304bC++\u3068\u304bPython\u3068\u304bGo\u3068\u304b\u4f7f\u3063\u3066\u308b\u3051\u3069\uff0c\u6c17\u306b\u306a\u308bSwift\uff0eSwift\u3068\u3044\u3048\u3070SwiftUI\u3092\u4f7f\u3063\u305f\u30a2\u30d7\u30ea\u958b\u767a\uff0e\u6c17\u306b\u306a\u308b\u3051\u3069\u306a\u3093\u304b\u52c9\u5f37\u3059\u308b\u6c17\u306b\u306a\u3089\u306a\u3044... \u305d\u3093\u306a\u4eba\u305f\u3061\u306e\u305f\u3081\u306e\u89e3\u8aac\u8a18\u4e8b\u3067\u3059\uff0e\u79c1\u3082Swift\u77e5\u308a\u307e\u305b\u3093\uff0e\u3060\u304b\u3089\u3053\u305d\uff0c\u3044\u308d\u3093\u306a\u3068\u3053\u308d\u306b\u7a81\u3063\u8fbc\u307f\u3092\u5165\u308c\u306a\u304c\u3089\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u9032\u3081\u3066\u3044\u304d\u307e\u3059\uff0e<\/p>\n","protected":false},"author":1,"featured_media":1335,"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\/1294"}],"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=1294"}],"version-history":[{"count":36,"href":"https:\/\/hirlab.net\/nblog\/wp-json\/wp\/v2\/posts\/1294\/revisions"}],"predecessor-version":[{"id":1364,"href":"https:\/\/hirlab.net\/nblog\/wp-json\/wp\/v2\/posts\/1294\/revisions\/1364"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hirlab.net\/nblog\/wp-json\/wp\/v2\/media\/1335"}],"wp:attachment":[{"href":"https:\/\/hirlab.net\/nblog\/wp-json\/wp\/v2\/media?parent=1294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hirlab.net\/nblog\/wp-json\/wp\/v2\/categories?post=1294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hirlab.net\/nblog\/wp-json\/wp\/v2\/tags?post=1294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}