hackiftekhar / IQDropDownTextField

TextField with DropDown support using UIPickerView
MIT License
309 stars 87 forks source link

Dropdown not working since .text was deprecated #36

Closed parkerdonat closed 7 years ago

parkerdonat commented 8 years ago

I changed my .text to .selectedItem and now the dropdown menu doesn't activate when tapped anymore. I checked this on my device and on simulator. Here is my sample code to initiate the dropdown:

-(void)textFieldDidBeginEditing:(UITextField *)textField {
    [self.messageField becomeFirstResponder];
    self.messageField.tintColor = [UIColor redColor];

     if ([textField.placeholder isEqualToString:@"Your message"]) {
      self.messageField.placeholder = @"";
      self.previewLabel.text = self.messageField.text;
    } else if (textField == self.messageField){
         [self.previewLabel setFont:[UIFont fontWithName:self.fontTextField.selectedItem size:[self.sizeTextField.selectedItem floatValue]]];
        self.previewLabel.text = self.messageField.text;
    }
}

Any ideas on how to fix this? Any help would be greatly appreciated. Thanks!

myusuf08 commented 8 years ago

how to fix it?

hackiftekhar commented 8 years ago

How you are setting your textField 'itemList'? What was your 'isOptional' parameter? Could you please share a demo?

parkerdonat commented 8 years ago

Sure. So I set these in the viewDidLoad. Here is an example of how I set them.

self.fontTextField.isOptionalDropDown = NO; self.fontTextField.delegate = self; [self.fontTextField setItemList:[UIFont arrayOfFonts]];

hackiftekhar commented 8 years ago

Don't know why but it should work. Could you please share a demo so that I can tKe a look at weekend.

hackiftekhar commented 8 years ago

Could you please provide a demo?

hackiftekhar commented 8 years ago

I believe this is fixed with #50, could you please recheck?