title: How to create random numbers for multiple images to show randomly in Grid without repetition in iOS?
body: <p>I create GridView in SpriteKit.my requirement is to shuffle images randomly in Grid View.</p>
  
  <p>Here is my code to show images randomly without repetition.but this code is working for only two images.for multiple images this code is not working.</p>
  
  <pre><code>        int RandomRowMainImage          = arc4random_uniform(3);
          int RandomColumnMainImage       = arc4random_uniform(3);
  
          //
          int RandomRowOtherImage         = arc4random_uniform(3);
          int RandomColumnOtherImage      = arc4random_uniform(3);
  
          NSLog(@"RandomRowMain:%d \n Random Column :%d \n RandomRow1:%d \n randomColumn1 :%d",RandomRowMainImage,RandomColumnMainImage,RandomRowOtherImage,RandomColumnOtherImage);
  
          //
  
          BOOL checkStatus = [self checkRandomNumberColumRowLogic:RandomRowMainImage withMainRow:RandomColumnMainImage withOtherColumn:RandomColumnOtherImage withOtherRow:RandomRowOtherImage];
  
          if (checkStatus) {
              imgIcons.position      = [self GridPosition:MainRowCount Column:MainColumnCount];
              imgOtherImage.position = [self GridPosition:otherRowCount Column:otherColumnCount];
          }
  </code></pre>
  
  <p>than Code for Position of Images</p>
  
  <pre><code>//Grid Position
    -(CGPoint)GridPosition:(int)Row Column:(int)Column
   {
  CGFloat offset = SizeOfGrid / 2.0 + 0.5;
  CGFloat  x = Column * SizeOfGrid - (SizeOfGrid*TotalCol)/2.0 + offset;
  CGFloat  y = (TotalRows-Row-1) * SizeOfGrid -(SizeOfGrid*TotalRows)/2.0 + offset;
  
  return  CGPointMake(x, y);}
  </code></pre>
  
  <p>//Code to check prevent duplication of repeat random number for Two Images.</p>
  
  <pre><code>- (BOOL)checkRandomNumberColumRowLogic:(int)MainColumn withMainRow:(int)mainRow withOtherColumn:(int)otherColumn withOtherRow:(int)otherRow {
  
  BOOL CompareRow    = false;
  BOOL CompareColumn = false;
  
  if (mainRow == otherRow) {
      int otherRow = 0;
      for (int i = 0; i &lt; TotalCol; i++ ) {
          otherRow = [self checkRandomNumberCompare:otherRow];
          if (MainColumn == otherRow) {
              CompareRow = true;
              break;
          }
      }
      MainColumnCount = mainRow;
      otherColumnCount = otherRow;
  }
  else {
      CompareRow = true;
      MainRowCount = mainRow;
      otherRowCount = otherRow;
  }
  
  if (MainColumn == otherColumn) {
      int otherCol = 0;
      for (int i = 0; i &lt; TotalCol; i++ ) {
          otherCol = [self checkRandomNumberCompare:otherColumn];
          if (MainColumn == otherCol) {
              CompareColumn = true;
              break;
          }
      }
      MainColumnCount = MainColumn;
      otherColumnCount = otherCol;
  }
  else {
      CompareColumn = true;
      MainColumnCount = MainColumn;
      otherColumnCount = otherColumn;
  }
  
  if(CompareRow == CompareColumn) {
      return  true;
  } else  {
      return false;
  }
  }
  -(int)checkRandomNumberCompare:(int)compareRow {
  int compareDiff = arc4random_uniform(TotalRows);
  return compareDiff;
  }
  </code></pre>
  
  <p>can you please help to display multiple images without repeat? like one time one image in Node</p>