Hey, is there any way to determine is UIPickerView is scrolling currently, I really need that functionality for my app, it's really important. Thanks!
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Xcode: Is there a way to change line spacing (UI L
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
There is a trick to detect this but there is no delegate method/ property to detect if it's scrolling or not
func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String?
or equivalent methodfunc pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int)
There is a UIPickerViewDelegate method which is basically triggered every time you scroll the picker
Set the delegate for your picker, implement this method and see what happens...
[EDIT] ok now I understand what you need. Implement a timer which checks the state of the picker.
in the above delegate method, store the last time the picker had been moved.
in the checkPicker method check how much time had elapsed from the last move
if timeSinceMove is bigger then some desired value i.e. 0.5 seconds, set your BOOL pickerMoving to false. else set it to true. This is not the most precise method to check for movement, but I think it should do the job...