Reputation: 31
Code to find my framework location
// Bundle+Ext.swift
// AVStream
private final class AVStream { }
extension Bundle {
static var avstream: Bundle {
moduleBundle(for: AVStream.self)
}
public static func moduleBundle(for object: AnyObject) -> Bundle! {
Bundle.moduleBundle(forObject: object)
}
public static func moduleBundle(forObject: AnyObject) -> Bundle {
Bundle(for: type(of: forObject))
}
}
A tried to get the url, but it is nil
guard let url = Bundle.avstream.url(forResource:"RemoteVideos", withExtension: "json") else {
return
}
Upvotes: 1
Views: 703
Reputation: 31
After adding the file to the framework on the Target Membership. I was able to get the file's path/url
Upvotes: 1