{"id":8427,"date":"2014-02-07T17:04:12","date_gmt":"2014-02-07T22:04:12","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=8427"},"modified":"2014-02-07T17:04:12","modified_gmt":"2014-02-07T22:04:12","slug":"avoiding-massive-controllers","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2014\/02\/07\/avoiding-massive-controllers\/","title":{"rendered":"Avoiding Massive Controllers"},"content":{"rendered":"<p><a href=\"http:\/\/bendyworks.com\/geekville\/articles\/2014\/2\/single-responsibility-principle-ios\">Brad Grzesiak<\/a> (via <a href=\"http:\/\/www.markbernstein.org\/Feb14\/Controllers.html\">Mark Bernstein<\/a>):<\/p>\n<blockquote cite=\"http:\/\/bendyworks.com\/geekville\/articles\/2014\/2\/single-responsibility-principle-ios\"><p>Well, to be sure we&rsquo;re on the same page, allow me propose rules that must be followed in order to adhere to this heuristic:<\/p>\n<ul>\n<li>The <code>IBAction<\/code> macro must not be used in a View Controller<\/li>\n<li>The <code>@interface<\/code> block in a View Controller&rsquo;s header file must be blank.<\/li>\n<li>A View Controller may not implement any extra <code>*Delegate<\/code> or <code>*DataSource<\/code> protocols except for observing Model changes.<\/li>\n<li>A View Controller may only do work in <code>viewDidLoad<\/code> (or <code>awakeFromNib<\/code>), <code>viewDidAppear<\/code>, <code>viewDidDisappear<\/code>, and in response to an observed change in the model layer.<\/li>\n<\/ul><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Brad Grzesiak (via Mark Bernstein): Well, to be sure we&rsquo;re on the same page, allow me propose rules that must be followed in order to adhere to this heuristic: The IBAction macro must not be used in a View Controller The @interface block in a View Controller&rsquo;s header file must be blank. A View Controller [&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":[69,31,30,54,71],"class_list":["post-8427","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-cocoa","tag-ios","tag-mac","tag-objective-c","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8427","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=8427"}],"version-history":[{"count":0,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8427\/revisions"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=8427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=8427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=8427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}