都市名を入力する必要がある場合は、UITextField があります。その都市名は URL にリンクされています: mywebsite/oslo など
しかし、ニューヨークに入ると、それは正しい URL ではありません。mywebsite/new york これである必要がありますhttp://www.website.com/New-York スペースを次のように置き換える UITextField を作成するにはどうすればよいですか: --> -
ご協力いただきありがとうございます!
- (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];
}];
}