{"id":8785,"date":"2014-05-06T16:45:26","date_gmt":"2014-05-06T20:45:26","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=8785"},"modified":"2014-05-06T16:45:26","modified_gmt":"2014-05-06T20:45:26","slug":"stopped-using-nibs-thanks-to-auto-layout","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2014\/05\/06\/stopped-using-nibs-thanks-to-auto-layout\/","title":{"rendered":"Stopped Using NIBs Thanks to Auto Layout"},"content":{"rendered":"<p><a href=\"http:\/\/www.thecave.com\/2014\/05\/04\/i-stopped-using-nibs-thanks-to-auto-layout\/\">Kirby Turner<\/a>:<\/p>\n<blockquote cite=\"http:\/\/www.thecave.com\/2014\/05\/04\/i-stopped-using-nibs-thanks-to-auto-layout\/\"><p>Because I use Auto Layout in code I realized overtime I was using Interface Builder only to define the UI elements that made up the view. I would define all the Auto Layout constraints in code. This got me thinking, why do I need to define the UI elements in IB? So I did a small project with no NIBs or storyboards, and I loved it. I felt more productive, and I was banging my head against the wall a hell of a lot less.<\/p>\n<p>[&#8230;]<\/p>\n<p>I&rsquo;ve now done a number of iOS projects where I don&rsquo;t use a single NIB or storyboard, and I&rsquo;m convinced this is the right approach for me. I see everything regarding a view and its subviews explicitly defined in source code, which makes it easier to see what&rsquo;s going on and to make changes. No more bouncing between inspectors to figure out what is causing a problem or to understand how a view is rendered. I see it all in the source code defined in a single .m file.<\/p><\/blockquote>\n<p>Code is also much better at factoring out common sub-layouts and localized strings.<\/p>","protected":false},"excerpt":{"rendered":"<p>Kirby Turner: Because I use Auto Layout in code I realized overtime I was using Interface Builder only to define the UI elements that made up the view. I would define all the Auto Layout constraints in code. This got me thinking, why do I need to define the UI elements in IB? So I [&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,370,31,30,71],"class_list":["post-8785","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-autolayout","tag-cocoa","tag-interfacebuilder","tag-ios","tag-mac","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8785","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=8785"}],"version-history":[{"count":0,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8785\/revisions"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=8785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=8785"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=8785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}