title: Path to bundle of iOS framework
body: <p>I am working on a framework for iOS, which comes with some datafiles. To load them into a <code>Dictionary</code> I do something like this:</p>
  
  <pre><code>public func loadPListFromBundle(filename: String, type: String) -&gt; [String : AnyObject]? {
      guard
         let bundle = Bundle(for: "com.myframework")
         let path = bundle.main.path(forResource: filename, ofType: type),
         let plistDict = NSDictionary(contentsOfFile: path) as? [String : AnyObject]
      else { 
         print("plist not found")
         return nil 
      }
  
      return plistDict
  }
  </code></pre>
  
  <p>If I use this in a playground with the framework, it works as intended.</p>
  
  <p>But if I use the framework embedded in an app, it doesn't work anymore, the "path" now points to the bundle of the app, not of the framework.</p>
  
  <p>How do I make sure that the bundle of the framework is accessed?</p>
  
  <p><strong>EDIT:</strong> the code above resides in the framework, not in the app.</p>
  
  <p><strong>EDIT2:</strong> the code above is a utility function, and is not part of a struct or class.</p>