{"id":17153,"date":"2017-02-09T16:49:03","date_gmt":"2017-02-09T21:49:03","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=17153"},"modified":"2017-02-09T16:49:03","modified_gmt":"2017-02-09T21:49:03","slug":"getting-to-swift-3-at-airbnb","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2017\/02\/09\/getting-to-swift-3-at-airbnb\/","title":{"rendered":"Getting to Swift 3 at Airbnb"},"content":{"rendered":"<p><a href=\"https:\/\/medium.com\/airbnb-engineering\/getting-to-swift-3-at-airbnb-79a257d2b656\">Airbnb<\/a>:<\/p>\n<blockquote cite=\"https:\/\/medium.com\/airbnb-engineering\/getting-to-swift-3-at-airbnb-79a257d2b656\">\n<p>We have dozens of modules and several 3rd-party libraries written in Swift, comprising thousands of files and hundreds of thousands of lines of code. As if the size of this Swift codebase weren&rsquo;t enough of a challenge, the fact that Swift 2 and Swift 3 modules cannot import each other further complicated the migration process. Even correct Swift 3 code that imports Swift 2 libraries will not compile. This incompatibility made it difficult to parallelize code conversion.<\/p>\n<p>[&#8230;]<\/p>\n<p>While we were excited about Swift 3&rsquo;s new language features, we also wanted to understand how the update would affect our end users and overall developer experience. We closely monitored Swift 3&rsquo;s impact on release IPA size and debug build time, since these have been our two largest Swift pain points so far. Unfortunately, after experimenting with different optimization settings, Swift 3 still scored marginally worse on both metrics.<\/p>\n<p>[&#8230;]<\/p>\n<p>A number of things have changed, but most importantly the parameter in <code>completionBlock<\/code> has changed from an implicitly unwrapped optional to an optional. This can break its usage within the blocks.<\/p>\n<p>[&#8230;]<\/p>\n<p>Optional protocol methods are easy to accidentally miss during a Swift 3 conversion.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Airbnb: We have dozens of modules and several 3rd-party libraries written in Swift, comprising thousands of files and hundreds of thousands of lines of code. As if the size of this Swift codebase weren&rsquo;t enough of a challenge, the fact that Swift 2 and Swift 3 modules cannot import each other further complicated the migration [&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":[1165,31,26,71,901],"class_list":["post-17153","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-airbnb","tag-ios","tag-iosapp","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/17153","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=17153"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/17153\/revisions"}],"predecessor-version":[{"id":17154,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/17153\/revisions\/17154"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=17153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=17153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=17153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}