Quantcast
Channel: Active questions tagged uipickerview - Stack Overflow
Viewing all articles
Browse latest Browse all 592

Picker delegate scrolling method in SwiftUI

$
0
0

I have simple Picker object in my SwiftUI hierarchy:

Picker(selection: $pickerSelection, label: Text("Select your item")) {    ForEach(0 ..< items.count) {        Text("\(self.items[$0].valueCode)")            .tag($0)    }}

I'm using a scrollable Picker in WatchOS app and it works just fine. I'm even getting a Digital Crown rotation capability for free.

What I want to do is to detect when the scrolling started and especially ended (to get last selected value and execute and action with it)

I figure I need to implement sort of Delegate method to read the changes happening to the Picker but I'm not sure how, nor I'm able to find any in the documentation for WKInterfacePicker or just Picker

Any suggestions on how to detect the beginning and end of the scrolling event?


Viewing all articles
Browse latest Browse all 592

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>