Reference to all Swift Protocols?

Well I haven't seen any documentation, but here's a trick I've been using (in XCode):

import Swift

…and then [CMD] - click on "Swift" which takes you to the headers for the Swift std lib.

You can see lots of protocols and what they require in there, including the ones seen in the docs (mentioned in the comments by esqew) which is helpful for understanding how to use the headers (at least some of the things in there have an explanation)

Edit:

I just remembered that I saw a list of "Special Protocols" in one of the WWDC videos, and took a screenshot :)

They are (as seen in the slide):

  • LogicValueif logicValue {
  • Printable"\(printable)"
  • Sequencefor x in sequence
  • IntegerLiteralConvertible65536
  • FloatLiteralConvertible1.0
  • StringLiteralConvertible"abc"
  • ArrayLiteralConvertible[ a, b, c ]
  • DictionaryLiteralConvertible[ a: x, b: y ]

The Literal Convertible ones mean you can assign to them with a literal a la:

class MyString: StringLiteralConvertible {
  …
}

var x: MyString = "asdf"

Interestingly not mentioned: Equatable, and Comparable (which are covered in the docs mentioned above)


Maybe too late to answer but for others that are also wondering about it.

There is an autogenerated documentation website for Swift which includes docs about Types, Protocols, Operators, Globals and, Functions. Changing version is also possible for finding removed protocols etc.

https://swiftdoc.org/


Where can I find a list of all protocols?

You're surely not interested in a list of all protocols, but rather the protocols defined in a given framework. So, maybe you want the UIKit protocols, or the iAd framework protocols, etc. You'll find them in the documentation for the framework.

If you're instead trying to find all the protocols in your project, use Xcode's symbol navigator (second icon from the left at the top left part of the project window, just right of file navigator icon).