Not able to pass returned value from viewB to viewA in SwiftUI

So I have a ViewA which returns a value called idd after defining a function addNote() and I wish to use that idd value in ViewB. I'm able to define idd in ViewB as viewA.addNote() however I'm not able to get the value of idd passed to viewB. And even Xcode says that my result from addNote() us unused. I'm new to swiftUI and learning everyday so I'd appreciate if you could let me know how to approach this problem. Thanks!

viewA Code:

class viewA: ObservableObject{
@Published var idd: String = ""

func addNote()-> String{
  
   // some Code

         return idd

}

}


viewB Code:

 struct ViewB: View {

    @StateObject var viewTwo = viewTwo()

    @State var idd = String()

     var body: some View {

        NavigationView {

            ZStack{
   .navigationTitle("Notes")
                
            .navigationBarItems(
                trailing: Button (action: {},
                                  
 label: { NavigationLink(destination: NoteView(newNote: "", idd: viewA.addNote() ) )
                   
                       
          {Image(systemName: "plus")} }
                     ))
                    .listStyle(.plain)
                    .buttonStyle(PlainButtonStyle())
          
                
                
                }
}
Not able to pass returned value from viewB to viewA in SwiftUI
 
 
Q