title: How to implement a plist with Vision in Swift?
body: <p>I am trying to create a program that uses Vision to recognize canned drinks and display the name and caffeine content into two UILabels on the screen. I trained a model in CreateML to recognize Monster and Del's Shandy. I have a small plist (for testing purposes) and some code that I thought would display the drink, but it doesn't seem to be working. I have gotten the name and confidence level to display, although this is not exactly what I want. Here's the code that I have been using to try to access the plist:</p>
  <pre><code>DispatchQueue.main.sync {
                      if self.productID != nil {
                          guard self.productCatalog[self.productID] != nil else {
                              return
                          }
                          self.outputLabel.text = self.productCatalog[self.productID]?[&quot;Name&quot;] as? String
                          self.caffeineContentLabel.text = self.productCatalog[self.productID]?[&quot;Caffeine&quot;] as? String
  
                          
                      }
  </code></pre>
  <p>The method I used to read the dictionary of the plist is as follows:</p>
  <pre><code>    override func awakeFromNib() {
          if let path = Bundle.main.path(forResource: &quot;ProductCatalog&quot;, ofType: &quot;plist&quot;) {
              productCatalog = NSDictionary(contentsOfFile: path) as? [String: [String: Any]]
          }
      }
  
  </code></pre>