Avatar
omochimetaru 9/7/2018 3:41 AM
protocol FantasyCoding { init(coder: FantasyCoder) } class FantasyView: FantasyCoding { required! init(coder: FantasyCoder) { } } class MyView: FantasyView { var x, y, z: Int // ok not to override init(coder:) here } extension FantasyURL: ExpressibleByStringLiteral { // OK to add a required! initializer in an extension required! init(stringLiteral: String) { .. } }
3:41 AM
required! を書くのはサブクラス側ですよ。