Making GET Requests and SearchController

The first controller the user interacts with is the SearchController. Here, the user can enter a hexadecimal color code like #3B5998 and tap a button to see detailed information about that color. The only edge case we need to worry about is if the Colr database doesn’t contain that color; in that case, we’ll alert the user accordingly.

Setting Up the UI

How does the user enter text? We’re going reach back all the way to Making Text Dynamic with UITextField and use the venerable UITextField. We’ll use it along with a UIButton to actually trigger the search.

Let’s start setting up these elements. Open search_controllerrb and fill in viewDidLoad with our new subviews.

Get RubyMotion now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.