<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/LazySequenceProtocol/drop(while:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s20LazySequenceProtocolPsE4drop5whiles0a9DropWhileB0Vy8ElementsQzGSb7ElementQzc_tF"
  },
  "title" : "drop(while:)"
}
-->

# drop(while:)

Returns a lazy sequence that skips any initial elements that satisfy
`predicate`.

```
func drop(while predicate: @escaping (Self.Elements.Element) -> Bool) -> LazyDropWhileSequence<Self.Elements>
```

## Parameters

`predicate`

A closure that takes an element of the sequence as
its argument and returns `true` if the element should be skipped or
`false` otherwise. Once `predicate` returns `false` it will not be
called again.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)