Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
iOS Programming Cookbook

You're reading from   iOS Programming Cookbook Over 50 exciting and powerful recipes to help you unearth the promise of iOS programming

Arrow left icon
Product type Paperback
Published in Mar 2017
Publisher Packt
ISBN-13 9781786460981
Length 520 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (16) Chapters Close

Preface 1. Swift Programming Language FREE CHAPTER 2. The Essentials 3. Integrating with Messages App 4. Working with Interface Builder 5. Working with UITableView 6. Animations and Graphics 7. Multimedia 8. Concurrency 9. Location Services 10. Security and Encryption 11. Networking 12. Persisting Data with Core Data 13. Notifications 14. App Search 15. Optimizing Performance

Embedding view controllers using container view


We will talk about something very simple in this section, but it has a high impact when working with storyboard and interface builder. In storyboard, you can create a container view, which acts as a holder or container for another view controller in your storyboard. You may ask why we need to do this when we can add the layout of this view controller just directly as a subview. The most benefit you can get out of this is when you have a view, which is reusable, in different locations in your app; you can create it in a different view controller and have it embedded whenever and wherever you want, without needing to duplicate any screen or any layout.

How to do it...

  1. Let's create a new Xcode project to see this in action. Create a new project with template Page-Based Application.

  2. Try to run the project; you will see something like this:

  3. You will see a page view controller that displays a white subview and a month title. You can navigate between...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime