title: StringWithFormat "%.2ld" objc to swift
body: <p>I have an 'pickerView' object in a swift project.
  I do understand the code in Objective-c but I'm not sure how to implement it in Swift.</p>
  
  <p><strong>The Objc method</strong></p>
  
  <pre><code>-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
  {
      switch (component)
      {
          case 0://Week
              return 7;
          case 1://Hour
              return 24;
          default://Minutes
              return 60;//or 7;(10 by 10) //or 13;(5 by 5)
      }
  }
  </code></pre>
  
  <p>I'm only not sure how to implement the switch statement for the titleForRow function.
  So the <code>stringWithFormat:@"%.2ld",(long)row</code> is the problem.</p>
  
  <pre><code>-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
  {
      switch (component)
      {
          case 0://Week
              return _dayOfWeek[row];
          case 1://Hour
              return [NSString stringWithFormat:@"%.2ld",(long)row];
          default://Minutes
              return [NSString stringWithFormat:@"%.2ld",(long)row];//or ,row*10] //or ,row*5]
      }
  }
  </code></pre>
  
  <p>Can any one help me.</p>
  
  <p>Greetings, dax</p>