Ho tre campi di testo nella mia vista. 1. CAP, 2. Città e 3. Stato.Compilazione automatica città e stato dal codice di avviamento postale in iOS
Come compilare automaticamente il campo città e stato dal codice di avviamento postale in iOS?
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
NSString *currentString = [textField.text stringByReplacingCharactersInRange:range withString:string];
int length = [currentString length];
if(length > 5)
{
return NO;
}
if(length == 5)
{
[self getCityAndState];
}
return YES;
}
- (void) getCityAndState
{
//How to use google (or any) api to autofill city and state in objective - c?
}
Usa Goolge geocodifica API - [vedere questo] (https://developers.google.com/maps/documentation/geocoding/?csw=1) – Shruti
controllare questo link http://stackoverflow.com/questions/4749706/lookup-city-and-state-by-zip-google-geocode-api – user2071152