{"id":17848,"date":"2017-05-01T14:56:43","date_gmt":"2017-05-01T18:56:43","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=17848"},"modified":"2017-05-01T14:57:28","modified_gmt":"2017-05-01T18:57:28","slug":"life-without-interface-builder","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2017\/05\/01\/life-without-interface-builder\/","title":{"rendered":"Life Without Interface Builder"},"content":{"rendered":"<p><a href=\"https:\/\/blog.zeplin.io\/life-without-interface-builder-adbb009d2068\">Zeplin<\/a> (via <a href=\"https:\/\/andybargh.com\/newsletter-issue-80\/\">Andy Bargh<\/a>):<\/p>\n<blockquote cite=\"https:\/\/blog.zeplin.io\/life-without-interface-builder-adbb009d2068\"><p>Interestingly enough, we started thinking about dropping Interface Builder only after we&rsquo;ve started using Swift.<\/p><p>[&#8230;]<\/p><p>Using Swift with Interface Builder brings many optionals to the table and they don&rsquo;t belong in a type-safe domain. I&rsquo;m not just talking about outlets either, if you are using Storyboards with segues, your <em>data model properties also become optionals<\/em>. This is where things get out of hand. Properties that are required for your view controller to work properly are now optionals and you start writing <code>guard<\/code>s everywhere, confused about where to handle them gracefully and where to simply <code>fatalError<\/code> your way out. This is quite error prone and decreases readability drastically.<\/p><p>[&#8230;]<\/p><p>Writing layout code in Objective-C isn&rsquo;t too bad, but with Swift it&rsquo;s gotten a lot easier and most importantly, more readable. Declaring Auto Layout constraints is painless and beautiful, thanks to libraries like <a href=\"https:\/\/github.com\/robb\/Cartography\">Cartography<\/a>.<\/p><p>[&#8230;]<\/p><p>Storyboards are the future, according to Apple. Since Xcode 8.3, we don&rsquo;t even get a checkbox to disable Storyboards when creating a project! &#x1F605; Yet it&rsquo;s quite heartbreaking that <em>there&rsquo;s no straightforward way to reuse a view you build on Interface Builder<\/em>.<\/p><\/blockquote>\n<p>Previously: <a href=\"https:\/\/mjtsai.com\/blog\/2017\/03\/14\/eject-from-interface-builder\/\">Eject from Interface Builder<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Zeplin (via Andy Bargh): Interestingly enough, we started thinking about dropping Interface Builder only after we&rsquo;ve started using Swift.[&#8230;]Using Swift with Interface Builder brings many optionals to the table and they don&rsquo;t belong in a type-safe domain. I&rsquo;m not just talking about outlets either, if you are using Storyboards with segues, your data model properties [&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,370,31,1380,30,32,1381,71,901,226],"class_list":["post-17848","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-autolayout","tag-interfacebuilder","tag-ios","tag-ios-10","tag-mac","tag-macapp","tag-macos-10-12","tag-programming","tag-swift-programming-language","tag-xcode"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/17848","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=17848"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/17848\/revisions"}],"predecessor-version":[{"id":17849,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/17848\/revisions\/17849"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=17848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=17848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=17848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}