title: NavigationController with a UIView
body: <p>I'm training to develop an application without using any graphical interface manually. for this, I am using Quartz 2D framework. In my case I created a custom view (UIView) and added it to my UIWindow in AppDelegate.m file:</p>
  
  <p><strong>AppDelegate.m</strong></p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {   
      self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  
      ViewCustom *view = [[ViewCustom alloc] initWithFrame:CGRectMake(0, 0, self.window.frame.size.width, self.window.frame.size.height)];
  
      [self.window addSubview:view];
  
      [self.window makeKeyAndVisible];
      return YES;
  }
  </code></pre>
  
  <p><strong>ViewCustom.m</strong></p>
  
  <pre><code>- (void)drawRect:(CGRect)rect {
     //Draw code comes here
  }
  </code></pre>
  
  <p>All i'm trying to do is create a navigation controller inside AppDelegate or inside my Custom View (what way is better?), I try to use this code below:</p>
  
  <pre><code>UINavigationController *navigation = [[UINavigationController alloc] initWithRootViewController:view];
  </code></pre>
  
  <p>But he say that <strong>is incompatible UIView with an UIViewController</strong>, how I solve this problem, and add an navigationController in my project? </p>