{"id":13312,"date":"2016-01-20T16:56:34","date_gmt":"2016-01-20T21:56:34","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=13312"},"modified":"2016-01-20T16:56:34","modified_gmt":"2016-01-20T21:56:34","slug":"swift-named-parameters","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2016\/01\/20\/swift-named-parameters\/","title":{"rendered":"Swift Named Parameters"},"content":{"rendered":"<p><a href=\"http:\/\/useyourloaf.com\/blog\/swift-named-parameters.html\">Keith Harrison<\/a>:<\/p>\n<blockquote cite=\"http:\/\/useyourloaf.com\/blog\/swift-named-parameters.html\">\n<p>The rules for naming parameters in Swift functions and methods have changed for the better over the last few releases but still seem to cause confusion. Here is my quick summary updated for Swift 2.1.<\/p>\n<\/blockquote>\n\n<p>Coming from Objective-C, I still think it feels a bit weird that the declaration and call site don&rsquo;t match. In Swift declarations, we have external-space-internal-colon-type, whereas at the call site we have external-colon-value. In Objective-C, we have external-colon-(optional type)internal and external-colon-value, which makes sense because the value goes into the internal name. In Objective-C, the external name is always followed by a colon. In Swift, the external name is sometimes followed by a space and sometimes by a colon, and the colon is also used to specify the type. It&rsquo;s a thorny problem because there is precedent in other languages for both uses of the colon.<\/p>","protected":false},"excerpt":{"rendered":"<p>Keith Harrison: The rules for naming parameters in Swift functions and methods have changed for the better over the last few releases but still seem to cause confusion. Here is my quick summary updated for Swift 2.1. Coming from Objective-C, I still think it feels a bit weird that the declaration and call site don&rsquo;t [&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,54,71,901],"class_list":["post-13312","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-languagedesign","tag-objective-c","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/13312","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=13312"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/13312\/revisions"}],"predecessor-version":[{"id":13313,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/13312\/revisions\/13313"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=13312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=13312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=13312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}