Working with Static Table Views, Camera and NSLayoutConstraint
My biggest motivation? Just to keep challenging myself. I see life almost like one long University education that I never had. Every day I'm learning something new.
- Richard Branson
Up till now, the FoodPin app is only capable of displaying content. We need to find a way for users to add a new restaurant. In this chapter, we will create a new screen that displays an input form for collecting restaurant information. In the form, it will let users pick a restaurant photo from the built-in photo library. You'll learn a number of techniques:
- How to create a form using a static table view
- How to use
UIImagePickerControllerto select a photo from the built-in photo library and take photos
- How to define auto layout constraints programmatically using
In the first few chapters of the book, we have gone through the basics of table views. The table views that I covered are dynamic in nature. Usually, you create a prototype cell and populate it with dynamic content. However, table views are not limited to present dynamic content. Sometimes, you may just want to use a table view to present a form or a setting screen. In this case, a static table view is what you need. Static table views are ideal for situations where there are a pre-defined number of data items to be displayed.
Xcode allows developers to create static table views with minimal code. To illustrate how easy you can use Interface Builder to implement a static table view, we will build a new screen for adding a new restaurant.
To access the full version of the book, please get the full copy here. You will also be able to access the full source code of the project.