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.
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.