0
id copy = [[[self class] alloc] init]; // Objective-C
// ??? in siwft
swift中的對應部分是什麼?在swift中這個陳述的等價物是什麼?
id copy = [[[self class] alloc] init]; // Objective-C
// ??? in siwft
swift中的對應部分是什麼?在swift中這個陳述的等價物是什麼?
你在找這樣的嗎?
class foo {
var bar: Int
required init() {
bar = 42
}
}
var a = foo()
var copy = a.dynamicType()
我該如何在UIView中用swift實現NSCopying協議? – tounaobun 2014-12-02 10:01:27