178 lines
8.2 KiB
HTML
178 lines
8.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>Type Aliases Reference</title>
|
|
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
|
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
|
<meta charset='utf-8'>
|
|
<meta name="viewport" content="width=device-width, viewport-fit=cover, initial-scale=1.0" />
|
|
<script src="js/jquery.min.js" defer></script>
|
|
<script src="js/jazzy.js" defer></script>
|
|
|
|
</head>
|
|
<body>
|
|
<a name="//apple_ref/swift/Section/Type Aliases" class="dashAnchor"></a>
|
|
<a title="Type Aliases Reference"></a>
|
|
<header>
|
|
<div class="content-wrapper">
|
|
<p>
|
|
<a href="index.html">Swift MediaType Docs</a>
|
|
<span class="no-mobile"> (100% documented)</span>
|
|
</p>
|
|
|
|
<p class="header-right">
|
|
<a href="https://github.com/21GramConsulting/MediaType">
|
|
<img src="img/gh.png" alt="GitHub"/>
|
|
<span class="no-mobile">View on GitHub</span>
|
|
</a>
|
|
</p>
|
|
|
|
</div>
|
|
</header>
|
|
<div id="breadcrumbs-container">
|
|
<div class="content-wrapper">
|
|
<p id="breadcrumbs">
|
|
<span class="no-mobile">
|
|
<a href="index.html"> Reference</a>
|
|
<img id="carat" src="img/carat.png" alt=""/>
|
|
</span>
|
|
Type Aliases Reference
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="wrapper">
|
|
<div class="article-wrapper">
|
|
<article class="main-content">
|
|
<section>
|
|
<section class="section">
|
|
<h1>Type Aliases</h1>
|
|
<p>The following type aliases are available globally.</p>
|
|
|
|
</section>
|
|
<section class="section task-group-section">
|
|
<div class="task-group">
|
|
<ul>
|
|
<li class="item">
|
|
<div>
|
|
<code>
|
|
<a name="/s:9MediaType10Parametersa"></a>
|
|
<a name="//apple_ref/swift/Alias/Parameters" class="dashAnchor"></a>
|
|
<a class="token" href="#/s:9MediaType10Parametersa">Parameters</a>
|
|
</code>
|
|
</div>
|
|
<div class="height-container">
|
|
<div class="pointer-container"></div>
|
|
<section class="section">
|
|
<div class="pointer"></div>
|
|
<div class="abstract">
|
|
<p>Represents parameters of <code><a href="Enums/MediaType.html">MediaType</a></code>s.</p>
|
|
|
|
<p>A media type may have parameters. For example <code>text/html;charset=utf-8</code> defines a media type with UTF-8 charset
|
|
instead of the default ASCII.</p>
|
|
|
|
<p>You can specify arbitrary parameters to <em>any</em> of the <code><a href="Enums/MediaType.html">MediaType</a></code>s using a Swift
|
|
<a href="https://developer.apple.com/documentation/swift/dictionary">dictionary</a>. Keep in mind though, that not all such
|
|
parameter values are registered (see the
|
|
<a href="https://www.iana.org/assignments/media-types/media-types.xhtml">official site</a> for details).</p>
|
|
|
|
<p>You can specify parameters by using either the Swift DSL or string literal syntax. Parameters in string variables
|
|
are also supported. The following examples are equivalent:</p>
|
|
<pre class="highlight swift"><code><span class="k">let</span> <span class="nv">mediaType</span><span class="p">:</span> <span class="kt">MediaType</span> <span class="o">=</span> <span class="s">"audio/ac3;rate=32000"</span> <span class="c1">// is equivalent to</span>
|
|
|
|
<span class="k">let</span> <span class="nv">mediaType</span> <span class="o">=</span> <span class="kt">MediaType</span><span class="o">.</span><span class="nf">audio</span><span class="p">(</span><span class="o">.</span><span class="nf">ac3</span><span class="p">(</span><span class="kc">nil</span><span class="p">,</span> <span class="p">[</span><span class="s">"rate"</span><span class="p">:</span> <span class="mi">32_000</span><span class="p">]))</span> <span class="c1">// is equivalent to</span>
|
|
|
|
<span class="k">let</span> <span class="nv">rawMediaType</span> <span class="o">=</span> <span class="s">"audio/ac3;rate=32000"</span>
|
|
<span class="k">let</span> <span class="nv">mediaType</span> <span class="o">=</span> <span class="kt">MediaType</span><span class="p">(</span><span class="nv">rawValue</span><span class="p">:</span> <span class="n">rawMediaType</span><span class="p">)</span>
|
|
</code></pre>
|
|
|
|
</div>
|
|
<div class="declaration">
|
|
<h4>Declaration</h4>
|
|
<div class="language">
|
|
<p class="aside-title">Swift</p>
|
|
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">Parameters</span> <span class="o">=</span> <span class="p">[</span><span class="kt">String</span> <span class="p">:</span> <span class="kt">CustomStringConvertible</span><span class="p">?]</span></code></pre>
|
|
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
</article>
|
|
</div>
|
|
<div class="nav-wrapper">
|
|
<nav class="nav-bottom">
|
|
<ul class="nav-groups">
|
|
<li class="nav-group-name">
|
|
<a href="Enums.html">Enumerations</a>
|
|
<ul class="nav-group-tasks">
|
|
<li class="nav-group-task">
|
|
<a href="Enums/Anything.html">Anything</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="Enums/Application.html">Application</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="Enums/Audio.html">Audio</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="Enums/Font.html">Font</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="Enums/Image.html">Image</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="Enums/MediaType.html">MediaType</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="Enums/Message.html">Message</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="Enums/Model.html">Model</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="Enums/Multipart.html">Multipart</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="Enums/Suffix.html">Suffix</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="Enums/Text.html">Text</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="Enums/Video.html">Video</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="nav-group-name">
|
|
<a href="Extensions.html">Extensions</a>
|
|
<ul class="nav-group-tasks">
|
|
<li class="nav-group-task">
|
|
<a href="Extensions/Optional.html">Optional</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="nav-group-name">
|
|
<a href="Typealiases.html">Type Aliases</a>
|
|
<ul class="nav-group-tasks">
|
|
<li class="nav-group-task">
|
|
<a href="Typealiases.html#/s:9MediaType10Parametersa">Parameters</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
<div class="footer-wrapper">
|
|
<section id="footer">
|
|
<p>© 2022 <a class="link" href="https://21gram.hu" target="_blank" rel="external noopener">21Gram Technology Kft.</a>. All rights reserved. (Last updated: 2022-03-28)</p>
|
|
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.2</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|