---
title: "init(input:configuration:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/photogrammetrysession/init(input:configuration:)-7glmh"
---

# init(input:configuration:)

Creates a session from a sequence of samples.

## Declaration

```swift
convenience init<S>(input: S, configuration: PhotogrammetrySession.Configuration = Configuration()) throws where S : Sequence, S.Element == PhotogrammetrySample
```

## Parameters

- `input`: The input Sequence that will be iterated once to yield all input data.
- `configuration`: The session-wide configuration to use for this session.

## Discussion

Discussion Creates a new session instance from a custom sequence of PhotogrammetrySample objects by iterating over the provided  Sequence object. The constructor will only use makeIterator() on input and will then iterate through the sequence only once.  A provided iterator should be lazy, or a lazy  Sequence and map used. note: To minimize memory usage, use lazy sequences that only create a PhotogrammetrySample as it iterates by making calls to next() on its associated IteratorProtocol.

## See Also

### Creating the session

- [init(input:configuration:)](realitykit/photogrammetrysession/init(input:configuration:)-wo4e.md)
- [isSupported](realitykit/photogrammetrysession/issupported.md)
