title: Creating a global UIView
body: <p>I am trying to create an application with a feature similar to facebook's chat bubbles. </p>
  
  <p>When the user navigates to a certain page (InCallViewController), they can connect to another person via video chat. When they navigate out of this page after connecting, I would like the video view to stay floating on the screen, but allow them to do what ever they want to do in the app.</p>
  
  <p>In order to do this, I have made an InCallViewController class, which will allow the user to connect with the other person. Once connected, the video is displayed in a view. This view is movable (similar to facebook's chat bubbles) and displays the video chat perfectly, however when I exit the page and go to another page (AccountViewController) in the app, I am unable to keep this view on the screen. I have tried many things, including setting this view as a subview in the later pages. However when I do this, the subview is not displayed.</p>
  
  <p>MyAccountView.m</p>
  
  <pre><code>- (void)viewDidLoad
  {
  
  
      [super viewDidLoad];
  
      InCallViewController *inCallViewController = [[InCallViewController alloc] initWithNibName:@"InCallViewController" bundle:nil];
  
      [self.view addSubview:inCallViewController.previewView];
      [self.view bringSubviewToFront:inCallViewController.previewView];
  
      (Do some other set up stuff)
  
  }
  </code></pre>
  
  <p>InCallViewController.h</p>
  
  <pre><code>@interface InCallViewController : UIViewController &lt;UIAlertViewDelegate&gt; 
  {
  
      CGPoint currentTouch;
      NSArray *viewArray;
      AVAudioPlayer *audioPlayer;
  }
  
  @property (weak, nonatomic) IBOutlet UIView *previewVideoView;
  </code></pre>
  
  <p>The previewView is a UIView in the InCallViewController class. This is hooked up in the IB, and works perfectly when in the InCallController class. The problem is, it won't show up when adding it as a subview in another class. I am wondering what I am doing wrong, or if there is a better way to keep the "previewView" remaining on the screen after I exit InCallViewController.</p>
  
  <p>Thanks</p>