title: How do I introduce delay in my function?
body: <p>I'm developing a game in which I'm reducing the frame size of an imageView. When I'm introducing a condition using while loop, I'm not able to see the image reducing its size gradually, since it immediately jumps to the final result. So, I want to introduce a delay after every instruction so that I can see the effect of its size reduction little by little.
         I can't use timer since it needs me to specify a function to be executed after that time interval. </p>
  
  <pre><code>while(ravanImage1.frame.origin.y&gt;=end.y)
  {
  ravanImage1.frame=CGRectMake(150,((ravanImage1.frame.origin.y)-5),q,z);
  
  if(ravanImage1.center.y&gt;=300&amp;&amp;ravanImage1.center.y&lt;=370)
  {
      q=60;
      z=60;
      ravanImage1.frame=CGRectMake(150,((ravanImage1.frame.origin.y)-5),q,z);
  }   
  
  if(ravanImage1.center.y&gt;=230&amp;&amp;ravanImage1.center.y&lt;=299)
  {
      q=40;
      z=40;
      ravanImage1.frame=CGRectMake(150,((ravanImage1.frame.origin.y)-5),q,z);
  }
  
  if(ravanImage1.center.y&gt;=150&amp;&amp;ravanImage1.center.y&lt;=229)
  {       
      q=20;
      z=20;
      ravanImage1.frame=CGRectMake(150,((ravanImage1.frame.origin.y)-5),q,z);
  }
  }
  </code></pre>
  
  <p>I want to introduce delay after every frame change.</p>
  
  <p>Can anybody please help me?</p>