0

Basically I have a view that I make a subview of a separate view that I am using as a container the first view however won't go in front of its parent. On the storyboard is shows the child view in front of its parent however on the simulator it is behind.

EDIT - Sorry for the lack of detail let me clarify a bit

This is my XIB I named it SectionCard very basic only containing a single view with a black background enter image description here This is my storyboard all I have done is change the background to red I have added my SectionCard (which I set to clear color) and a basic view as the child of my section card I have set the color of which to pink

enter image description here So I thought when I run it I would get my red background a black rectangle with a smaller pink rectangle inside it however for some reason I get this-

enter image description here Initially I thought that the pink rectangle view was simply invisible however after commenting the view.frame = self.bounds line and shrinking the SectionCard in the XIB file I noticed that the SectionCard was actually covering up the pink view

enter image description here Hopefully this helped explain my issue in more depth any help is appreciated!!!

XvKnightvX
  • 579
  • 7
  • 23
  • I'm afraid we need more details to understand the question – SwiftArchitect Jan 07 '17 at 01:56
  • Shot in the dark here because we need more info but try this: Click on the container in your storyboard, then click on the icon of a triangle in the bottom right corner and click "Reset To Suggested Constraints". See if that does anything – BigSpicyPotato Jan 07 '17 at 02:01
  • @SwiftArchitect I just edited the post going into more detail of the issue hope that helps – XvKnightvX Jan 08 '17 at 21:26

1 Answers1

0

Forcefully bring the view in front like below:

[outerView.view bringSubviewToFront: interview.view]

dahiya_boy
  • 9,298
  • 1
  • 30
  • 51