---
layout: "default"
title: "sorted"
description: "Swift documentation for 'sorted': Return an Array containing the sorted elements of source{according}."
keywords: "sorted,func,swift,documentation"
root: "/v1.2"
---

<div class="declaration" id="func-sorted-c_-sequencetype-where-c-generator-element_-comparable_-c">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-sorted-c_-sequencetype-where-c-generator-element_-comparable_-c">func <wbr>sorted&lt;C :<wbr> SequenceType where C.Generator.El