What is the name itself for the class name? Swift 3

I recently noticed that some codes initialize instances like ClassName.self (), for example:

let realm = try! Realm.self()

From the output and use in the future, it looks like without Realm ()

Is there any specific reason or use to execute init with .self?

+4
source share
1 answer

These are a few assumptions, but I believe that the places used Type.self()in the Realm context follow the wrongly accepted convention that followed (some inappropriate) that the Swift command resolves the error

Realm :

, (Type, Type.self, ) , Realm, Type.self , Type.self(). , , .self.

+1

Source: https://habr.com/ru/post/1663492/


All Articles