title: Delete spaces between words textfield
body: <p>I have an UITextField were you need to enter a city name. That city name is linked to an url: For example mywebsite/oslo</p>
  
  <p>But, when I enter New York than is it not an correct url. mywebsite/new york
  It needs to be this <a href="http://www.website.com/New-York" rel="nofollow">http://www.website.com/New-York</a> 
  How can I make a UITextField that replaces spaces with: --> -</p>
  
  <p>Thanks for your help! </p>
  
  <pre><code>- (void)configureControls {
  
  
  [self.activityIndicator stopAnimating];
  
  [UIView animateWithDuration:1.5 animations:^{
  
      if (self.weatherModel.lastLoadFailed) {
          self.locationTextField.enabled = YES;
          self.saveButton.hidden = NO;
          self.activityIndicator.hidden = YES;
          return;
      }
  
      self.settingsModel.location = self.locationTextField.text;
  
  
      PWForecastModel *forecast = self.weatherModel.sevenDayForecast[0];
      NSString *backgroundName = [PWHelper backgroundFileNameForConditionCode:forecast.conditions.conditionCode asDaytime:[[NSDate date] isDayTime]];
      if (![[NSDate date] isDayTime]) {
          [self styleControlsForDarkBackground];
      }
      self.backgroundImageView.image = [UIImage imageNamed:backgroundName];
      self.locationLabel.text = [NSString stringWithFormat:@"%@",self.weatherModel.cityName];
  }];
  </code></pre>
  
  <p>}</p>