(instancetype)sharedStore in Swift


#1

What would the implementation of BNRItemStore on page 166 look like with Swift? I’m trying to go through the book and translate but getting stuck in some places along the way. Thanks!


#2

Well, as instancetype helps the compiler to determine the method returns an instance of the class so you would need to return BNRItemStore?

func shareStore() -> BNRItemStore?
{
// various stuff
}