---
title: flushSegment()
framework: avfoundation
role: symbol
role_heading: Instance Method
path: avfoundation/avassetwriter/flushsegment()
---

# flushSegment()

Closes the current segment and outputs it to a delegate method.

## Declaration

```swift
func flushSegment()
```

## Discussion

Discussion Call this method only when the preferredOutputSegmentInterval property value is indefinite.

## See Also

### Configuring segment writing

- [delegate](avfoundation/avassetwriter/delegate.md)
- [AVAssetWriterDelegate](avfoundation/avassetwriterdelegate.md)
- [preferredOutputSegmentInterval](avfoundation/avassetwriter/preferredoutputsegmentinterval.md)
- [initialSegmentStartTime](avfoundation/avassetwriter/initialsegmentstarttime.md)
- [outputFileTypeProfile](avfoundation/avassetwriter/outputfiletypeprofile.md)
