UIPickerView: select 一个元素接一个完成动画

UIPickerView: select one element after the other finishes animation

我有一个包含两个元素的 UIPickerView:月和日。我正在做这个

[self.picker selectRow:3 inComponent:0 animated:YES];
[self.picker selectRow:10 inComponent:1 animated:YES];

这使得两个元素都滚动到所选项目。

但实际上我想做的是滚动第一个元素,然后,当第一个元素滚动完成时,滚动第二个元素。

我可以在延迟后进行派送,但这是一个 hack。

有没有办法知道第一个动画何时结束然后触发第二个?

实现委托方法pickerView:didSelectRow:inComponent:

在第一个选择器上调用 selectRow,然后当第一个选择器的第 3 行调用 didSelectRow 时,在第二个选择器上调用 selectRow