0
 override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        let memeShowViewController = self.storyboard!.instantiateViewControllerWithIdentifier("ShowMeme") as! MemeShowViewController
        memeShowViewController.memeImage = appDelegate.memes[indexPath.row].memeImage
        self.navigationController!.presentViewController(memeShowViewController, animated: true, completion: nil)
    }

So I have a tableview that has a nav controller embedded in it and when I present the memeShowViewController modally I was wondering why the view of the memeShowViewController has a black background color when I didn't change it to be black.

In storyboard:

enter image description here

In simulator

enter image description here

Right now I'm just adding a navigation bar to the segue-ed view controller, I was wondering if there is a better way to do as the only functionality I need from the navigation bar is for the done button to segue back to the tableView.

YellowPillow
  • 4,100
  • 6
  • 31
  • 57

1 Answers1

0

The background window has a black background so if your app doesn't cover any part of the window (or alpha = 0) you'll see that black background.

Islam
  • 3,654
  • 3
  • 30
  • 40
  • But doesn't the view cover the whole window? – YellowPillow Nov 29 '15 at 07:04
  • It's supposed to, can you put a break point on `viewDidAppear` and check the frame? – Islam Nov 29 '15 at 11:02
  • Yeah I checked and it does, although I fixed it by wrapping my view controller in a navigation controller – YellowPillow Nov 29 '15 at 11:11
  • So the issue is fixed now? – Islam Nov 29 '15 at 11:12
  • Well now I can't add a "done" button to segue back to my original view controller so I guess not really. I'm trying to use code to do it but I don't know how to segue back to the original view controller using code. I've created the button and it shows but I don't know how to write the function to go back – YellowPillow Nov 29 '15 at 11:13
  • 1
    Here's how it's in the code: `self.dismissViewControllerAnimated(true, completion: {});` ([original link](http://stackoverflow.com/a/24669141/2177402)) – Islam Nov 29 '15 at 11:20
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/96463/discussion-between-yellowpillow-and-islam-q). – YellowPillow Nov 29 '15 at 11:29