{"id":18544,"date":"2017-08-03T16:27:52","date_gmt":"2017-08-03T20:27:52","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=18544"},"modified":"2017-08-03T16:27:52","modified_gmt":"2017-08-03T20:27:52","slug":"cwllayout-a-swift-wrapper-around-auto-layout","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2017\/08\/03\/cwllayout-a-swift-wrapper-around-auto-layout\/","title":{"rendered":"CwlLayout: a Swift Wrapper Around Auto Layout"},"content":{"rendered":"<p><a href=\"https:\/\/www.cocoawithlove.com\/blog\/cwllayout.html\">Matt Gallagher<\/a>:<\/p>\n<blockquote cite=\"https:\/\/www.cocoawithlove.com\/blog\/cwllayout.html\">\n<p>Much of the debate I see around Auto Layout focusses on how it&rsquo;s cumbersome to implement in code &#x2013; as opposed to Interface Builder &#x2013; but all of the 9 constraints would still need to be applied in Interface Builder to achieve this same layout and you&rsquo;d still need to understand <em>why<\/em> each of these constraints is necessary.<\/p>\n<p>[&#8230;]<\/p>\n<p>The problem is that no matter how you apply them, constraints are not layouts; constraints are building blocks from which we can <em>make<\/em> layouts but an actual layout requires starting a different way.<\/p>\n<p>[&#8230;]<\/p>\n<p>A far better solution for programming a declarative system is to use an API that itself is declarative and builds the whole system as a single composeable expression and rather than constructing individual constraints separately, understands the whole system and can automatically include constraints needed for consistency.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Matt Gallagher: Much of the debate I see around Auto Layout focusses on how it&rsquo;s cumbersome to implement in code &#x2013; as opposed to Interface Builder &#x2013; but all of the 9 constraints would still need to be applied in Interface Builder to achieve this same layout and you&rsquo;d still need to understand why each [&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":[200,69,31,1380,30,1381,74,71,901],"class_list":["post-18544","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-autolayout","tag-cocoa","tag-ios","tag-ios-10","tag-mac","tag-macos-10-12","tag-opensource","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/18544","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=18544"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/18544\/revisions"}],"predecessor-version":[{"id":18545,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/18544\/revisions\/18545"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=18544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=18544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=18544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}