Where to find list of *all* Swift global functions such as min/max, repeatElement, sequence etc?

And the source of these functions?

This list is up to Swift 4.2: Global Functions — SwiftDoc.org, is this update-to-date to latest 5.5?

Here is a list I got from eye balling Xcode autocomplete list:

abs(_ x:)
all( _ mask:)
any(_ mask:)
assert(_ condition, _ message:)
assert(_ condition:)
assertionFailure()
assertionFailure(_ message:)
debugPrint(_ items: Any…, separator: String, terminator: String)
debugPrint(_ items: Any…, separator: String, terminator: String, to output: &TextOutputStream)
dump(_ value: T,  to target: &TextOutputStream, name: String?, indent: Int, maxDepth: Int, maxItem: Int) -> T
dump(_ value: T, name: String?, indent: Int, maxDepth: Int, maxItem: Int)
fatalError(_ message:)
getVaList(_ args:)
isKnownUniquelyReferenced(_: &T) -> Bool
isKnownUniquelyReferenced(_: &T?) -> Bool
max(_ x, _ y:, _ x:, rest:)
max(_:, _:)
numericCast(_ x:)
pointwiseMax(_ a: SIMD, _ b: SIMD) -> SIMD
pointwiseMin(_ a: SIMD, _ b:  SIMD) -> SIMD
preconditionFailure()
preconditionFailure(_ message:)
print(_ items: Any…, separator: String, terminator: String)
print(_ items: Any…, separator: String, terminator: String, to output: &TextOutputStream)
readLine()
readLine(strippingNewline:)
repeatElement(_:count)
sequence(first:next:)
sequence(state:next:)
stride(from:through:by)
stride(from:to:by:)
swap(_ a: &T, _ b: &T)
transcode(_ input: IteratorProtocol, from inputEncoding: _UnicodeEncodingProtocol, stoppingOnError)
type(of:)
unsafeBitCast(_:to:)
unsafeDowncast(_:to:)
withExtendedLifetime(_: T, _ body: () throws -> Result) rethrows -> Result
withExtendedLifetime(_: T, _ body: (T) throws -> Result) rethrows -> Result
withUnsafeBytes(of value: &T, _ body: (UnsafePointer)
withUnsafeBytes(of value: &T, _ body: (UnsafeRawBufferPointer)
withUnsafeBytes(of value: T, _ body: (UnsafePointer)
withUnsafeBytes(of value: T, _ body: (UnsafeRawBufferPointer)
withUnsafeMutableBytes(of value: &T, _ body: (UnsafeMutablePointer) throws -> Result) rethrows -> Result
withUnsafeMutableBytes(of value: &T, _ body: (UnsafeMutableRawBufferPointer) throws -> Result) rethrows -> Result
withVaList( args: [CVarArg], _ body: (CVaListPointer) -> R) -> R
withVaList(_ args:, _ body)
withoutActuallyEscaping(_ closure: ClosureType, do body: (ClosureType) throws -> ResultType) rethrows -> ResultType
withoutActuallyEscaping(_ closure:, do body:)
zip(_ sequence1: Sequence, _ sequence2: Sequence) -> Zip2Sequenxe<Sequence, Sequence>
1 Like

You should be able to see most of them when the IDE is trying to autocomplete Swift..

1 Like

Type in just "Swift.", sometimes Xcode doesn't show autocomplete, just an error message, Xcode seems to want you to give it some prefix, like se then show the list of this prefix:

But sometime type just "Swift." Xcode does show the autocomplete list, but this list doesn't include all global functions, like here it's missing the sequence()'s zip (I scroll all the way down and don't see them), so who knows what eles it's not showing?:

Screen Shot 2021-11-13 at 2.06.17 PM

Xcode Version 13.2 beta (13C5066c)

Okay, you said "most"... so...anyway to get a complete list? So odd Xcode autocomplete list is so “fuzzy”.

That list in SwiftDoc.org seem pretty complete. Would love to get a “definitive” all list

1 Like
Terms of Service

Privacy Policy

Cookie Policy