[swift-users] Get class of object in Swift 2.3

Nate Birkholz nbirkholz at gmail.com
Thu Nov 10 15:01:43 CST 2016


Never mind, .dynamicType works, it just doesn't autocomplete any more.
/facepalm

On Thu, Nov 10, 2016 at 11:54 AM, Nate Birkholz <nbirkholz at gmail.com> wrote:

> self.dynamicType doesn't work any more, but type(of: self) is just Swift
> 3.0 So how do i get the class?
>
> Use case in a unit test:
>
> let bundle = NSBundle(forClass: type(of: self))
>
> --
> Nate Birkholz
>



-- 
Nate Birkholz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20161110/78a2b376/attachment.html>


More information about the swift-users mailing list