One Logo Pool Ball
TabularData · IOS API REFERENCE

CSVReadingOptions

struct · iOS 15.0+ · SDK 27.1

struct CSVReadingOptions

A set of CSV file-reading options.

Members (21)

get · iOS 15.0+

dateParsers

TypeScript
get dateParsers(): Array<((arg0: string) => Promise<(globalThis.Date) | null>)>
Swift declaration
var dateParsers: [(String) -> Date?]

An array of closures that parse a date from a string.

set · iOS 15.0+

dateParsers

TypeScript
set dateParsers(value: Array<((arg0: string) => (globalThis.Date) | null)>)
Swift declaration
var dateParsers: [(String) -> Date?]

An array of closures that parse a date from a string.

get · iOS 15.0+

usesQuoting

TypeScript
get usesQuoting(): boolean
Swift declaration
var usesQuoting: Bool

A Boolean value that indicates whether to enable quoting. When `true`, the contents of a quoted field can contain special characters, such as the field delimiter and newlines. Defaults to `true`.

set · iOS 15.0+

usesQuoting

TypeScript
set usesQuoting(value: boolean)
Swift declaration
var usesQuoting: Bool

A Boolean value that indicates whether to enable quoting. When `true`, the contents of a quoted field can contain special characters, such as the field delimiter and newlines. Defaults to `true`.

init · iOS 15.0+

init

TypeScript
static init(hasHeaderRow?: boolean, nilEncodings?: Array<string>, trueEncodings?: Array<string>, falseEncodings?: Array<string>, floatingPointType?: CSVType, ignoresEmptyLines?: boolean, usesQuoting?: boolean, usesEscaping?: boolean, delimiter?: string, escapeCharacter?: string): CSVReadingOptions
Swift declaration
init(hasHeaderRow: Bool = true, nilEncodings: Set<String> = ["", "#N/A", "#N/A N/A", "#NA", "N/A", "NA", "NULL", "n/a", "nil", "null"], trueEncodings: Set<String> = ["1", "True", "TRUE", "true"], falseEncodings: Set<String> = ["0", "False", "FALSE", "false"], floatingPointType: CSVType = .double, ignoresEmptyLines: Bool = true, usesQuoting: Bool = true, usesEscaping: Bool = false, delimiter: Character = Character(","), escapeCharacter: Character = Character("\\"))

Creates a set of options for reading a CSV file. - Parameters: - hasHeaderRow: A Boolean value that indicates whether the CSV file has a header row. Defaults to `true`. - nilEncodings: A list of recognized encodings of `nil`. Defaults to `["", "#N/A", "#N/A N/A", "#NA", "N/A", "NA", "NULL", "n/a", "null"]`. - trueEncodings: A list of acceptable encodings of `true`. Defaults to `["1", "True", "TRUE", "true"]`. - falseEncodings: A list of acceptable encodings of `false`. Defaults to `["0", "False", "FALSE", "false"]`. - floatingPointType: A type to use for floating-point numeric values (either ``CSVType/double`` or ``CSVType/float``). Defaults to ``CSVType/double``. - ignoresEmptyLines: A Boolean value that indicates whether to ignore empty lines. Defaults to `true.` - usesQuoting: A Boolean value that indicates whether the CSV file uses quoting. Defaults to `true`. - usesEscaping: A Boolean value that indicates whether the CSV file uses escaping sequences. Defaults to `false`. - delimiter: A field delimiter. Defaults to comma (`,`). - escapeCharacter: An escape character to use if ``usesEscaping`` is true. Defaults to backslash (`\`).

get · iOS 15.0+

hasHeaderRow

TypeScript
get hasHeaderRow(): boolean
Swift declaration
var hasHeaderRow: Bool

A Boolean value that indicates whether the CSV file has a header row. Defaults to `true`.

set · iOS 15.0+

hasHeaderRow

TypeScript
set hasHeaderRow(value: boolean)
Swift declaration
var hasHeaderRow: Bool

A Boolean value that indicates whether the CSV file has a header row. Defaults to `true`.

get · iOS 15.0+

nilEncodings

TypeScript
get nilEncodings(): Array<string>
Swift declaration
var nilEncodings: Set<String>

The set of strings that stores acceptable spellings for empty values. Defaults to `["", "#N/A", "#N/A N/A", "#NA", "N/A", "NA", "NULL", "n/a", "null"]`.

set · iOS 15.0+

nilEncodings

TypeScript
set nilEncodings(value: Array<string>)
Swift declaration
var nilEncodings: Set<String>

The set of strings that stores acceptable spellings for empty values. Defaults to `["", "#N/A", "#N/A N/A", "#NA", "N/A", "NA", "NULL", "n/a", "null"]`.

get · iOS 15.0+

usesEscaping

TypeScript
get usesEscaping(): boolean
Swift declaration
var usesEscaping: Bool

A Boolean value that indicates whether to enable escaping. When `true`, you can escape special characters, such as the field delimiter, by prefixing them with the escape character, which is the backslash (`\`) by default. Defaults to `false`.

set · iOS 15.0+

usesEscaping

TypeScript
set usesEscaping(value: boolean)
Swift declaration
var usesEscaping: Bool

A Boolean value that indicates whether to enable escaping. When `true`, you can escape special characters, such as the field delimiter, by prefixing them with the escape character, which is the backslash (`\`) by default. Defaults to `false`.

get · iOS 15.0+

trueEncodings

TypeScript
get trueEncodings(): Array<string>
Swift declaration
var trueEncodings: Set<String>

The set of strings that stores acceptable spellings for true Boolean values. Defaults to `["1", "True", "TRUE", "true"]`.

set · iOS 15.0+

trueEncodings

TypeScript
set trueEncodings(value: Array<string>)
Swift declaration
var trueEncodings: Set<String>

The set of strings that stores acceptable spellings for true Boolean values. Defaults to `["1", "True", "TRUE", "true"]`.

get · iOS 15.0+

falseEncodings

TypeScript
get falseEncodings(): Array<string>
Swift declaration
var falseEncodings: Set<String>

The set of strings that stores acceptable spellings for false Boolean values. Defaults to `["0", "False", "FALSE", "false"]`.

set · iOS 15.0+

falseEncodings

TypeScript
set falseEncodings(value: Array<string>)
Swift declaration
var falseEncodings: Set<String>

The set of strings that stores acceptable spellings for false Boolean values. Defaults to `["0", "False", "FALSE", "false"]`.

get · iOS 15.0+

escapeCharacter

TypeScript
get escapeCharacter(): string
Swift declaration
var escapeCharacter: Character { get }

The character that precedes other characters, such as quotation marks, so that the parser interprets them as literal characters instead of special ones. Defaults to backslash(`\`).

get · iOS 15.0+

floatingPointType

TypeScript
get floatingPointType(): CSVType
Swift declaration
var floatingPointType: CSVType

The type to use for floating-point numeric values. Defaults to ``CSVType/double``.

set · iOS 15.0+

floatingPointType

TypeScript
set floatingPointType(value: CSVType)
Swift declaration
var floatingPointType: CSVType

The type to use for floating-point numeric values. Defaults to ``CSVType/double``.

get · iOS 15.0+

ignoresEmptyLines

TypeScript
get ignoresEmptyLines(): boolean
Swift declaration
var ignoresEmptyLines: Bool

A Boolean value that indicates whether to ignore empty lines. Defaults to `true`.

set · iOS 15.0+

ignoresEmptyLines

TypeScript
set ignoresEmptyLines(value: boolean)
Swift declaration
var ignoresEmptyLines: Bool

A Boolean value that indicates whether to ignore empty lines. Defaults to `true`.

get · iOS 15.0+

delimiter

TypeScript
get delimiter(): string
Swift declaration
var delimiter: Character { get }

The character that separates data fields in a CSV file, typically a comma. Defaults to comma (`,`).

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

CSVReadingOptions.addDateParseStrategy(_:)

This declaration needs Swift generic type arguments. (no canonical witness for T)

All TabularData types →