JSONRegistry

@objcMembers public final class JSONRegistry: NSObject

Manages the registration of fields.

This class is designed as a singleton instance, accessible via Field.JSONRegistry.shared.

  • Shared instance.

    Declaration

    Swift

    public static let shared = JSONRegistry()
  • Callback for creating a Field instance from JSON

    Declaration

    Swift

    public typealias CreationHandler = (_ json: [String: Any]) throws -> Field
  • Registers a JSON creation handler for a given field key.

    Declaration

    Swift

    public func registerType(_ type: String, creationHandler: @escaping CreationHandler)
  • Unregisters a JSON creation handler for a given field key.

    Declaration

    Swift

    public func unregisterType(_ type: String)