Avatar
あ、Fooないじゃん
7:38 AM
protocol Foo { init?(string: String) } class SubRegExp: NSRegularExpression, Foo { override init(pattern: String, options: NSRegularExpression.Options = []) throws { try super.init(pattern: pattern, options: options) } convenience required init?(string: String) { try? self.init(pattern: string, options: .caseInsensitive) } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } }
7:38 AM
こうか
7:38 AM
なるほど〜
7:39 AM
うーん、こういうものなのか。勉強になりました