Autofill-Stadt und Staat aus der zip-code in iOS

Ich habe drei Textfelder in meinem Blick.
1. Zip-code, 2. Stadt und 3. Zustand.

Wie autofill-Stadt und Staat-Feld aus der zip-code 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?
}
Schreibe einen Kommentar