Exploring UIKit Internals with Hopper Disassembler

Explore private UIKit APIs using the reverse engineering tool Hopper Disassembler and then use your advanced knowledge of UIKit's hidden secrets to your advantage in your own app. By Scott Berrevoets.

Leave a rating/review
Save for later
Comments
Share

Who is this for?

This course is for experienced developers who are interested in getting a deeper understanding of how Apple's frameworks are built.

The course assumes extensive knowledge of Xcode, UIKit, and to some extent Objective-C, since that's what most Apple frameworks are written in. Being familiar with the history of iOS and what features shipped with what iOS releases is useful, though not required.

Covered concepts

  • Using Hopper to find public and private UIKit symbols.
  • Reverse engineering implementations of classes and methods in UIKit.
  • Relating stack traces in Xcode to their reverse engineered implementations.
  • Leveraging that knowledge to enhance a basic app with private UIKit functionality.

Part 1: Using Hopper Disassembler

01
Toggle description

See what happens when you try to nest navigation controllers using strictly public API by observing the assertion and associated stack trace.

Toggle description

Download and install Hopper, find the right UIKit binary in Xcode and start disassembling the binary.

Toggle description

Look at some initial symbols and get a sense for what functionality Hopper offers and how it displays pseudo code.

Part 2: Nesting Navigation Controllers

Toggle description

Take the asserting stack trace and use Hopper to understand how UIKit reached the assertion.

Discover how UIKit leverages private API to make nesting work internally.

Toggle description

Leverage basic KVC to nest navigation controllers using the same API that UIKit uses.

Toggle description

Tweak the app so UIKit is happy with your use of its APIs without really knowing what those requirements are.

Part 3: Managing Navigation Bars

Toggle description

See how hiding the navigation bar could have unintended side effects now that you're using private API.

Toggle description

Use Hopper again to understand why the wrong navigation bar is hidden and find a possible workaround.

Toggle description

Experience first hand why using private API is dangerous but how you can make UIKit still bend to your will.