3

I have a view controller (News View Controller in the image) and it loads a iCarousel with dynamic subviews, it works fine, but the problem is that i want to perform a segue when the user press a button, but the view loaded in the modal segue is showed only in the square of the subview, it must be at the top of all (like facebook app when the user taps an image an it popup a view at the top of all).

Maybe i must do the Segue in the News View Controller and not in the subview (News item View Controller) ?

Example

** UPDATE **

I tried using:

[self.navigationController performSegueWithIdentifier:@"PhotoView" sender:self];

And it doesn't nothing, also i trie:

[self performSegueWithIdentifier:@"PhotoView" sender:self];

And it display something like this:

enter image description here

The buttons displayed are the ones who control the Custom UITabBarController. When i slide in the view the iCarousel still there, so it show the next SubView of the iCarousel:

enter image description here

The idea is this segue must be at the top of everything like this:

enter image description here

In the subviews managed by iCarousel are all the buttons to interact to Storyboards segues so i need a way to do this.

** SOLUTION **

Making the NewsViewController the delegate of the iCarousel view controllers i can do the segue like i spect in the NewsViewController and not in the subview of NewsItem, a complete explanation of how i did this is in this answer of StackOverflow so THANKS for trying to help me.

Community
  • 1
  • 1
FxckDead
  • 408
  • 6
  • 16

2 Answers2

1

** Updated **

Here my answer is not the best solution to the question. It's just my way to solve it.

Segue is used as the transition between two view controllers. So it should be full screen change. If you want to do some not full screen change and still want to use the segue. I suggest to use container view.

But when using container view the subview controller is loaded when the root view controller's viewDidLoad method is triggered. So here we can only get one subview controller. That is to say we should try to reuse it.

Original

In my past project I used the container view. enter image description here

sunkehappy
  • 8,970
  • 5
  • 44
  • 65
  • But what does the Container View in that case ? i must do a Segue, can you detail your answer please? @sunkehappy – FxckDead Jun 11 '13 at 22:16
  • @FxckDead you can just drag from your container view to your `subview`. Then you can get a `ViewDidLoad/embed`. Just select that `embed`. And that `subview` is actually a `ViewController`. – sunkehappy Jun 12 '13 at 03:43
  • if found a solution @sunkehappy so thanks, see my update to know that its the solution – FxckDead Jun 14 '13 at 21:45
0

There is no need for a container view here. You also do not need to call perfromSegue to accomplish what you want. This is only required when triggering a segue which cannot by set up in IB.

Did you create this segue by dragging a connection from the buttons action node under Triggered Segues to your modal vc and selecting the modal type? I.e. Right click the button, locate the action node and left-click drag the connection to your vc. Then select "modal". This is all that should be required.

Also check that the modal view controller's Transition Style and Presentation are what you expect (i.e. Full Screen). You can set them in the right-hand properties panel while the controller is selected.

  • i try what you say setting the ViewController to "Wants Full Screen" but it still showing the Tab buttons – FxckDead Jun 14 '13 at 19:28
  • if found a solution @chris so thanks, see my update to know that its the solution – FxckDead Jun 14 '13 at 21:46
  • Perhaps I am misunderstanding the problem but it seems like an overcomplicated solution to me. Either way, glad you found a solution @FxckDead. – Chris Heyes Jun 16 '13 at 11:27