<story><title>Apple starts rejecting apps that use UIWebBrowserView</title><url>https://forum.ionicframework.com/t/ios-application-rejected-with-reason-non-public-apis/46717</url></story><parent_chain><item><author>soperj</author><text>That sounds really screwed up. You can access private methods?</text></item><item><author>masklinn</author><text>Yeah the view in question is a private[0] sub-sub view of UIWebView (UIWebView &amp;gt; UIScrollView &amp;gt; UIWebBrowserView) which does the actual rendering&lt;p&gt;[0] there is no direct access to it, though because of Cocoa&amp;#x27;s architecture you can access it by iterating the scrollview&amp;#x27;s subviews and look for one with the expected class name</text></item><item><author>Sephiroth87</author><text>Just to be clear, UIWebBrowserView is a private class, not the public UIWebView people should use, so it&amp;#x27;s not like Apple started rejecting random apps for no good reasons...</text></item></parent_chain><comment><author>masklinn</author><text>You can do so in most languages as long as they&amp;#x27;re dynamically typed or have a reflection API, and Objective-C is dynamically typed.&lt;p&gt;But in this case private methods aren&amp;#x27;t exactly involved, the code traverses the views (widgets) hierarchy (which is necessarily public) until it finds an object of a specific class (which comes from a private framework), then it replaces one of the methods to get the behaviour it wants (it actually replaces the class of the object with a subclass overriding that specific method, something many if not most dynamically typed languages allow for, which is way overkill, usually you&amp;#x27;d just swap the method — that&amp;#x27;s called &amp;quot;swizzling&amp;quot; in the objective-c world)</text></comment>
<story><title>Apple starts rejecting apps that use UIWebBrowserView</title><url>https://forum.ionicframework.com/t/ios-application-rejected-with-reason-non-public-apis/46717</url></story><parent_chain><item><author>soperj</author><text>That sounds really screwed up. You can access private methods?</text></item><item><author>masklinn</author><text>Yeah the view in question is a private[0] sub-sub view of UIWebView (UIWebView &amp;gt; UIScrollView &amp;gt; UIWebBrowserView) which does the actual rendering&lt;p&gt;[0] there is no direct access to it, though because of Cocoa&amp;#x27;s architecture you can access it by iterating the scrollview&amp;#x27;s subviews and look for one with the expected class name</text></item><item><author>Sephiroth87</author><text>Just to be clear, UIWebBrowserView is a private class, not the public UIWebView people should use, so it&amp;#x27;s not like Apple started rejecting random apps for no good reasons...</text></item></parent_chain><comment><author>gurkendoktor</author><text>Yes, which is useful because it lets us work around bugs in Apple&amp;#x27;s own frameworks. (There is a trend with Swift to make everything more safe and enterprisey, as in JVM languages, though.)&lt;p&gt;But this isn&amp;#x27;t about calling private methods, it&amp;#x27;s about navigating the view hierarchy, which is possible in every GUI framework I&amp;#x27;ve used so far.</text></comment>