title: How can I create and display a UISlider programmatically in iOS?
body: <p>I found the code below in the Apple documentation and added it to my <code>viewDidLoad</code> method but the slider doesn't appear when I run the code.</p>
  
  <pre><code>CGRect frame = CGRectMake(0.0, 0.0, 200.0, 10.0);
  UISlider *slider = [[UISlider alloc] initWithFrame:frame];
  [slider addTarget:self action:@selector(sliderAction:) forControlEvents:UIControlEventValueChanged];
  [slider setBackgroundColor:[UIColor clearColor]];
  slider.minimumValue = 0.0;
  slider.maximumValue = 50.0;
  slider.continuous = YES;
  slider.value = 25.0;
  </code></pre>