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

// ??? in siwft

What's the counterpart in swift?

tounaobun
  • 14,042
  • 9
  • 49
  • 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,315
  • 8
  • 19