{"id":721,"date":"2020-09-06T10:47:50","date_gmt":"2020-09-06T01:47:50","guid":{"rendered":"https:\/\/naoya-ono.com\/swift\/?p=721"},"modified":"2020-09-15T12:36:50","modified_gmt":"2020-09-15T03:36:50","slug":"swift-table-view-basic","status":"publish","type":"post","link":"https:\/\/naoya-ono.com\/swift\/swift-table-view-basic\/","title":{"rendered":"\u3010Swift\u3011UITableView\u306e\u4f7f\u3044\u65b9"},"content":{"rendered":"<p>\u3053\u306e\u30da\u30fc\u30b8\u3067\u306f\u3001UITableView\u3092\u4f5c\u6210\u3057\u3066\u30c7\u30fc\u30bf\u3092\u8868\u793a\u3059\u308b\u307e\u3067\u306e\u57fa\u672c\u7684\u306a\u6d41\u308c\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic1.png\" alt=\"\" width=\"612\" height=\"380\" class=\"alignnone wp-image-724 \" srcset=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic1.png 746w, https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic1-300x187.png 300w\" sizes=\"(max-width: 612px) 100vw, 612px\"><\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">Contents<\/p><ul class=\"toc_list\"><li><a href=\"#TableView\">TableView\u306e\u8a2d\u5b9a\u3092\u3059\u308b<\/a><ul><li><a href=\"#1_Table_View\">1. Table View\u306e\u8a2d\u7f6e<\/a><\/li><li><a href=\"#2_Outlets\">2. Outlets\u306e\u8a2d\u5b9a<\/a><\/li><\/ul><\/li><li><a href=\"#TableViewCell\">TableViewCell\u306e\u8a2d\u5b9a\u3092\u3059\u308b<\/a><ul><li><a href=\"#1_Table_View_Cell\">1. Table View Cell\u306e\u8a2d\u7f6e<\/a><\/li><li><a href=\"#2_ID\">2. ID\u306e\u8a2d\u5b9a<\/a><\/li><\/ul><\/li><li><a href=\"#ViewController\">ViewController\u3078\u306e\u8a18\u8ff0<\/a><ul><li><a href=\"#1\">1. \u30bb\u30eb\u306b\u8868\u793a\u3059\u308b\u30c7\u30fc\u30bf\u3092\u6e96\u5099<\/a><\/li><li><a href=\"#2\">2. \u30c6\u30fc\u30d6\u30eb\u30d3\u30e5\u30fc\u306e\u8868\u793a\u306b\u95a2\u9023\u3059\u308b\u51e6\u7406<\/a><\/li><\/ul><\/li><\/ul><\/div>\n<h2 class=\"hh hh5 pastel-bc\" id=\"i-0\"><span id=\"TableView\">TableView\u306e\u8a2d\u5b9a\u3092\u3059\u308b<\/span><\/h2>\n<h3 id=\"i-1\"><span id=\"1_Table_View\">1. Table View\u306e\u8a2d\u7f6e<\/span><\/h3>\n<p><span>Objects\u4e00\u89a7\u304b\u3089\u300cTable View\u300d\u3092\u691c\u7d22\u3057\u3066\u3001\u305d\u308c\u3092ViewController\u306b\u30c9\u30e9\u30c3\u30b0&amp;\u30c9\u30ed\u30c3\u30d7\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic2.jpg\" alt=\"\" width=\"1024\" height=\"565\" class=\"wp-image-732 size-full aligncenter\" srcset=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic2.jpg 1024w, https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic2-300x166.jpg 300w, https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic2-768x424.jpg 768w, https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic2-940x519.jpg 940w\" sizes=\"(max-width: 1024px) 100vw, 1024px\"><\/p>\n<p>\u300cTable View\u300d\u3092\u8a2d\u7f6e\u3059\u308b\u3068\u3001\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic3.png\" alt=\"\" width=\"322\" height=\"595\" class=\"alignnone wp-image-731 \" srcset=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic3.png 554w, https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic3-162x300.png 162w\" sizes=\"(max-width: 322px) 100vw, 322px\"><\/p>\n<h3 id=\"i-2\"><span id=\"2_Outlets\">2. Outlets\u306e\u8a2d\u5b9a<\/span><\/h3>\n<p>\u7d9a\u3044\u3066\u3001TableView\u306eOutlets\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u30bb\u30eb\u306e\u8a2d\u5b9a\u3084\u30bb\u30eb\u3078\u306e\u5024\u306e\u4ee3\u5165\u306a\u3069\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3084\u308a\u65b9\u306f\u3001\u6b21\u306e\u5199\u771f\u306e\u3088\u3046\u306b\u3001<span>Document Outline\u306eTableView\u3092Control\u30ad\u30fc\u3092\u62bc\u3057\u306a\u304c\u3089\u30af\u30ea\u30c3\u30af\u3057\u3001<\/span><span class=\"marker-under-red\">ViewController<\/span><span>\u306b\u30c9\u30e9\u30c3\u30b0\uff06\u30c9\u30ed\u30c3\u30d7\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic4.jpg\" alt=\"\" width=\"1024\" height=\"730\" class=\"wp-image-730 size-full aligncenter\" srcset=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic4.jpg 1024w, https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic4-300x214.jpg 300w, https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic4-768x548.jpg 768w, https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic4-940x670.jpg 940w\" sizes=\"(max-width: 1024px) 100vw, 1024px\"><\/p>\n<p>\u3059\u308b\u3068\u3001\u4e0b\u306e\u3088\u3046\u306bOutlets\u306e\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001<strong>\u300cdataSource\u300d\u3068\u300cdelegate\u300d<\/strong>\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic5.jpg\" alt=\"\" width=\"378\" height=\"183\" class=\"alignnone wp-image-729 \" srcset=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic5.jpg 566w, https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic5-300x145.jpg 300w\" sizes=\"(max-width: 378px) 100vw, 378px\"><\/p>\n<p>\u304d\u3061\u3093\u3068\u9078\u629e\u3067\u304d\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u6b21\u306e\u5199\u771f\u306e\u3088\u3046\u306b\u300cdataSource\u300d\u3068\u300cdelegate\u300d\u306e\u5de6\u7aef\u306b\u767d\u4e38\u304c\u4ed8\u304d\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic6.png\" alt=\"\" width=\"378\" height=\"172\" class=\"alignnone wp-image-728 \" srcset=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic6.png 404w, https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic6-300x137.png 300w\" sizes=\"(max-width: 378px) 100vw, 378px\"><br \/>\n<script src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\" async><\/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-4166043434922569\" data-ad-slot=\"7750996733\"><\/ins><br \/>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><\/p>\n<h2 class=\"hh hh5 pastel-bc\" id=\"i-3\"><span id=\"TableViewCell\">TableViewCell\u306e\u8a2d\u5b9a\u3092\u3059\u308b<\/span><\/h2>\n<h3 id=\"i-4\"><span id=\"1_Table_View_Cell\">1. Table View Cell\u306e\u8a2d\u7f6e<\/span><\/h3>\n<p>\u7d9a\u3044\u3066\u3001TableView\u5185\u306b\u8868\u793a\u3059\u308b\u30bb\u30eb\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p><span>Objects\u4e00\u89a7\u304b\u3089\u3001\u300cTable View Cell\u300d\u3092\u691c\u7d22\u3057\u3066\u3001\u305d\u308c\u3092ViewController\u306eTable View\u306e\u4e0a\u306b\u30c9\u30e9\u30c3\u30b0&amp;\u30c9\u30ed\u30c3\u30d7\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic7.jpg\" alt=\"\" width=\"1024\" height=\"546\" class=\"wp-image-727 size-full aligncenter\" srcset=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic7.jpg 1024w, https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic7-300x160.jpg 300w, https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic7-768x410.jpg 768w, https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic7-940x501.jpg 940w\" sizes=\"(max-width: 1024px) 100vw, 1024px\"><\/p>\n<p>\u30c9\u30ed\u30c3\u30d7\u3057\u305f\u5f8c\u306f\u3001\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic8.png\" alt=\"\" width=\"321\" height=\"582\" class=\"alignnone wp-image-726 \" srcset=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic8.png 560w, https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic8-165x300.png 165w\" sizes=\"(max-width: 321px) 100vw, 321px\"><\/p>\n<h3 id=\"i-5\"><span id=\"2_ID\">2. ID\u306e\u8a2d\u5b9a<\/span><\/h3>\n<p>Cell\u306e\u540d\u524d\u306b\u5f53\u305f\u308bID\uff08<span>Identifer<\/span>\uff09\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p><span>Document Outline\u306e\u300cTable View Cell\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u3001\u5c5e\u6027\u4e00\u89a7\u306b\u3042\u308b\u300cidentifer\u300d\u306b\u4efb\u610f\u306e\u540d\u524d\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/span><\/p>\n<p>\u540d\u524d\u306f\u4f55\u3067\u3082\u3044\u3044\u3067\u3059\u304c\u3001\u308f\u304b\u308a\u3084\u3059\u3044\u3082\u306e\u306b\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u300csampleCell\u300d\u3068\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic9.jpg\" alt=\"\" width=\"1024\" height=\"229\" class=\"alignnone wp-image-725 size-full\" srcset=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic9.jpg 1024w, https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic9-300x67.jpg 300w, https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic9-768x172.jpg 768w, https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic9-940x210.jpg 940w\" sizes=\"(max-width: 1024px) 100vw, 1024px\"><\/p>\n<h2 class=\"hh hh5 pastel-bc\" id=\"i-6\"><span id=\"ViewController\">ViewController\u3078\u306e\u8a18\u8ff0<\/span><\/h2>\n<p>\u3053\u3053\u3067\u306f\u3001\u753b\u9762\u306b\u30c6\u30fc\u30d6\u30eb\u306e\u30bb\u30eb\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306e\u51e6\u7406\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<p>\u5b8c\u6210\u5f62\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-swift\" data-lang=\"Swift\"><code>import UIKit\n\nclass ViewController: UIViewController {\n\n  &nbsp; @IBOutlet weak var tableView: UITableView!\n\n  &nbsp; \/\/ 1.\u30bb\u30eb\u306b\u8868\u793a\u3059\u308b\u30c7\u30fc\u30bf\u3092\u6e96\u5099\n&nbsp; &nbsp; var list = [\"\u30bb\u30eb1\", \"\u30bb\u30eb2\", \"\u30bb\u30eb3\", \"\u30bb\u30eb4\", \"\u30bb\u30eb5\"]\n\n&nbsp; &nbsp; override func viewDidLoad() {\n&nbsp; &nbsp; &nbsp; &nbsp; super.viewDidLoad()\n&nbsp; &nbsp; }\n}\n\n\/\/ 2. \u30c6\u30fc\u30d6\u30eb\u30d3\u30e5\u30fc\u306e\u8868\u793a\u306b\u95a2\u9023\u3059\u308b\u51e6\u7406\nextension ViewController: UITableViewDataSource {\n\n  &nbsp; \/\/ 2-1. \u30c6\u30fc\u30d6\u30eb\u306e\u884c\u6570\u3092\u6307\u5b9a\n&nbsp; &nbsp; func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {\n&nbsp; &nbsp; &nbsp; &nbsp; return list.count\n&nbsp; &nbsp; }\n\n&nbsp; &nbsp; \/\/ 2-2. \u30bb\u30eb\u306b\u5024\u3092\u30bb\u30c3\u30c8\n&nbsp; &nbsp; func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {\n\n          \/\/ \u30bb\u30eb\u3092\u53d6\u5f97&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;\n&nbsp; &nbsp; &nbsp; &nbsp; let cell = tableView.dequeueReusableCell(withIdentifier: \"sampleCell\", for: indexPath)&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;\n\n&nbsp; &nbsp; &nbsp; &nbsp; \/\/ \u30bb\u30eb\u306b\u5024\u3092\u30bb\u30c3\u30c8\n&nbsp; &nbsp; &nbsp; &nbsp; cell.textLabel?.text = list[indexPath.row]\n\n&nbsp; &nbsp; &nbsp; &nbsp; \/\/ \u30bb\u30eb\u3092\u8fd4\u5374\n&nbsp; &nbsp; &nbsp; &nbsp; return cell\n&nbsp; &nbsp; }\n}\n\n\/\/ 3. \u30bb\u30eb\u3092\u30bf\u30c3\u30d7\u3057\u305f\u6642\u306e\u51e6\u7406\u306a\u3069\uff08\u4eca\u56de\u306f\u5272\u611b\uff09\nextension ViewController: UITableViewDelegate {\n\n}<\/code><\/pre>\n<\/div>\n<h3 id=\"i-7\"><span id=\"1\">1. \u30bb\u30eb\u306b\u8868\u793a\u3059\u308b\u30c7\u30fc\u30bf\u3092\u6e96\u5099<\/span><\/h3>\n<p>\u307e\u305a\u306f\u30bb\u30eb\u306b\u8868\u793a\u3059\u308b\u305f\u3081\u306e\u30c7\u30fc\u30bf\u304c\u5fc5\u8981\u306a\u306e\u3067\u3001\u30c6\u30b9\u30c8\u7528\u306b\u914d\u5217\u3092\u7528\u610f\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-swift\" data-lang=\"Swift\"><code> \/\/ 1.\u30bb\u30eb\u306b\u8868\u793a\u3059\u308b\u914d\u5217\u3092\u6e96\u5099\n&nbsp; &nbsp; var list = [\"\u30bb\u30eb1\", \"\u30bb\u30eb2\", \"\u30bb\u30eb3\", \"\u30bb\u30eb4\", \"\u30bb\u30eb5\"]<\/code><\/pre>\n<\/div>\n<h3 id=\"i-8\"><span id=\"2\">2. \u30c6\u30fc\u30d6\u30eb\u30d3\u30e5\u30fc\u306e\u8868\u793a\u306b\u95a2\u9023\u3059\u308b\u51e6\u7406<\/span><\/h3>\n<p>\u7d9a\u3044\u3066\u3001\u30c6\u30fc\u30d6\u30eb\u30d3\u30e5\u30fc\u306e\u8868\u793a\u306b\u95a2\u9023\u3059\u308b\u30d7\u30ed\u30c8\u30b3\u30eb\u300cUITableViewDataSource\u300d\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>\u300c<strong>class ViewController: UIViewController, UITableViewDataSource{}<\/strong>\u300d\u306e\u3088\u3046\u306b\u66f8\u3044\u3066\u3082\u3044\u3044\u306e\u3067\u3059\u304c\u3001\u6570\u304c\u5897\u3048\u308b\u3068\u3001\u53ef\u8aad\u6027\u304c\u60aa\u304f\u306a\u308b\u306e\u3067extension\u3067\u5225\u51fa\u3057\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-swift\" data-lang=\"Swift\"><code>\/\/ 2. \u30c6\u30fc\u30d6\u30eb\u30d3\u30e5\u30fc\u306b\u95a2\u3059\u308b\u8a2d\u5b9a\nextension ViewController: UITableViewDataSource { &nbsp;\n\n}<\/code><\/pre>\n<\/div>\n<p>\u4e2d\u306b\u306f\u6b21\u306e\uff12\u3064\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u66f8\u304d\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-swift\" data-lang=\"Swift\"><code>\/\/ 2-1. \u30c6\u30fc\u30d6\u30eb\u306e\u884c\u6570\u3092\u6307\u5b9a\nfunc tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {\n    return list.count\n}\n\n\/\/ 2-2. \u30bb\u30eb\u306b\u5024\u3092\u30bb\u30c3\u30c8\nfunc tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {\n\n      \/\/ \u30bb\u30eb\u3092\u53d6\u5f97&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;\n&nbsp; &nbsp; let cell = tableView.dequeueReusableCell(withIdentifier: \"sampleCell\", for: indexPath)&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;\n\n&nbsp; &nbsp; \/\/ \u30bb\u30eb\u306b\u5024\u3092\u30bb\u30c3\u30c8\n  &nbsp; cell.textLabel?.text = list[indexPath.row]\n\n&nbsp; &nbsp; \/\/ \u30bb\u30eb\u3092\u8fd4\u5374\n&nbsp; &nbsp; return cell\n}<\/code><\/pre>\n<\/div>\n<p><span>\u300c2-1\u300d\u306f\u30c7\u30fc\u30bf\u3092\u8868\u793a\u3059\u308b\u884c\u6570\u3092\u8fd4\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<p>\u914d\u5217list\u5206\u3060\u3051\u5fc5\u8981\u306a\u306e\u3067\u3001\u4eca\u56de\u306f\u300clist.count\u300d\u3092\u8fd4\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u300c2-2\u300d\u3067\u306f\u3001\u30bb\u30eb\u306b\u8868\u793a\u3059\u308b\u5024\u3092\u30bb\u30c3\u30c8\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001tableView.dequeueReusableCell(withIdentifier: \u201csampleCell\u201d, for: indexPath)\u3092\u4f7f\u3063\u3066\u30bb\u30eb\u3092\u4f5c\u6210\u3057\u3001\u305d\u306e\u30bb\u30eb\u306b\u914d\u5217list\u306e\u5024\u3092\u683c\u7d0d\u3057\u3066\u8fd4\u5374\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u300cindexPath.row\u300d\u306f\u30bb\u30eb\u306e\u884c\u6570\u3092\u8868\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u4e0a\u306e\u300csampleCell\u300d\u306f\u3054\u81ea\u8eab\u306e\u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u4ee5\u4e0a\u3067\u3001\u30d3\u30eb\u30c9\u3057\u30b7\u30df\u30e5\u30ec\u30fc\u30bf\u30fc\u3092\u8d77\u52d5\u3059\u308b\u3068\u3053\u306e\u3088\u3046\u306b\u304d\u3061\u3093\u3068\u914d\u5217\u306e\u5024\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic1.png\" alt=\"\" width=\"612\" height=\"380\" class=\"alignnone wp-image-724 \" srcset=\"https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic1.png 746w, https:\/\/naoya-ono.com\/swift\/wp-content\/uploads\/2020\/09\/swift-table-view-basic1-300x187.png 300w\" sizes=\"(max-width: 612px) 100vw, 612px\"><\/p>\n<div id=\"rinkerid180\" class=\"yyi-rinker-contents  yyi-rinker-postid-180 yyi-rinker-img-m yyi-rinker-catid-5 yyi-rinker-catid-10 \">\n<div class=\"yyi-rinker-box\">\n<div class=\"yyi-rinker-image\">\n\t\t\t\t\t\t\t<a href=\"https:\/\/www.amazon.co.jp\/dp\/B086VVQ3DJ?tag=naoya-ono-22&amp;linkCode=ogi&amp;th=1&amp;psc=1\" rel=\"nofollow\" class=\"yyi-rinker-tracking\" data-click-tracking=\"amazon_img 180 \uff3b\u5897\u88dc\u6539\u8a02\u7b2c3\u7248\uff3dSwift\u5b9f\u8df5\u5165\u9580 \u2500\u2500 \u76f4\u611f\u7684\u306a\u6587\u6cd5\u3068\u5b89\u5168\u6027\u3092\u517c\u306d\u5099\u3048\u305f\u8a00\u8a9e WEB+DB PRESS plus\" data-vars-click-id=\"amazon_img 180 \uff3b\u5897\u88dc\u6539\u8a02\u7b2c3\u7248\uff3dSwift\u5b9f\u8df5\u5165\u9580 \u2500\u2500 \u76f4\u611f\u7684\u306a\u6587\u6cd5\u3068\u5b89\u5168\u6027\u3092\u517c\u306d\u5099\u3048\u305f\u8a00\u8a9e WEB+DB PRESS plus\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/m.media-amazon.com\/images\/I\/51iY70Z3fKL._SL160_.jpg\" width=\"113\" height=\"160\" class=\"yyi-rinker-main-img\" style=\"border: none;\"><\/a>\t\t\t\t\t<\/div>\n<div class=\"yyi-rinker-info\">\n<div class=\"yyi-rinker-title\">\n\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/www.amazon.co.jp\/dp\/B086VVQ3DJ?tag=naoya-ono-22&amp;linkCode=ogi&amp;th=1&amp;psc=1\" rel=\"nofollow\" class=\"yyi-rinker-tracking\" data-click-tracking=\"amazon_title 180 \uff3b\u5897\u88dc\u6539\u8a02\u7b2c3\u7248\uff3dSwift\u5b9f\u8df5\u5165\u9580 \u2500\u2500 \u76f4\u611f\u7684\u306a\u6587\u6cd5\u3068\u5b89\u5168\u6027\u3092\u517c\u306d\u5099\u3048\u305f\u8a00\u8a9e WEB+DB PRESS plus\" data-vars-amp-click-id=\"amazon_title 180 \uff3b\u5897\u88dc\u6539\u8a02\u7b2c3\u7248\uff3dSwift\u5b9f\u8df5\u5165\u9580 \u2500\u2500 \u76f4\u611f\u7684\u306a\u6587\u6cd5\u3068\u5b89\u5168\u6027\u3092\u517c\u306d\u5099\u3048\u305f\u8a00\u8a9e WEB+DB PRESS plus\">\uff3b\u5897\u88dc\u6539\u8a02\u7b2c3\u7248\uff3dSwift\u5b9f\u8df5\u5165\u9580 \u2500\u2500 \u76f4\u611f\u7684\u306a\u6587\u6cd5\u3068\u5b89\u5168\u6027\u3092\u517c\u306d\u5099\u3048\u305f\u8a00\u8a9e WEB+DB PRESS plus<\/a>\t\t\t\t\t\t\t<\/div>\n<div class=\"yyi-rinker-detail\">\n<div class=\"credit-box\">created by&nbsp;<a href=\"https:\/\/oyakosodate.com\/rinker\/\" rel=\"nofollow noopener\" target=\"_blank\">Rinker<\/a><\/div>\n<div class=\"price-box\">\n\t\t\t\t\t\t\t<\/div>\n<\/p><\/div>\n<ul class=\"yyi-rinker-links\">\n<li class=\"amazonkindlelink\">\n\t\t\t\t\t\t<a href=\"https:\/\/www.amazon.co.jp\/dp\/B086VVQ3DJ?tag=naoya-ono-22&amp;linkCode=ogi&amp;th=1&amp;psc=1\" rel=\"nofollow\" class=\"yyi-rinker-link yyi-rinker-tracking\" data-click-tracking=\"amazon_kindle 180 \uff3b\u5897\u88dc\u6539\u8a02\u7b2c3\u7248\uff3dSwift\u5b9f\u8df5\u5165\u9580 \u2500\u2500 \u76f4\u611f\u7684\u306a\u6587\u6cd5\u3068\u5b89\u5168\u6027\u3092\u517c\u306d\u5099\u3048\u305f\u8a00\u8a9e WEB+DB PRESS plus\" data-vars-amp-click-id=\"amazon_kindle 180 \uff3b\u5897\u88dc\u6539\u8a02\u7b2c3\u7248\uff3dSwift\u5b9f\u8df5\u5165\u9580 \u2500\u2500 \u76f4\u611f\u7684\u306a\u6587\u6cd5\u3068\u5b89\u5168\u6027\u3092\u517c\u306d\u5099\u3048\u305f\u8a00\u8a9e WEB+DB PRESS plus\">Kindle<\/a>\t\t\t\t\t<\/li>\n<li class=\"amazonlink\">\n\t\t\t\t\t\t<a href=\"https:\/\/www.amazon.co.jp\/dp\/B086VVQ3DJ?tag=naoya-ono-22&amp;linkCode=ogi&amp;th=1&amp;psc=1\" rel=\"nofollow\" class=\"yyi-rinker-link yyi-rinker-tracking\" data-click-tracking=\"amazon 180 \uff3b\u5897\u88dc\u6539\u8a02\u7b2c3\u7248\uff3dSwift\u5b9f\u8df5\u5165\u9580 \u2500\u2500 \u76f4\u611f\u7684\u306a\u6587\u6cd5\u3068\u5b89\u5168\u6027\u3092\u517c\u306d\u5099\u3048\u305f\u8a00\u8a9e WEB+DB PRESS plus\" data-vars-amp-click-id=\"amazon 180 \uff3b\u5897\u88dc\u6539\u8a02\u7b2c3\u7248\uff3dSwift\u5b9f\u8df5\u5165\u9580 \u2500\u2500 \u76f4\u611f\u7684\u306a\u6587\u6cd5\u3068\u5b89\u5168\u6027\u3092\u517c\u306d\u5099\u3048\u305f\u8a00\u8a9e WEB+DB PRESS plus\">Amazon<\/a>\t\t\t\t\t<\/li>\n<li class=\"rakutenlink\">\n\t\t\t\t\t\t<a href=\"https:\/\/hb.afl.rakuten.co.jp\/hgc\/16781883.64066d33.16781884.4f333982\/Rinker_o_20200831130951?pc=https%3A%2F%2Fsearch.rakuten.co.jp%2Fsearch%2Fmall%2Fswift%2B%25E5%25AE%259F%25E8%25B7%25B5%25E5%2585%25A5%25E9%2596%2580%2F%3Ff%3D1%26grp%3Dproduct&amp;m=https%3A%2F%2Fsearch.rakuten.co.jp%2Fsearch%2Fmall%2Fswift%2B%25E5%25AE%259F%25E8%25B7%25B5%25E5%2585%25A5%25E9%2596%2580%2F%3Ff%3D1%26grp%3Dproduct\" rel=\"nofollow\" class=\"yyi-rinker-link yyi-rinker-tracking\" data-click-tracking=\"rakuten 180 \uff3b\u5897\u88dc\u6539\u8a02\u7b2c3\u7248\uff3dSwift\u5b9f\u8df5\u5165\u9580 \u2500\u2500 \u76f4\u611f\u7684\u306a\u6587\u6cd5\u3068\u5b89\u5168\u6027\u3092\u517c\u306d\u5099\u3048\u305f\u8a00\u8a9e WEB+DB PRESS plus\" data-vars-amp-click-id=\"rakuten 180 \uff3b\u5897\u88dc\u6539\u8a02\u7b2c3\u7248\uff3dSwift\u5b9f\u8df5\u5165\u9580 \u2500\u2500 \u76f4\u611f\u7684\u306a\u6587\u6cd5\u3068\u5b89\u5168\u6027\u3092\u517c\u306d\u5099\u3048\u305f\u8a00\u8a9e WEB+DB PRESS plus\">\u697d\u5929\u5e02\u5834<\/a>\t\t\t\t\t<\/li>\n<li class=\"yahoolink\">\n\t\t\t\t\t\t<a href=\"https:\/\/shopping.yahoo.co.jp\/search?p=swift+%E5%AE%9F%E8%B7%B5%E5%85%A5%E9%96%80\" rel=\"nofollow\" class=\"yyi-rinker-link yyi-rinker-tracking\" data-click-tracking=\"yahoo 180 \uff3b\u5897\u88dc\u6539\u8a02\u7b2c3\u7248\uff3dSwift\u5b9f\u8df5\u5165\u9580 \u2500\u2500 \u76f4\u611f\u7684\u306a\u6587\u6cd5\u3068\u5b89\u5168\u6027\u3092\u517c\u306d\u5099\u3048\u305f\u8a00\u8a9e WEB+DB PRESS plus\" data-vars-amp-click-id=\"yahoo 180 \uff3b\u5897\u88dc\u6539\u8a02\u7b2c3\u7248\uff3dSwift\u5b9f\u8df5\u5165\u9580 \u2500\u2500 \u76f4\u611f\u7684\u306a\u6587\u6cd5\u3068\u5b89\u5168\u6027\u3092\u517c\u306d\u5099\u3048\u305f\u8a00\u8a9e WEB+DB PRESS plus\">Yahoo\u30b7\u30e7\u30c3\u30d4\u30f3\u30b0<\/a>\t\t\t\t\t<\/li>\n<\/ul><\/div>\n<\/p><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u30da\u30fc\u30b8\u3067\u306f\u3001UITableView\u3092\u4f5c\u6210\u3057\u3066\u30c7\u30fc\u30bf\u3092\u8868\u793a\u3059\u308b\u307e\u3067\u306e\u57fa\u672c\u7684\u306a\u6d41\u308c\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002 ContentsTableView\u306e\u8a2d\u5b9a\u3092\u3059\u308b1. Table View\u306e\u8a2d\u7f6e2. Outlets\u306e\u8a2d\u5b9aTab &#8230; <\/p>\n","protected":false},"author":1,"featured_media":722,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,10],"tags":[],"_links":{"self":[{"href":"https:\/\/naoya-ono.com\/swift\/wp-json\/wp\/v2\/posts\/721"}],"collection":[{"href":"https:\/\/naoya-ono.com\/swift\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/naoya-ono.com\/swift\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/naoya-ono.com\/swift\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/naoya-ono.com\/swift\/wp-json\/wp\/v2\/comments?post=721"}],"version-history":[{"count":3,"href":"https:\/\/naoya-ono.com\/swift\/wp-json\/wp\/v2\/posts\/721\/revisions"}],"predecessor-version":[{"id":734,"href":"https:\/\/naoya-ono.com\/swift\/wp-json\/wp\/v2\/posts\/721\/revisions\/734"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/naoya-ono.com\/swift\/wp-json\/wp\/v2\/media\/722"}],"wp:attachment":[{"href":"https:\/\/naoya-ono.com\/swift\/wp-json\/wp\/v2\/media?parent=721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/naoya-ono.com\/swift\/wp-json\/wp\/v2\/categories?post=721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/naoya-ono.com\/swift\/wp-json\/wp\/v2\/tags?post=721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}