CINXE.COM

Documentation

<!doctype html><html lang="en-US" class="no-js"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><link rel="icon" href="/swift-book/favicon.ico"><link rel="mask-icon" href="/swift-book/favicon.svg" color="#333333"><title>Documentation</title><script>var baseUrl = "/swift-book/"</script><script defer="defer" src="/swift-book/js/chunk-vendors.bdb7cbba.js"></script><script defer="defer" src="/swift-book/js/index.eb7415ab.js"></script><link href="/swift-book/css/index.3a335429.css" rel="stylesheet"></head><body data-color-scheme="auto"><template id="custom-footer"><!-- This source file is part of the Swift.org open source project Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors --> <script src="https://swift.org/assets/javascripts/docc/footer.js"></script> <footer id="footer" role="contentinfo" hidden> <div class="container"> <div> <p class="copyright">Copyright © 2014–2023 Apple Inc. and the Swift project authors. All rights reserved.</p> <p>This document is made available under a <a rel="license" href="https://creativecommons.org/licenses/by/4.0/" style="color: #09f">Creative Commons Attribution 4.0 International (CC BY 4.0) License</a>.</p> <p class="trademark">Swift and the Swift logo are trademarks of Apple Inc.</p> <p class="privacy"> <a href="//www.apple.com/privacy/privacy-policy/">Privacy Policy</a> <a href="//www.apple.com/legal/privacy/en-ww/cookies/">Cookies</a> </p> </div> <div class="footer-other"> <form class="color-scheme-toggle" role="radiogroup" tabindex="0" id="color-scheme-toggle" > <legend class="visuallyhidden">Color scheme preference</legend> <label for="scheme-light"> <input id="scheme-light" type="radio" class="visuallyhidden" name="color-scheme-preference" value="light" onchange="doccAppearance('light')"> <span class="color-scheme-toggle-label">Light</span> </label> <label for="scheme-dark"> <input id="scheme-dark" type="radio" class="visuallyhidden" name="color-scheme-preference" value="dark" onchange="doccAppearance('dark')"> <span class="color-scheme-toggle-label">Dark</span> </label> <label for="scheme-auto" id="scheme-auto-wrapper"> <input id="scheme-auto" type="radio" class="visuallyhidden" name="color-scheme-preference" value="auto" onchange="doccAppearance('auto')"> <span class="color-scheme-toggle-label">Auto</span> </label> </form> <aside> <a href="/atom.xml" title="Subscribe to Site Updates"><i class="feed"></i></a> <a href="https://twitter.com/swiftlang" rel="nofollow" title="Follow @SwiftLang on Twitter"><i class="twitter"></i></a> </aside> </div> </div> <style type="text/css"> /* Expanded SCSS from apple/swift-org-website commit a09c14493f812: /assets/stylesheets/_screen.scss#L925 */ .color-scheme-toggle { display: block; outline: none; --toggle-color-fill: var(--color-button-background); font-size: 12px; border: 1px solid #fff; border-radius: 4px; display: inline-flex; padding: 1px; margin-bottom: 1em; } .color-scheme-toggle input { position: absolute; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(0px 0px 99.9% 99.9%); overflow: hidden; height: 1px; width: 1px; padding: 0; border: 0; appearance:none } .color-scheme-toggle-label { border: 1px solid transparent; border-radius: var(--toggle-border-radius-inner, 2px); display: inline-block; text-align: center; padding: 1px 6px; min-width: 42px; box-sizing:border-box } .color-scheme-toggle-label:hover { cursor:pointer } input:checked + .color-scheme-toggle-label { background: #fff; color: rgba(42,42,42,0.9); } [role="contentinfo"] { display: flex; justify-content:space-between } .visuallyhidden { position: absolute; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(0px 0px 99.9% 99.9%); overflow: hidden; height: 1px; width: 1px; padding: 0; border:0 } </style> <script type="text/javascript"> // DocC uses this local storage key to persist appearance preferences. const appearanceKey = 'developer.setting.preferredColorScheme' window.addEventListener('DOMContentLoaded', _ => { let appearancePreference = localStorage.getItem(appearanceKey) if (appearancePreference) { // Set a color scheme according to a saved preference. document.body.dataset.colorScheme = appearancePreference document.querySelector('custom-footer') .shadowRoot .querySelector(`#scheme-${appearancePreference}`) .checked = true } else { document.querySelector('custom-footer') .shadowRoot .querySelector(`#scheme-auto`) .checked = true } }) // Set a color scheme based on user choice and persist it. function doccAppearance(mode) { document.body.dataset.colorScheme = mode switch(mode) { case 'light': localStorage.setItem(appearanceKey, mode) break case 'dark': localStorage.setItem(appearanceKey, mode) break case 'auto': localStorage.removeItem(appearanceKey) break } } </script> </footer> </template><template id="custom-header"><!-- This source file is part of the Swift.org open source project Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors --> <script src="https://swift.org/assets/javascripts/docc/header.js"></script> <header id="header" role="banner" hidden> <div class="container"> <nav id="home" role="navigation"> <a aria-label="Swift.org" href="/" id="logo" role="img" title="Swift.org" >Swift.org</a> </nav> <button id="small-menu-toggle"></button> <nav id="menu"> <ul class="links"> <li><a href="https://www.swift.org/blog/">Blog</a></li> <li><a href="https://www.swift.org/download/">Download</a></li> <li><a href="https://www.swift.org/getting-started/">Getting Started</a></li> <li><a href="https://www.swift.org/documentation/">Documentation</a></li> </ul> </nav> </div> </header> </template><noscript><style>.noscript{font-family:"SF Pro Display","SF Pro Icons","Helvetica Neue",Helvetica,Arial,sans-serif;margin:92px auto 140px auto;text-align:center;width:980px}.noscript-title{color:#111;font-size:48px;font-weight:600;letter-spacing:-.003em;line-height:1.08365;margin:0 auto 54px auto;width:502px}@media only screen and (max-width:1068px){.noscript{margin:90px auto 120px auto;width:692px}.noscript-title{font-size:40px;letter-spacing:0;line-height:1.1;margin:0 auto 45px auto;width:420px}}@media only screen and (max-width:735px){.noscript{margin:45px auto 60px auto;width:87.5%}.noscript-title{font-size:32px;letter-spacing:.004em;line-height:1.125;margin:0 auto 35px auto;max-width:330px;width:auto}}#loading-placeholder{display:none}</style><div class="noscript"><h1 class="noscript-title">This page requires JavaScript.</h1><p>Please turn on JavaScript in your browser and refresh the page to view its content.</p></div></noscript><div id="app"></div></body></html>

Pages: 1 2 3 4 5 6 7 8 9 10