UIPopOver Illustrations – Part 2

Using this post, I am going to discuss following topics.

  • Adding a Navigation bar in the popOver
  • Adding Bar-button Items in the PopOver-navigation bar
  • Pushing a view-controller in the PopOver
  • Poping a view-controller in the PopOver
  • Setting the size of PopOver-view-controllers while push-pop within a navigation controller.

In this post, I will use the same project which was used in my previous post for UIPopOver.

1. Download the previous-sample-code from here.

2. Open the Project.

3. Switch to ViewController.m as illustrated below.

sugartin uipopover illustration part 2 - 2

4. Now Jump to Following method & replace the code as placed below. Also go through the comments supplied to understand the code.

5. Give a try to run the project in iOS Simulator or iOS Device. Expected output is as follows.

 

sugartin uipopover illustration part 2 - 1

6. Now switch back to project & open popVCtr.m file.

sugartin uipopover illustration part 2 - 4

7. Jump to viewDidLoad Method & place following line of code to add title in UINavigationBar

 8. Give a try to run the project & Expected output is as follows.

sugartin uipopover illustration part 2 - 3

9. Now switch back to project again & open popVCtr.m file & place following line of code in viewDidLoad method to add Bar-buttons in UINavigationBar.

10. Run project on desired target & expected output is as follows.

sugartin uipopover illustration part 2 - 5

 11. Now Create a new-view-controller. Here we have created popVCtr2 as illustrated by following images.

sugartin uipopover illustration part 2 - 6sugartin uipopover illustration part 2 - 7

12. Place following line of code in popVCtr2 as given below.

 13. Now switch back to “popVCtr.m”, import PopVCtr2 & modify following line of code.

 14. Run the project on desired target & expected output is as follows.

sugartin uipopover illustration part 2 - 8

Well, I am eagerly waiting for your comments on this. Let us know your feedback.

Leave a Reply

Your email address will not be published. Required fields are marked *



*