2

First from left.. This is home page. When i click reattempt button will open new viewcontroller which name level page (second from left)

Second from left. This is level page. It show top bar same like home page when run it.

Third from left. This is my storyboard for level page. The top bar show title and back button

Please find the below screenshot for more information.

Image

My question is why level page not show title and back button like my storyboard when i run.. ? and how to make level page show title and back button ?

I already embed in navigation controller .. Please help me..

Ramkrishna Sharma
  • 6,961
  • 3
  • 42
  • 51
MAS. John
  • 582
  • 6
  • 22
  • Have you shown this screen using Storyboard segue Or Do you have any action method to show that screen. – Dheeraj D Dec 30 '16 at 11:49
  • i used this code to call the level page.. self.navigationController?.pushViewController(controller, animated: true) – MAS. John Dec 30 '16 at 11:53
  • Have you connected Segue from Job List controller to Level Controller? – Dheeraj D Dec 30 '16 at 11:55
  • are you using xib's? have you set up your constraints properly? – dirtydanee Dec 30 '16 at 11:56
  • As i can see you are pushing your Level Controller.. on your navigation controller so that level controller is taking basic behaviour of your navigationcontroller. If you will connect a segue from joblist to level controller that it will show the same screen. (second one) – Dheeraj D Dec 30 '16 at 11:58
  • From joblist , i used that code to open level controller .. in storyboard i have storyboard entry point -> navigation controller then have relationship "root view controller to level controller" – MAS. John Dec 30 '16 at 12:00
  • inseed of pushing... try self.presentViewController(controller, animated: true) – Dheeraj D Dec 30 '16 at 12:00
  • i set up my constraints properly – MAS. John Dec 30 '16 at 12:01
  • if i used self.presentViewController(controller, animated: true) , it show nothing.. no top bar like joblist and no top bar like my storyboard – MAS. John Dec 30 '16 at 12:03
  • yes because your presenting viewcontroller is not having any navigation controller – Dheeraj D Dec 30 '16 at 12:04
  • Do these steps: Drag and drop a NavigationController in story board remove its defaulf tableviewcontroller from it. Embade you level contoller into that. Assign a identifier to your new navigation controller and instantiate that navigation controller and do self.presentViewController(navcontroller, animated: true) – Dheeraj D Dec 30 '16 at 12:06

1 Answers1

0
let navController = self.storyboard!.instantiateViewControllerWithIdentifier("YouNewNavigationControllerIdentifier") as! UINavigationController
self.presentViewController(navController, animated: true)

Hope this will work...!!

Dheeraj D
  • 4,386
  • 4
  • 20
  • 34
  • it show nothing.. no top bar like joblist and no top bar like my storyboard – MAS. John Dec 30 '16 at 12:04
  • Do these steps: Drag and drop a NavigationController in story board remove its defaulf tableviewcontroller from it. Embade you level contoller into that. Assign a storyboard identifier to your new navigation controller and instantiate that navigation controller and do self.presentViewController(navcontroller, animated: true) – – Dheeraj D Dec 30 '16 at 12:06
  • when i embad my level controller so i got two navigation controller ? one i drag , other one i embed right ? – MAS. John Dec 30 '16 at 12:18
  • Another one is tableviewcontroller... you have to delete that tableview controller only.... not navigation controller – Dheeraj D Dec 30 '16 at 12:18
  • After removing that.. drag pointer from navigation controller to your level controller and make it as a rootview controller – Dheeraj D Dec 30 '16 at 12:19
  • According to your requirement suggest you that... So that your levelview controller will not have basic behavior of your first navigation controller – Dheeraj D Dec 30 '16 at 12:22
  • See there are two things and both depends on your requirement. If you could share more about your screen transitions then i could help you more precisely. – Dheeraj D Dec 30 '16 at 12:30
  • i cant add more picture to show .. just can add one picture .. i still new in stackoverflow – MAS. John Dec 30 '16 at 12:31
  • I think you are doing something wrong... i could help you using skype... if you want – Dheeraj D Dec 30 '16 at 12:32
  • Welcome.. :) if your issue resolve so could you mark it as a answer. – Dheeraj D Dec 30 '16 at 13:33
  • owh .. sorry .. i click up arrow before this .. overlooked .. now i click right .. thank a lot man – MAS. John Dec 30 '16 at 13:37