Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
SwiftにArrayはfirst、配列の最初の要素 (または配列が空の場合は nil) を返す関数があります。
Array
first
最初の要素なしで配列の残りを返す組み込み関数はありますか?
Swift 2.2、3+ の正解:
let restOfArray = Array(array.dropFirst())
Swift 3+の更新:
以下のコメントで@leanneが指摘したように、これが可能になったようです。
let restOfArray = array.dropFirst()