{"id":2493,"date":"2019-03-02T16:08:44","date_gmt":"2019-03-02T16:08:44","guid":{"rendered":"https:\/\/new-blog.alexlamond.co.uk\/?p=2493"},"modified":"2020-06-07T12:44:36","modified_gmt":"2020-06-07T11:44:36","slug":"code-tips-working-with-uitableviews-in-swift-4","status":"publish","type":"post","link":"https:\/\/blog.alexlamond.co.uk\/?p=2493","title":{"rendered":"Code Tips &#8211; Working With UITableViews in Swift 4"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><p>In the past few months I\u2019ve been teaching myself how to code in Swift, a derivative of C++ After comparing my app to many other examples I dived into learning about UITableView\u2019s and UITableViewCells. I got a massive headache. Every website I went on gave me different ways of doing it, some more complex than the other but I\u2019m here to help, here\u2019s my guide to getting started with UITableViews in Swift 4.<\/p>\n\n\n\n<p>First, add a \u2018Table View Controller\u2019 to your storyboard, if it is going to be your main view ensure you tick \u2018Is Initial View Controller\u2019. Next, there are two methods we can use but I\u2019m going to show you the more complex one as it is the one your more likely to use. Next we need a new file, so File -> New -> Swift File and name it cells.<\/p>\n\n\n\n<p>Delete the contents of the file and change it to<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"swift\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import UIKit\n\nclass myFirstCell: UITableViewCell\n{\n}<\/pre>\n\n\n\n<p>This<a href='https:\/\/index.co\/company\/this' data-index='' target='_blank' class='idc-hasIcon'><\/a> defines the class myFirstCell as a UITableViewCell \u2013 Pretty self explanatory. Next we need to return to the storyboard and set the class of the \u2018UITableViewCell\u2019 to \u2018myFirstCell\u2019 This lets the system know that we\u2019ll be using a custom cell that has its properties defined in the class \u2018myFirstCell\u2019<\/p>\n\n\n\n<p>Head to the attributes inspector and ensure the identifier is set to \u2018cell\u2019. Before we go any further, let\u2019s add some content to our cell. We\u2019re going to have a users image, name, email address and contact number so lets design it. Next we need to connect it to our myFirstCell class. Open the assistant editor with our cells file on one side and the storyboard on the other. Now hold control and drag a label to the cells file and give it a name. By the end we should have four @IBOutlet connections in our cells file.<\/p>\n\n\n\n<p>If we compile the app now nothing will happen because we haven\u2019t set the UITableView up. Head to your ViewController file and add a new class named myFirstTableView and set the Table View in the Storyboard\u2019s class to myFirstTableView<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"swift\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class myFirstTableView: UITableViewController \n{\n\n  override func viewDidLoad() {        \n     super.viewDidLoad()       \n  }  \n\n  override func didReceiveMemoryWarning() {\n     super.didReceiveMemoryWarning()       \n  }\n}<\/pre>\n\n\n\n<p>Next, we\u2019re going to set the loading of data up. There are two essential methods for a Table View to work. They are \u2018numberOfRowsInSection\u2019 and \u2018cellForRowAt\u2019 which we define as follows<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"swift\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { }\n\noverride func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { }<\/pre>\n\n\n\n<p>Doing this will generate errors that we\u2019re not returning anything. To being with lets add \u2018return 1\u2019 to our \u2018numberOfRowsInSection\u2019 method. In the \u2018cellForRowAt\u2019 method we\u2019re going to add the following<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"swift\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">let cell = tableView.dequeueReusableCell(withIdentifier: \"cell\") as! myFirstCell\ncell.name.text = \"My First Contact\"\nreturn cell<\/pre>\n\n\n\n<p>What happens if we run this now?<\/p>\n\n\n\n<p>We can see a tiny bit of data but where is the rest of it? This is a common issue with custom cells. Return to your Storyboard and set the constraints, this is a more complex way to do it but this ensures no issues when we run the app.<\/p>\n\n\n\n<p>Success! But we wan\u2019t more contacts\u2026 So let\u2019s expand and add two arrays to just below our class declaration.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"swift\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">let names = [\"Bob\", \"John\", \"Mick\", \"Steve\"]\nlet numbers = [\"070000000\", \"+447043532423\", \"+11325432432\", \"012324213112\"]\nlet email = [\"hello@alexlamond.co.uk\", \"john@alexlamond.co.uk\", \"mick@alexlamond.co.uk\", \"noreply@alexlamond.co.uk\"]<\/pre>\n\n\n\n<p>Replace the \u2018return 1\u2019 in \u2018numberOfRowsInSection\u2019 to names.count and change the \u2018cellForRowAt\u2019 code to<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"swift\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">let cell = tableView.dequeueReusableCell(withIdentifier: \"cell\") as! myFirstCell \n\ncell.name.text = names[indexPath.row]\ncell.phone.text = numbers[indexPath.row]\ncell.email.text = email[indexPath.row]\ncell.userImage.image = #imageLiteral(resourceName: \"icons8-user_male_circle_filled.png\")\n\nreturn cell<\/pre>\n\n\n\n<p>Now run the app and see your results. You can expand on this so much, you can add functions that get data from the web and show it in the table or add styles to cells based on data. Let\u2019s add an extra array named favourite<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"swift\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">let favourite = [true, true, false, true]<\/pre>\n\n\n\n<p>Now in our \u2018cellForRowAt\u2019 method, we\u2019ll add a check<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"swift\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">if favourite[indexPath.row] == true {          \n   cell.backgroundColor = .orange      \n} else {           \n   \/\/Always provide a default value to the cell as not doing this could cause incorrect cells to display as favourites           \n   cell.backgroundColor = .white       \n}<\/pre>\n\n\n\n<p>Voila.<\/p>\n<\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>In the past few months I\u2019ve been teaching myself how to code in Swift, a derivative of C++ After comparing my app to many other &hellip;<\/p>\n","protected":false},"author":1,"featured_media":2757,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"advgb_blocks_editor_width":"","advgb_blocks_columns_visual_guide":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"fifu_image_url":"","fifu_image_alt":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[384,6],"tags":[85,411,401,410,373,409],"series":[],"ppma_author":[554],"class_list":["post-2493","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code-tips","category-technology","tag-code","tag-swift","tag-tips","tag-uitableviews","tag-with","tag-working"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Code Tips - Working With UITableViews in Swift 4 - Alex Lamond<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.alexlamond.co.uk\/?p=2493\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Code Tips - Working With UITableViews in Swift 4 - Alex Lamond\" \/>\n<meta property=\"og:description\" content=\"In the past few months I\u2019ve been teaching myself how to code in Swift, a derivative of C++ After comparing my app to many other &hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.alexlamond.co.uk\/?p=2493\" \/>\n<meta property=\"og:site_name\" content=\"Alex Lamond\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-02T16:08:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-06-07T11:44:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.alexlamond.co.uk\/wp-content\/uploads\/2019\/03\/9dc8a70f47b5cd2a17533488e2a747a670054ce0.png\" \/>\n\t<meta property=\"og:image:width\" content=\"680\" \/>\n\t<meta property=\"og:image:height\" content=\"355\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Alex\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@alexlamond1\" \/>\n<meta name=\"twitter:site\" content=\"@alexlamond1\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alex\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/?p=2493#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/?p=2493\"},\"author\":{\"name\":\"Alex\",\"@id\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/#\\\/schema\\\/person\\\/839b5037a05f80a290472f31b1bf38f3\"},\"headline\":\"Code Tips &#8211; Working With UITableViews in Swift 4\",\"datePublished\":\"2019-03-02T16:08:44+00:00\",\"dateModified\":\"2020-06-07T11:44:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/?p=2493\"},\"wordCount\":573,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/#\\\/schema\\\/person\\\/839b5037a05f80a290472f31b1bf38f3\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/?p=2493#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/9dc8a70f47b5cd2a17533488e2a747a670054ce0.png\",\"keywords\":[\"Code\",\"swift\",\"tips:\",\"uitableviews\",\"with\",\"working\"],\"articleSection\":[\"Code Tips\",\"Technology\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blog.alexlamond.co.uk\\\/?p=2493#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/?p=2493\",\"url\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/?p=2493\",\"name\":\"Code Tips - Working With UITableViews in Swift 4 - Alex Lamond\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/?p=2493#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/?p=2493#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/9dc8a70f47b5cd2a17533488e2a747a670054ce0.png\",\"datePublished\":\"2019-03-02T16:08:44+00:00\",\"dateModified\":\"2020-06-07T11:44:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/?p=2493#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.alexlamond.co.uk\\\/?p=2493\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/?p=2493#primaryimage\",\"url\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/9dc8a70f47b5cd2a17533488e2a747a670054ce0.png\",\"contentUrl\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/9dc8a70f47b5cd2a17533488e2a747a670054ce0.png\",\"width\":680,\"height\":355},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/?p=2493#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Code Tips &#8211; Working With UITableViews in Swift 4\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/#website\",\"url\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/\",\"name\":\"Alex Lamond\",\"description\":\"Technology &amp; Ramblings.\",\"publisher\":{\"@id\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/#\\\/schema\\\/person\\\/839b5037a05f80a290472f31b1bf38f3\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/#\\\/schema\\\/person\\\/839b5037a05f80a290472f31b1bf38f3\",\"name\":\"Alex\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cb2053fb9839b65ee37e9cadf3ee3f24bcd4d092bf1cadc53f662e8bf380caff?s=96&d=mm&r=gf1801ec1f25976613908cbcb2a8d3e71\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cb2053fb9839b65ee37e9cadf3ee3f24bcd4d092bf1cadc53f662e8bf380caff?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cb2053fb9839b65ee37e9cadf3ee3f24bcd4d092bf1cadc53f662e8bf380caff?s=96&d=mm&r=g\",\"caption\":\"Alex\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cb2053fb9839b65ee37e9cadf3ee3f24bcd4d092bf1cadc53f662e8bf380caff?s=96&d=mm&r=gf1801ec1f25976613908cbcb2a8d3e71\"},\"sameAs\":[\"https:\\\/\\\/alexlamond.co.uk\",\"https:\\\/\\\/x.com\\\/alexlamond1\"],\"url\":\"https:\\\/\\\/blog.alexlamond.co.uk\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Code Tips - Working With UITableViews in Swift 4 - Alex Lamond","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.alexlamond.co.uk\/?p=2493","og_locale":"en_GB","og_type":"article","og_title":"Code Tips - Working With UITableViews in Swift 4 - Alex Lamond","og_description":"In the past few months I\u2019ve been teaching myself how to code in Swift, a derivative of C++ After comparing my app to many other &hellip;","og_url":"https:\/\/blog.alexlamond.co.uk\/?p=2493","og_site_name":"Alex Lamond","article_published_time":"2019-03-02T16:08:44+00:00","article_modified_time":"2020-06-07T11:44:36+00:00","og_image":[{"width":680,"height":355,"url":"https:\/\/blog.alexlamond.co.uk\/wp-content\/uploads\/2019\/03\/9dc8a70f47b5cd2a17533488e2a747a670054ce0.png","type":"image\/png"}],"author":"Alex","twitter_card":"summary_large_image","twitter_creator":"@alexlamond1","twitter_site":"@alexlamond1","twitter_misc":{"Written by":"Alex","Estimated reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.alexlamond.co.uk\/?p=2493#article","isPartOf":{"@id":"https:\/\/blog.alexlamond.co.uk\/?p=2493"},"author":{"name":"Alex","@id":"https:\/\/blog.alexlamond.co.uk\/#\/schema\/person\/839b5037a05f80a290472f31b1bf38f3"},"headline":"Code Tips &#8211; Working With UITableViews in Swift 4","datePublished":"2019-03-02T16:08:44+00:00","dateModified":"2020-06-07T11:44:36+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.alexlamond.co.uk\/?p=2493"},"wordCount":573,"commentCount":0,"publisher":{"@id":"https:\/\/blog.alexlamond.co.uk\/#\/schema\/person\/839b5037a05f80a290472f31b1bf38f3"},"image":{"@id":"https:\/\/blog.alexlamond.co.uk\/?p=2493#primaryimage"},"thumbnailUrl":"https:\/\/blog.alexlamond.co.uk\/wp-content\/uploads\/2019\/03\/9dc8a70f47b5cd2a17533488e2a747a670054ce0.png","keywords":["Code","swift","tips:","uitableviews","with","working"],"articleSection":["Code Tips","Technology"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.alexlamond.co.uk\/?p=2493#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.alexlamond.co.uk\/?p=2493","url":"https:\/\/blog.alexlamond.co.uk\/?p=2493","name":"Code Tips - Working With UITableViews in Swift 4 - Alex Lamond","isPartOf":{"@id":"https:\/\/blog.alexlamond.co.uk\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.alexlamond.co.uk\/?p=2493#primaryimage"},"image":{"@id":"https:\/\/blog.alexlamond.co.uk\/?p=2493#primaryimage"},"thumbnailUrl":"https:\/\/blog.alexlamond.co.uk\/wp-content\/uploads\/2019\/03\/9dc8a70f47b5cd2a17533488e2a747a670054ce0.png","datePublished":"2019-03-02T16:08:44+00:00","dateModified":"2020-06-07T11:44:36+00:00","breadcrumb":{"@id":"https:\/\/blog.alexlamond.co.uk\/?p=2493#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.alexlamond.co.uk\/?p=2493"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/blog.alexlamond.co.uk\/?p=2493#primaryimage","url":"https:\/\/blog.alexlamond.co.uk\/wp-content\/uploads\/2019\/03\/9dc8a70f47b5cd2a17533488e2a747a670054ce0.png","contentUrl":"https:\/\/blog.alexlamond.co.uk\/wp-content\/uploads\/2019\/03\/9dc8a70f47b5cd2a17533488e2a747a670054ce0.png","width":680,"height":355},{"@type":"BreadcrumbList","@id":"https:\/\/blog.alexlamond.co.uk\/?p=2493#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.alexlamond.co.uk\/"},{"@type":"ListItem","position":2,"name":"Code Tips &#8211; Working With UITableViews in Swift 4"}]},{"@type":"WebSite","@id":"https:\/\/blog.alexlamond.co.uk\/#website","url":"https:\/\/blog.alexlamond.co.uk\/","name":"Alex Lamond","description":"Technology &amp; Ramblings.","publisher":{"@id":"https:\/\/blog.alexlamond.co.uk\/#\/schema\/person\/839b5037a05f80a290472f31b1bf38f3"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.alexlamond.co.uk\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/blog.alexlamond.co.uk\/#\/schema\/person\/839b5037a05f80a290472f31b1bf38f3","name":"Alex","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/cb2053fb9839b65ee37e9cadf3ee3f24bcd4d092bf1cadc53f662e8bf380caff?s=96&d=mm&r=gf1801ec1f25976613908cbcb2a8d3e71","url":"https:\/\/secure.gravatar.com\/avatar\/cb2053fb9839b65ee37e9cadf3ee3f24bcd4d092bf1cadc53f662e8bf380caff?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cb2053fb9839b65ee37e9cadf3ee3f24bcd4d092bf1cadc53f662e8bf380caff?s=96&d=mm&r=g","caption":"Alex"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/cb2053fb9839b65ee37e9cadf3ee3f24bcd4d092bf1cadc53f662e8bf380caff?s=96&d=mm&r=gf1801ec1f25976613908cbcb2a8d3e71"},"sameAs":["https:\/\/alexlamond.co.uk","https:\/\/x.com\/alexlamond1"],"url":"https:\/\/blog.alexlamond.co.uk\/?author=1"}]}},"author_meta":{"display_name":"Alex","author_link":"https:\/\/blog.alexlamond.co.uk\/?author=1"},"featured_img":"https:\/\/blog.alexlamond.co.uk\/wp-content\/uploads\/2019\/03\/9dc8a70f47b5cd2a17533488e2a747a670054ce0-300x157.png","jetpack_featured_media_url":"https:\/\/blog.alexlamond.co.uk\/wp-content\/uploads\/2019\/03\/9dc8a70f47b5cd2a17533488e2a747a670054ce0.png","coauthors":[{"link":"https:\/\/blog.alexlamond.co.uk\/?author=1","display_name":"Alex"}],"tax_additional":{"categories":{"linked":["<a href=\"https:\/\/blog.alexlamond.co.uk\/?cat=384\" class=\"advgb-post-tax-term\">Code Tips<\/a>","<a href=\"https:\/\/blog.alexlamond.co.uk\/?cat=6\" class=\"advgb-post-tax-term\">Technology<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">Code Tips<\/span>","<span class=\"advgb-post-tax-term\">Technology<\/span>"]},"tags":{"linked":["<a href=\"https:\/\/blog.alexlamond.co.uk\/?cat=6\" class=\"advgb-post-tax-term\">Code<\/a>","<a href=\"https:\/\/blog.alexlamond.co.uk\/?cat=6\" class=\"advgb-post-tax-term\">swift<\/a>","<a href=\"https:\/\/blog.alexlamond.co.uk\/?cat=6\" class=\"advgb-post-tax-term\">tips:<\/a>","<a href=\"https:\/\/blog.alexlamond.co.uk\/?cat=6\" class=\"advgb-post-tax-term\">uitableviews<\/a>","<a href=\"https:\/\/blog.alexlamond.co.uk\/?cat=6\" class=\"advgb-post-tax-term\">with<\/a>","<a href=\"https:\/\/blog.alexlamond.co.uk\/?cat=6\" class=\"advgb-post-tax-term\">working<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">Code<\/span>","<span class=\"advgb-post-tax-term\">swift<\/span>","<span class=\"advgb-post-tax-term\">tips:<\/span>","<span class=\"advgb-post-tax-term\">uitableviews<\/span>","<span class=\"advgb-post-tax-term\">with<\/span>","<span class=\"advgb-post-tax-term\">working<\/span>"]}},"comment_count":"0","relative_dates":{"created":"Posted 7 years ago","modified":"Updated 6 years ago"},"absolute_dates":{"created":"Posted on 2nd March 2019","modified":"Updated on 7th June 2020"},"absolute_dates_time":{"created":"Posted on 2nd March 2019 4:08 pm","modified":"Updated on 7th June 2020 12:44 pm"},"featured_img_caption":"","series_order":null,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pgAAHS-Ed","jetpack_likes_enabled":false,"authors":[{"term_id":554,"user_id":1,"is_guest":0,"slug":"alex","display_name":"Alex","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/cb2053fb9839b65ee37e9cadf3ee3f24bcd4d092bf1cadc53f662e8bf380caff?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/blog.alexlamond.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2493","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.alexlamond.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.alexlamond.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.alexlamond.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.alexlamond.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2493"}],"version-history":[{"count":8,"href":"https:\/\/blog.alexlamond.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2493\/revisions"}],"predecessor-version":[{"id":2766,"href":"https:\/\/blog.alexlamond.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2493\/revisions\/2766"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.alexlamond.co.uk\/index.php?rest_route=\/wp\/v2\/media\/2757"}],"wp:attachment":[{"href":"https:\/\/blog.alexlamond.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.alexlamond.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2493"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.alexlamond.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2493"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/blog.alexlamond.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fseries&post=2493"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blog.alexlamond.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fppma_author&post=2493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}