9
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SwiftのProtocol Composition Typeについて

Posted at

指定したすべてのprotocolを実装している型を表現する仕組み。
例えば、FooProtocolとBarProtocolを実装している型を指定したければこうすれば良いようだ。

let instance : protocol<FooProtocol, BarProtocol> = FooBar()

これ使うとシンプルに書けるところはぼちぼちありそうだなという所感。

ソース: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Types.html#//apple_ref/doc/uid/TP40014097-CH31-ID454

9
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?