title: Trying to use an Observable Object in another class
body: <p>I want to use an observable object in another class.</p>
  <p>I want to use pitchers</p>
  <pre><code>import Foundation
  import SwiftUI
  
  class PositionViewModel: ObservableObject, Identifiable {
     
      @Published var Pitchers: [String] =  [&quot;--&quot;,&quot;--&quot;,&quot;--&quot;,&quot;--&quot;,&quot;--&quot;,&quot;--&quot;]
      
  }
  
  </code></pre>
  <p>in this class then be able to pass it to different functions to validate rules.</p>
  <pre><code>class ValidationLogic: ObservableObject {
  
      @Published var Positions: PositionViewModel = PositionViewModel()
  
       var TempArray: [String];.self//error here
  
      
      init(){
         
          TempArray = Positions.Pitchers
      }
          
      static func Validation(Position: String, FrameStatus: Bool){
          
         
          confirmNoBackToBack(Position: Position, FrameStatus: FrameStatus)
          
      }
  
   static func confirmNoBackToBack(Position: String, FrameStatus: Bool){
          
         }
     
      }
  
  </code></pre>
  <p>I have gotten to this point and am now getting an Expected Declaration error on the bold line. Not sure if I am just this last error from getting this to work or doing this the completely wrong way. I can use pitchers in a view but cant see to get it passed to my validationlogic class.</p>