0
id copy = [[[self class] alloc] init];  // Objective-C

// ??? in siwft

What's the counterpart in swift?

tounaobun
  • 14,570
  • 9
  • 53
  • 75

1 Answers1

1

Are you looking for something like this?

class foo {
    var bar: Int
    required init() {
        bar = 42
    }
}
var a = foo()
var copy = a.dynamicType()
Thorsten Karrer
  • 1,345
  • 9
  • 19