title: How to check UIView is nil or not in objective c
body: <p>I am new in iOS and I am facing problem regarding to do validation of view. I have created Signature like view
  <a href="https://stackoverflow.com/questions/39660219/how-to-draw-signature-on-uiview">How to draw Signature on UIView</a>, and now I want to do validation by using this code</p>
  
  <pre><code>-(IBAction)SavebtnClick:(id)sender
  {
  
      if(drawSignView==nil)
      {
         UIAlertView *alertviewshow =[[UIAlertView alloc] initWithTitle:@"Warning!" message:@"Pease Sign" delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
          [alertviewshow show];
      }
      else if (drawSignViewClient==nil)
      {
          UIAlertView *alertviewshow =[[UIAlertView alloc] initWithTitle:@"Warning!" message:@"Please Sign" delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
          [alertviewshow show];
      }
      else
      {
  
          viewcontroller1 *management =[[viewcontroller1 alloc] initWithNibName:@"viewcontroller1" bundle:nil];
          [self.navigationController pushViewController:management animated:YES];
      }
  }
  </code></pre>
  
  <p>But I am not getting success. Please tell me what I am doing wrong.</p>
  
  <p><a href="https://i.stack.imgur.com/W6FuZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W6FuZ.png" alt="enter image description here"></a></p>
  
  <p>I want to do validation.</p>
  
  <p><a href="https://i.stack.imgur.com/ZoN9K.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZoN9K.png" alt="enter image description here"></a></p>
  
  <p>if I have not sign it shows the message.</p>
  
  <p>Please give me suggestion.</p>
  
  <p>Thanks in advance!</p>
  
  <p>I save Image and used condition </p>
  
  <pre><code>UIGraphicsBeginImageContext(self.drawSignView.bounds.size);
      [[self.drawSignView.layer presentationLayer] renderInContext:UIGraphicsGetCurrentContext()];
      UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
      UIGraphicsEndImageContext();
      // NSData *postData = UIImageJPEGRepresentation(viewImage, 1.0);
  
  
      // Store the data
      NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
  
  
      NSData *imageData = UIImageJPEGRepresentation(viewImage, 100);
      [defaults setObject:imageData forKey:@"image"];
  
      [defaults synchronize];
  
  
      if(viewImage==nil)
      {
          UIAlertView *alertviewshow =[[UIAlertView alloc] initWithTitle:@"Warning!" message:@"Pease Sign" delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
          [alertviewshow setTag:1];
          [alertviewshow show];
      }
  </code></pre>
  
  <p>But it not work because it contain blank image.</p>