Group Group Group Group Group Group Group Group Group

How do I read the tag #

No problem in displaying the Text, but how can I read the tag# with the print statement or the good old NSLog. format.

In the old way, I had no problem in capturing the tag # Thank you ahead of time for a reply.

struct SegmentedDirectorsCut: View {

var symbolsURL = ["Yes", "No"]

 @State private var directorCut = 1

  var body: some View {
     VStack {
       HStack {

           Picker(selection: $directorCut, label: Text("Picker")) {
                 ForEach(0 ..< symbolsURL.count) {
    Text("Director Selected: \(symbolsURL[directorCut])")



struct SegmentedDirectorsCut_Previews: PreviewProvider {
static var previews: some View {

Hi @hcri1950,
What is it that you really want to do? If you want to get the tag, it is already in directorCut, however if you want to print it for debugging, then you can use a very simple trick.

   extension View {
    func debugPrint(_ msg: Any ...) -> Self {
        return self

That’s all you need to do and now you can use it like

    Text("Director Selected: \(symbolsURL[directorCut])")
    .debugPrint("we selected : \(directorCut)")



1 Like

This is the second time that I did not get notified of a reply. THANK YOU for that has helped.