Using paginationLimitedTo with Search | Swift Client

The documentation says:

Instead, use search along with the paginationLimitedTo setting to retrieve more than 1,000 results.

However it is not clear how to use them together. The docs suggest that pageinationLimitedTO be used with setSettings. When I try do this I get a throwing error in swift when trying to unpack the response. Could someone help me resolve this?