During development, you may want to see what strada-ios
is doing behind the scenes. To enable debug logging, call Strada.config.debugLoggingEnabled = true
. Debug logging should always be disabled in your production app. For example:
#if DEBUG
Strada.config.debugLoggingEnabled = true
#endif
By default, strada-ios
uses JSONEncoder and JSONDecoder to encode/decode Message.data
with your own data models that implement the Codeable
/Decodable
/Encodable
protocols.
If you'd like to customize the encoding/decoding strategy, you can configure this in your app:
let encoder = JSONEncoder()
encoder.keyEncodingStrategy = .convertToSnakeCase
// Configure your encoder as Strada's automatic encoder
Strada.config.jsonEncoder = encoder
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase
// Configure your decoder as Strada's automatic decoder
Strada.config.jsonDecoder = decoder