{"id":10588,"date":"2015-01-24T13:25:13","date_gmt":"2015-01-24T18:25:13","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=10588"},"modified":"2015-01-24T13:25:13","modified_gmt":"2015-01-24T18:25:13","slug":"swift-capture-lists","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2015\/01\/24\/swift-capture-lists\/","title":{"rendered":"Swift Capture Lists"},"content":{"rendered":"<p><a href=\"http:\/\/www.russbishop.net\/swift-capture-lists\">Russ Bishop<\/a>:<\/p>\n<blockquote cite=\"http:\/\/www.russbishop.net\/swift-capture-lists\"><p>The <a href=\"https:\/\/developer.apple.com\/library\/ios\/documentation\/Swift\/Conceptual\/Swift_Programming_Language\/AutomaticReferenceCounting.html#\/\/apple_ref\/doc\/uid\/TP40014097-CH20-ID57\">Language Guide<\/a> claims you should use <code>unowned<\/code> if the closure and containing object reference each other and will be destroyed at the same time. Presumably that&rsquo;s to avoid the cost of safely nil&rsquo;ing out a <code>weak<\/code> reference in an object that&rsquo;s about to dealloc anyway.<\/p><p>Most people aren&rsquo;t aware that you can create new named values here as well[&#8230;]<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Russ Bishop: The Language Guide claims you should use unowned if the closure and containing object reference each other and will be destroyed at the same time. Presumably that&rsquo;s to avoid the cost of safely nil&rsquo;ing out a weak reference in an object that&rsquo;s about to dealloc anyway.Most people aren&rsquo;t aware that you can create [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[46,71,901],"class_list":["post-10588","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-languagedesign","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10588","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=10588"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10588\/revisions"}],"predecessor-version":[{"id":10589,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10588\/revisions\/10589"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=10588"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=10588"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=10588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}