{"id":4708,"date":"2014-03-30T14:49:46","date_gmt":"2014-03-30T14:49:46","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/drag-custom-view-onto-window-in-interface-builder-collection-of-common-programming-errors\/"},"modified":"2014-03-30T14:49:46","modified_gmt":"2014-03-30T14:49:46","slug":"drag-custom-view-onto-window-in-interface-builder-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/drag-custom-view-onto-window-in-interface-builder-collection-of-common-programming-errors\/","title":{"rendered":"Drag custom view onto window in Interface Builder?-Collection of common programming errors"},"content":{"rendered":"<p><strong>Interface Builder<\/strong> doesn&#8217;t add (or allow the addition of, now that IB Plugins are derelict) Custom Objects to the Object Library. You can only drag in existing\/preset objects, but you <strong>can<\/strong> have IB instantiate them as instances of a subclass as long as they are instantiated the same way.<\/p>\n<p>E.g. <strong>Drag in a custom view and set the class to<\/strong> <code>MyCustomViewClass<\/code>, <strong>or drag in a scroll view and set the class to<\/strong> <code>MyCustomScrollView<\/code>, <strong>or drag in an object and set the class to<\/strong> <code>CustomObject<\/code>, et cetera.<\/p>\n<p>And that is the preferred way of using custom controls in Interface Builder.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/eA3X8.png\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Interface Builder doesn&#8217;t add (or allow the addition of, now that IB Plugins are derelict) Custom Objects to the Object Library. You can only drag in existing\/preset objects, but you can have IB instantiate them as instances of a subclass as long as they are instantiated the same way. E.g. Drag in a custom view [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4708","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4708"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4708\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}