Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift 3 example of Bundle(for: XXX)

Tags:

swift

swift3

I am making a Swift 3 module. So I need to know the bundle associated with a class in that module. In Swift 2 this was:

let bundle = NSBundle(forClass: self.dynamicType)

How do I appropriately do this in Swift 3?

enter image description here

like image 640
William Entriken Avatar asked Feb 06 '23 03:02

William Entriken


1 Answers

Solution:

let bundle = Bundle(for: type(of: self))
like image 137
William Entriken Avatar answered Feb 21 '23 04:02

William Entriken